Changeset View
Changeset View
Standalone View
Standalone View
extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.h
| Show First 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | public: | ||||
| } | } | ||||
| virtual int calculateSerializeBufferSize() const; | virtual int calculateSerializeBufferSize() const; | ||||
| ///fills the dataBuffer and returns the struct name (and 0 on failure) | ///fills the dataBuffer and returns the struct name (and 0 on failure) | ||||
| virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const; | virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const; | ||||
| SIMD_FORCE_INLINE void deSerializeFloat(struct btCapsuleShapeData* dataBuffer); | |||||
| }; | }; | ||||
| ///btCapsuleShapeX represents a capsule around the Z axis | ///btCapsuleShapeX represents a capsule around the Z axis | ||||
| ///the total height is height+2*radius, so the height is just the height between the center of each 'sphere' of the capsule caps. | ///the total height is height+2*radius, so the height is just the height between the center of each 'sphere' of the capsule caps. | ||||
| class btCapsuleShapeX : public btCapsuleShape | class btCapsuleShapeX : public btCapsuleShape | ||||
| { | { | ||||
| public: | public: | ||||
| ▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | SIMD_FORCE_INLINE const char* btCapsuleShape::serialize(void* dataBuffer, btSerializer* serializer) const | ||||
| btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData,serializer); | btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData,serializer); | ||||
| shapeData->m_upAxis = m_upAxis; | shapeData->m_upAxis = m_upAxis; | ||||
| return "btCapsuleShapeData"; | return "btCapsuleShapeData"; | ||||
| } | } | ||||
| SIMD_FORCE_INLINE void btCapsuleShape::deSerializeFloat(btCapsuleShapeData* dataBuffer) | |||||
| { | |||||
| m_implicitShapeDimensions.deSerializeFloat(dataBuffer->m_convexInternalShapeData.m_implicitShapeDimensions); | |||||
| m_collisionMargin = dataBuffer->m_convexInternalShapeData.m_collisionMargin; | |||||
| m_localScaling.deSerializeFloat(dataBuffer->m_convexInternalShapeData.m_localScaling); | |||||
| //it is best to already pre-allocate the matching btCapsuleShape*(X/Z) version to match m_upAxis | |||||
| m_upAxis = dataBuffer->m_upAxis; | |||||
| } | |||||
| #endif //BT_CAPSULE_SHAPE_H | #endif //BT_CAPSULE_SHAPE_H | ||||