1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #ifndef BTRAYSHAPE_H
- #define BTRAYSHAPE_H
- #include <BulletCollision/CollisionShapes/btConvexInternalShape.h>
- ATTRIBUTE_ALIGNED16(class)
- btRayShape : public btConvexInternalShape {
- btScalar m_length;
- bool slipsOnSlope;
-
- btVector3 m_shapeAxis;
- btTransform m_cacheSupportPoint;
- btScalar m_cacheScaledLength;
- public:
- BT_DECLARE_ALIGNED_ALLOCATOR();
- btRayShape(btScalar length);
- virtual ~btRayShape();
- void setLength(btScalar p_length);
- btScalar getLength() const { return m_length; }
- void setSlipsOnSlope(bool p_slipOnSlope);
- bool getSlipsOnSlope() const { return slipsOnSlope; }
- const btTransform &getSupportPoint() const { return m_cacheSupportPoint; }
- const btScalar &getScaledLength() const { return m_cacheScaledLength; }
- virtual btVector3 localGetSupportingVertex(const btVector3 &vec) const;
- #ifndef __SPU__
- virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3 &vec) const;
- #endif
- virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3 *vectors, btVector3 *supportVerticesOut, int numVectors) const;
-
- virtual void getAabb(const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const;
- #ifndef __SPU__
- virtual void calculateLocalInertia(btScalar mass, btVector3 & inertia) const;
- virtual const char *getName() const {
- return "RayZ";
- }
- #endif
- virtual int getNumPreferredPenetrationDirections() const;
- virtual void getPreferredPenetrationDirection(int index, btVector3 &penetrationVector) const;
- private:
- void reload_cache();
- };
- #endif
|