Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::ph::PhysManager Class Reference

#include <PhysManager.h>

Public Member Functions

 PhysManager ()
 Constructor.
virtual ~PhysManager ()
 Destructor.
virtual bool Init (float gravity=-9.8f, float skinWidth=0.025f, float timing=0.016, bool selfTimeCalc=true, Material *defaultMaterial=NULL, bool isConnectToRemoteDebugger=true)=0
 Init the physics engine.
virtual TileTerrainShapeCreateTileTerrain (sn::TileTerrain *terrain)=0
 Creates a tile terrain shape for doing dynamics.
virtual ActorDynamicCreateDynamicActor (sn::SceneNode *kgeObj, math::KGE_SHAPES shape=math::KGE_SHAPE_AABB, BodyFlag bf=EBFP_NORMAL, Material *material=NULL, float mass=1.0f)=0
 Creates a Basic Dynamic Actor.
virtual ActorDynamicCreateDynamicActor (sn::SceneNode *kgeObj, math::Shape *shape, BodyFlag bf=EBFP_NORMAL, Material *material=NULL, float mass=1.0f)=0
virtual ActorStaticCreateStaticActor (sn::SceneNode *kgeObj, math::KGE_SHAPES shape=math::KGE_SHAPE_AABB, CollitionType ct=ECTP_TRIGGER_DISABLE)=0
 Creates a Basic Static Actor.
virtual ActorStaticCreateStaticActor (sn::SceneNode *kgeObj, math::Shape *shape, CollitionType ct=ECTP_TRIGGER_DISABLE)=0
virtual bool ReleaseActor (ph::ActorDynamic *actor)=0
 Release Actor.
virtual PlaneCreatePlane (sn::SceneNode *kgePlane, math::Vector *normal)=0
 Craete a Basic Plane.
virtual PlaneCreatePlane (math::Vector *pos, math::Vector *normal, float d)=0
virtual bool Calculate (float time=0.0f)=0
 Physc Calculate.
virtual bool UpdateKgeScene (void)=0
 physc Update KGE Scene
virtual bool UpdateKgeSceneForOneActor (ph::ActorDynamic *actor)=0
virtual MaterialCreateMaterial (float Restitution, float staticFriction, float dynamicFriction, float dynamicFrictionV, float staticFrictionV, kge::math::Vector *dir)=0
 Physic Create Material.
virtual MaterialCreateMaterial (void)=0
 Physic Create Material.
virtual void SetUserNotify (UserNotify *pUserNotify)=0
 Set User Notify User Report , You Most set the Pointer of UserNotify Class then Pass it to below Function.
virtual void SetTriggerReport (TriggerReport *pTriggerReport)=0
 Set Trigger Report , You Most set the Pointer To Function of TriggerReport Class then pass it to below Function.
virtual void RaycatAllShapes (math::Vector *dir, math::Vector *orig, core::Functor1< bool, RaycastReport * > *CallBackFunc, ERCP_Raycast shapeType=ERCP_ALL_SHAPES, int group=0xFFFFFFFF, float maxDis=3.402823466e+38F)=0
 Raycast All Shapes in Scene.
virtual bool RaycastAnyShape (math::Vector *dir, math::Vector *orig, ERCP_Raycast shapeType=ERCP_ALL_SHAPES, int group=0xFFFFFFFF, float maxDis=3.402823466e+38F)=0
 Return true if Ray any Shape.
virtual RaycastReportRaycastClosestShape (math::Vector *dir, math::Vector *orig, ERCP_Raycast shapeType=ERCP_ALL_SHAPES, int group=0xFFFFFFFF, float maxDis=3.402823466e+38F)=0
 return Closest Shape( Actor ) to ray Point( orig )
virtual JointCreateSphericalJoint (Actor *a1, Actor *a2, math::Vector *Anchor)=0
 Create Spherical Joint ( a2 can set to NULL )
virtual JointCreateRevoluteJoint (Actor *a1, Actor *a2, math::Vector *Anchor)=0
 Create Revolute Joint ( a2 Can Set To Null )
virtual JointCreatePrismaticJoint (Actor *a1, Actor *a2, math::Vector *Anchor, math::Vector *axis=NULL)=0
 Create Perismatic Joint.
virtual JointCreateCylindricalJoint (Actor *a1, Actor *a2, math::Vector *Anchor, math::Vector *axis=NULL)=0
 Create Cylindrical joint.
virtual JointCreateFixedJoint (Actor *a1, Actor *a2, math::Vector *Anchor, math::Vector *axis=NULL)=0
 Create Fixed joint.
virtual JointCreateDistanceJoint (Actor *a1, Actor *a2, math::Vector *Anchor, DistanceJointFlag flags=EDJF_DISABLE, unsigned int minDis=0, unsigned int maxDis=0)=0
 Create Distance Joint.

Protected Attributes

core::Timerm_pTimer
bool m_bIsSelfTimeCalc
unsigned int m_iDynamicActorCounter
unsigned int m_iStaticActorCounter

Detailed Description

Definition at line 42 of file PhysManager.h.

Constructor & Destructor Documentation

kge::ph::PhysManager::PhysManager ( )
inline

Constructor.

Definition at line 47 of file PhysManager.h.

virtual kge::ph::PhysManager::~PhysManager ( )
inlinevirtual

Destructor.

Definition at line 50 of file PhysManager.h.

Member Function Documentation

virtual bool kge::ph::PhysManager::Calculate ( float  time = 0.0f)
pure virtual

Physc Calculate.

virtual Joint* kge::ph::PhysManager::CreateCylindricalJoint ( Actor a1,
Actor a2,
math::Vector Anchor,
math::Vector axis = NULL 
)
pure virtual

Create Cylindrical joint.

virtual Joint* kge::ph::PhysManager::CreateDistanceJoint ( Actor a1,
Actor a2,
math::Vector Anchor,
DistanceJointFlag  flags = EDJF_DISABLE,
unsigned int  minDis = 0,
unsigned int  maxDis = 0 
)
pure virtual

Create Distance Joint.

virtual ActorDynamic* kge::ph::PhysManager::CreateDynamicActor ( sn::SceneNode kgeObj,
math::KGE_SHAPES  shape = math::KGE_SHAPE_AABB,
BodyFlag  bf = EBFP_NORMAL,
Material material = NULL,
float  mass = 1.0f 
)
pure virtual

Creates a Basic Dynamic Actor.

virtual ActorDynamic* kge::ph::PhysManager::CreateDynamicActor ( sn::SceneNode kgeObj,
math::Shape shape,
BodyFlag  bf = EBFP_NORMAL,
Material material = NULL,
float  mass = 1.0f 
)
pure virtual
virtual Joint* kge::ph::PhysManager::CreateFixedJoint ( Actor a1,
Actor a2,
math::Vector Anchor,
math::Vector axis = NULL 
)
pure virtual

Create Fixed joint.

virtual Material* kge::ph::PhysManager::CreateMaterial ( float  Restitution,
float  staticFriction,
float  dynamicFriction,
float  dynamicFrictionV,
float  staticFrictionV,
kge::math::Vector dir 
)
pure virtual

Physic Create Material.

virtual Material* kge::ph::PhysManager::CreateMaterial ( void  )
pure virtual

Physic Create Material.

virtual Plane* kge::ph::PhysManager::CreatePlane ( sn::SceneNode kgePlane,
math::Vector normal 
)
pure virtual

Craete a Basic Plane.

virtual Plane* kge::ph::PhysManager::CreatePlane ( math::Vector pos,
math::Vector normal,
float  d 
)
pure virtual
virtual Joint* kge::ph::PhysManager::CreatePrismaticJoint ( Actor a1,
Actor a2,
math::Vector Anchor,
math::Vector axis = NULL 
)
pure virtual

Create Perismatic Joint.

virtual Joint* kge::ph::PhysManager::CreateRevoluteJoint ( Actor a1,
Actor a2,
math::Vector Anchor 
)
pure virtual

Create Revolute Joint ( a2 Can Set To Null )

virtual Joint* kge::ph::PhysManager::CreateSphericalJoint ( Actor a1,
Actor a2,
math::Vector Anchor 
)
pure virtual

Create Spherical Joint ( a2 can set to NULL )

virtual ActorStatic* kge::ph::PhysManager::CreateStaticActor ( sn::SceneNode kgeObj,
math::KGE_SHAPES  shape = math::KGE_SHAPE_AABB,
CollitionType  ct = ECTP_TRIGGER_DISABLE 
)
pure virtual

Creates a Basic Static Actor.

virtual ActorStatic* kge::ph::PhysManager::CreateStaticActor ( sn::SceneNode kgeObj,
math::Shape shape,
CollitionType  ct = ECTP_TRIGGER_DISABLE 
)
pure virtual
virtual TileTerrainShape* kge::ph::PhysManager::CreateTileTerrain ( sn::TileTerrain terrain)
pure virtual

Creates a tile terrain shape for doing dynamics.

virtual bool kge::ph::PhysManager::Init ( float  gravity = -9.8f,
float  skinWidth = 0.025f,
float  timing = 0.016,
bool  selfTimeCalc = true,
Material defaultMaterial = NULL,
bool  isConnectToRemoteDebugger = true 
)
pure virtual

Init the physics engine.

virtual bool kge::ph::PhysManager::RaycastAnyShape ( math::Vector dir,
math::Vector orig,
ERCP_Raycast  shapeType = ERCP_ALL_SHAPES,
int  group = 0xFFFFFFFF,
float  maxDis = 3.402823466e+38F 
)
pure virtual

Return true if Ray any Shape.

virtual RaycastReport* kge::ph::PhysManager::RaycastClosestShape ( math::Vector dir,
math::Vector orig,
ERCP_Raycast  shapeType = ERCP_ALL_SHAPES,
int  group = 0xFFFFFFFF,
float  maxDis = 3.402823466e+38F 
)
pure virtual

return Closest Shape( Actor ) to ray Point( orig )

virtual void kge::ph::PhysManager::RaycatAllShapes ( math::Vector dir,
math::Vector orig,
core::Functor1< bool, RaycastReport * > *  CallBackFunc,
ERCP_Raycast  shapeType = ERCP_ALL_SHAPES,
int  group = 0xFFFFFFFF,
float  maxDis = 3.402823466e+38F 
)
pure virtual

Raycast All Shapes in Scene.

virtual bool kge::ph::PhysManager::ReleaseActor ( ph::ActorDynamic actor)
pure virtual

Release Actor.

virtual void kge::ph::PhysManager::SetTriggerReport ( TriggerReport pTriggerReport)
pure virtual

Set Trigger Report , You Most set the Pointer To Function of TriggerReport Class then pass it to below Function.

virtual void kge::ph::PhysManager::SetUserNotify ( UserNotify pUserNotify)
pure virtual

Set User Notify User Report , You Most set the Pointer of UserNotify Class then Pass it to below Function.

virtual bool kge::ph::PhysManager::UpdateKgeScene ( void  )
pure virtual

physc Update KGE Scene

virtual bool kge::ph::PhysManager::UpdateKgeSceneForOneActor ( ph::ActorDynamic actor)
pure virtual

Member Data Documentation

bool kge::ph::PhysManager::m_bIsSelfTimeCalc
protected

Definition at line 125 of file PhysManager.h.

unsigned int kge::ph::PhysManager::m_iDynamicActorCounter
protected

Definition at line 126 of file PhysManager.h.

unsigned int kge::ph::PhysManager::m_iStaticActorCounter
protected

Definition at line 127 of file PhysManager.h.

core::Timer* kge::ph::PhysManager::m_pTimer
protected

Definition at line 124 of file PhysManager.h.


The documentation for this class was generated from the following file: