SO3Engine
SO3ShapeConvexHull.cpp
Go to the documentation of this file.
1
12
13namespace SO3
14{
15
16SShapeConvexHull::SShapeConvexHull() : SShape("", SShape::SO3_NULL_COLLISION)
17{
18 // Forbiden, private.
19}
20
21SShapeConvexHull::SShapeConvexHull(const std::string& shapeName, SEntity* entity, const Ogre::Real& tolerance) : SShape(shapeName, SShape::SO3_SHAPE_COLLISION)
22{
23 Ogre::Vector3 poffset = Ogre::Vector3::ZERO;
24 Ogre::Vector3 scale = Ogre::Vector3::UNIT_SCALE;
25#ifdef USE_COLLISION_NOSCALE
26 scale = entity->GetGlobalScale();
27#endif
28
29 mCollisionPtr = OgreNewt::CollisionPtr(new OgreNewt::CollisionPrimitives::ConvexHull(entity->GetParentScene()->GetPhysicsWorld()->GetPhysicWorld(), entity->getOgreEntityPointer(), 0, Ogre::Quaternion::IDENTITY, poffset, tolerance, scale));
30 mTolerance = tolerance;
31}
32
36
38{
39 return mTolerance;
40}
41
42}
Ogre::Entity * getOgreEntityPointer()
SScene * GetParentScene()
virtual Ogre::Vector3 GetGlobalScale()
OgreNewt::World * GetPhysicWorld()
SPhysicWorld * GetPhysicsWorld()
OgreNewt::CollisionPtr mCollisionPtr
Definition SO3Shape.h:66
Manage physics shape .
Collision * CollisionPtr