2022-11-11 00:07:05 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-11-11 05:01:17 +00:00
|
|
|
#include <bullet/BulletCollision/CollisionShapes/btCylinderShape.h>
|
2022-11-11 00:07:05 +00:00
|
|
|
#include "vector.h"
|
|
|
|
|
|
|
|
namespace simpleengine::physics::collision {
|
|
|
|
class CylinderShape {
|
|
|
|
btCylinderShape inner;
|
|
|
|
public:
|
|
|
|
CylinderShape(btCylinderShape inner) : inner(inner) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-11-11 04:53:03 +00:00
|
|
|
* @brief Create a CylinderShape with the extent of the cylinder shape.
|
2022-11-11 00:07:05 +00:00
|
|
|
*
|
|
|
|
* @note These extents are in half-extents since that's what the underlying Physics engine uses (Bullet).
|
|
|
|
*
|
2022-11-11 04:53:03 +00:00
|
|
|
* @param x_extent The extent of the cylinder shape in the x direction.
|
|
|
|
* @param y_extent The extent of the cylinder shape in the y direction.
|
|
|
|
* @param z_extent The extent of the cylinder shape in the z direction.
|
2022-11-11 00:07:05 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
CylinderShape(const float& x_extent, const float& y_extent, const float& z_extent) : inner(btVector3(btScalar(x_extent), btScalar(y_extent), btScalar(z_extent))) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-11-11 04:53:03 +00:00
|
|
|
* @brief Create a CylinderShape with the extent of the cylinder shape.
|
2022-11-11 00:07:05 +00:00
|
|
|
*
|
|
|
|
* @note These extents are in half-extents since that's what the underlying Physics engine uses (Bullet).
|
|
|
|
*
|
|
|
|
* @param extent The extent of the cylinder.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
CylinderShape(const simpleengine::Vectorf& extent) : CylinderShape(extent.x(), extent.y(), extent.z()) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the inner bullet cylinder shape object as a pointer.
|
|
|
|
*
|
|
|
|
* @return btCylinderShape*
|
|
|
|
*/
|
|
|
|
btCylinderShape* get_inner_ptr() {
|
|
|
|
return &inner;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the inner bullet cylinder shape object as a reference.
|
|
|
|
*
|
|
|
|
* @return btCylinderShape&
|
|
|
|
*/
|
|
|
|
btCylinderShape& get_inner() {
|
|
|
|
return inner;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|