Project

General

Profile

SO3Engine
SO3ShapeTree.cpp
Go to the documentation of this file.
1
13
14namespace SO3
15{
16
17SShapeTree::SShapeTree() : SShape("", SShape::SO3_NULL_COLLISION)
18{
19 // Forbiden, private.
20}
21
22SShapeTree::SShapeTree(const std::string& shapeName, SEntity* entity, const bool& optimize) : SShape(shapeName, SShape::SO3_TREE_COLLISION)
23{
24 Ogre::Vector3 scale = Ogre::Vector3::UNIT_SCALE;
25#ifdef USE_COLLISION_NOSCALE
26 scale = entity->GetGlobalScale();
27#endif
28
30 mOptimize = optimize;
31}
32
33SShapeTree::SShapeTree(const std::string& shapeName, SNode* node, const bool& optimize) : SShape(shapeName, SShape::SO3_TREE_COLLISION)
34{
35 Ogre::Vector3 scale = Ogre::Vector3::UNIT_SCALE;
36#ifdef USE_COLLISION_NOSCALE
37 scale = node->GetGlobalScale();
38#endif
39
40 node->GetOgreSceneNodePointer()->_update(true, true);
42 mOptimize = optimize;
43}
44
48
50{
51 return mOptimize;
52}
53
54}
TreeCollision - complex polygonal collision.
Ogre::Entity * getOgreEntityPointer()
SScene * GetParentScene()
virtual Ogre::Vector3 GetGlobalScale()
Ogre::SceneNode * GetOgreSceneNodePointer()
OgreNewt::World * GetPhysicWorld()
SPhysicWorld * GetPhysicsWorld()
OgreNewt::CollisionPtr mCollisionPtr
Definition SO3Shape.h:66
Manage physics shape .
Collision * CollisionPtr