PixelLightAPI
.
|
Ragdoll scene node. More...
#include <SNRagdoll.h>
Public Types | |
enum | EDebugFlags { DebugNoPhysicsBodies = 1<<18 } |
Scene node debug flags (SceneNode debug flags extension) More... | |
Public Member Functions | |
PLPHYSICS_API bool | GetAttachToWorldEnabled () const |
PLPHYSICS_API void | SetAttachToWorldEnabled (bool bValue) |
PLPHYSICS_API bool | GetAutoFreeze () const |
PLPHYSICS_API void | SetAutoFreeze (bool bValue) |
PLPHYSICS_API bool | GetUseGravity () const |
PLPHYSICS_API void | SetUseGravity (bool bValue) |
PLPHYSICS_API | SNRagdoll () |
Default constructor. | |
virtual PLPHYSICS_API | ~SNRagdoll () |
Destructor. | |
PLPHYSICS_API SCPhysicsWorld * | GetWorldContainer () const |
Returns the PL physics world scene node container the ragdoll is in. | |
PLPHYSICS_API void | ClearRagdoll () |
Clears the radgoll. | |
PLPHYSICS_API bool | CreateRagdoll (PLMesh::SkeletonHandler *pSkeletonHandler=nullptr) |
Creates the ragdoll using a skeleton handler. | |
PLPHYSICS_API void | CreatePhysics (bool bAllowAttachToWorld=true) |
Creates the physics. | |
PLPHYSICS_API void | CreatePhysicsBodies () |
Creates the physics bodies. | |
PLPHYSICS_API void | CreatePhysicsJoints (bool bAllowAttachToWorld=true) |
Creates the physics joints. | |
PLPHYSICS_API void | CreatePhysicsRagdoll (bool bAllowAttachToWorld=true) |
Creates the physics ragdoll. | |
PLPHYSICS_API PLMesh::Skeleton * | GetSkeleton () const |
Returns the ragdoll skeleton. | |
PLPHYSICS_API bool | IsEnabled () const |
Returns whether the ragdoll is enabled or not. | |
PLPHYSICS_API void | SetEnabled (bool bEnabled=true) |
Enables/disables all bodies and joints. | |
PLPHYSICS_API PLCore::uint32 | GetNumOfBodies () const |
Returns the number of bodies. | |
PLPHYSICS_API RagdollBody * | GetBody (PLCore::uint32 nIndex) const |
Returns a body. | |
PLPHYSICS_API RagdollBody * | GetBody (const PLCore::String &sName) const |
Returns a body. | |
PLPHYSICS_API RagdollBody * | AddBody (const PLCore::String &sName="Joint", bool bCreatePhysics=true) |
Adds a new body. | |
PLPHYSICS_API RagdollBody * | CloneBody (PLCore::uint32 nIndex, bool bCreatePhysics=true) |
Clones a body. | |
PLPHYSICS_API bool | RemoveBody (PLCore::uint32 nIndex) |
Removes a body. | |
PLPHYSICS_API bool | RemoveBodyAndJoint (PLCore::uint32 nIndex) |
Removes a body and the joint attached to it. | |
PLPHYSICS_API PLCore::uint32 | GetNumOfJoints () const |
Returns the number of joints. | |
PLPHYSICS_API RagdollJoint * | GetJoint (PLCore::uint32 nIndex) const |
Returns a joint. | |
PLPHYSICS_API RagdollJoint * | GetJoint (const PLCore::String &sName) const |
Returns a joint. | |
PLPHYSICS_API RagdollJoint * | AddJoint (const PLCore::String &sName="Joint", bool bCreatePhysics=true) |
Adds a new joint. | |
PLPHYSICS_API RagdollJoint * | CloneJoint (PLCore::uint32 nIndex, bool bCreatePhysics=true) |
Clones a joint. | |
PLPHYSICS_API bool | RemoveJoint (PLCore::uint32 nIndex) |
Removes a joint. | |
PLPHYSICS_API PLCore::uint32 | GetNumOfNoCollisions () const |
Returns the number of no collisions. | |
PLPHYSICS_API NoCollision * | AddNoCollision () |
Adds a new no collision. | |
PLPHYSICS_API NoCollision * | GetNoCollision (PLCore::uint32 nIndex) const |
Returns a no collision. | |
PLPHYSICS_API bool | RemoveNoCollision (PLCore::uint32 nIndex) |
Removes a no collision. | |
PLPHYSICS_API PLCore::uint32 | GetNumOfControllers () const |
Returns the number of controllers. | |
PLPHYSICS_API JointController * | AddController (const PLCore::String &sJointName) |
Adds a new controller. | |
PLPHYSICS_API JointController * | GetController (PLCore::uint32 nIndex) const |
Returns a controller. | |
PLPHYSICS_API JointController * | GetController (const PLCore::String &sName) const |
Returns a controller. | |
PLPHYSICS_API bool | RemoveController (PLCore::uint32 nIndex) |
Removes a controller. | |
virtual PLPHYSICS_API void | DrawDebug (PLRenderer::Renderer &cRenderer, const PLScene::VisNode *pVisNode=nullptr) override |
This function is called when the debug parts of the scene are drawn. | |
virtual PLPHYSICS_API bool | Unload () override |
Unloads the loadable. | |
virtual PLPHYSICS_API PLCore::String | GetLoadableTypeName () const override |
Returns the loadable type name. | |
Protected Member Functions | |
virtual PLPHYSICS_API void | InitFunction () override |
This function is called when the scene node gets initialized. | |
virtual PLPHYSICS_API void | DeInitFunction () override |
This function is called when the scene node gets de-initialized. | |
virtual PLPHYSICS_API void | OnActivate (bool bActivate) override |
Called when the scene node has been activated or deactivated. | |
virtual PLPHYSICS_API bool | CallLoadable (PLCore::File &cFile, PLCore::Loader &cLoader, const PLCore::String &sMethod, const PLCore::String &sParams) override |
Calls the loadable in order to load or save. |
Ragdoll scene node.
PLPHYSICS_API PLPhysics::SNRagdoll::SNRagdoll | ( | ) |
Default constructor.
virtual PLPHYSICS_API PLPhysics::SNRagdoll::~SNRagdoll | ( | ) | [virtual] |
Destructor.
PLPHYSICS_API bool PLPhysics::SNRagdoll::GetAttachToWorldEnabled | ( | ) | const |
PLPHYSICS_API void PLPhysics::SNRagdoll::SetAttachToWorldEnabled | ( | bool | bValue | ) |
PLPHYSICS_API bool PLPhysics::SNRagdoll::GetAutoFreeze | ( | ) | const |
PLPHYSICS_API void PLPhysics::SNRagdoll::SetAutoFreeze | ( | bool | bValue | ) |
PLPHYSICS_API bool PLPhysics::SNRagdoll::GetUseGravity | ( | ) | const |
PLPHYSICS_API void PLPhysics::SNRagdoll::SetUseGravity | ( | bool | bValue | ) |
PLPHYSICS_API SCPhysicsWorld* PLPhysics::SNRagdoll::GetWorldContainer | ( | ) | const |
Returns the PL physics world scene node container the ragdoll is in.
PLPHYSICS_API void PLPhysics::SNRagdoll::ClearRagdoll | ( | ) |
Clears the radgoll.
PLPHYSICS_API bool PLPhysics::SNRagdoll::CreateRagdoll | ( | PLMesh::SkeletonHandler * | pSkeletonHandler = nullptr | ) |
Creates the ragdoll using a skeleton handler.
[in] | pSkeletonHandler | Skeleton handler to get the ragdoll information from, if a null pointer, a ragdoll is created automatically using the skeleton handler of the used mesh |
PLPHYSICS_API void PLPhysics::SNRagdoll::CreatePhysics | ( | bool | bAllowAttachToWorld = true | ) |
Creates the physics.
[in] | bAllowAttachToWorld | Is it allowed to attach joints to the world? |
PLPHYSICS_API void PLPhysics::SNRagdoll::CreatePhysicsBodies | ( | ) |
Creates the physics bodies.
PLPHYSICS_API void PLPhysics::SNRagdoll::CreatePhysicsJoints | ( | bool | bAllowAttachToWorld = true | ) |
Creates the physics joints.
[in] | bAllowAttachToWorld | Is it allowed to attach joints to the world? |
PLPHYSICS_API void PLPhysics::SNRagdoll::CreatePhysicsRagdoll | ( | bool | bAllowAttachToWorld = true | ) |
Creates the physics ragdoll.
[in] | bAllowAttachToWorld | Is it allowed to attach joints to the world? |
PLPHYSICS_API PLMesh::Skeleton* PLPhysics::SNRagdoll::GetSkeleton | ( | ) | const |
Returns the ragdoll skeleton.
PLPHYSICS_API bool PLPhysics::SNRagdoll::IsEnabled | ( | ) | const |
Returns whether the ragdoll is enabled or not.
PLPHYSICS_API void PLPhysics::SNRagdoll::SetEnabled | ( | bool | bEnabled = true | ) |
Enables/disables all bodies and joints.
[in] | bEnabled | 'true' if the ragdoll is enabled, else 'false' |
PLPHYSICS_API PLCore::uint32 PLPhysics::SNRagdoll::GetNumOfBodies | ( | ) | const |
Returns the number of bodies.
PLPHYSICS_API RagdollBody* PLPhysics::SNRagdoll::GetBody | ( | PLCore::uint32 | nIndex | ) | const |
Returns a body.
[in] | nIndex | Index of the requested body |
PLPHYSICS_API RagdollBody* PLPhysics::SNRagdoll::GetBody | ( | const PLCore::String & | sName | ) | const |
Returns a body.
[in] | sName | Name of the requested body |
PLPHYSICS_API RagdollBody* PLPhysics::SNRagdoll::AddBody | ( | const PLCore::String & | sName = "Joint" , |
bool | bCreatePhysics = true |
||
) |
Adds a new body.
[in] | sName | Desired name |
[in] | bCreatePhysics | Create the physics body after the body was added? |
PLPHYSICS_API RagdollBody* PLPhysics::SNRagdoll::CloneBody | ( | PLCore::uint32 | nIndex, |
bool | bCreatePhysics = true |
||
) |
Clones a body.
[in] | nIndex | Index of the body to clone |
[in] | bCreatePhysics | Create the physics body after the cloned body was added? |
PLPHYSICS_API bool PLPhysics::SNRagdoll::RemoveBody | ( | PLCore::uint32 | nIndex | ) |
Removes a body.
[in] | nIndex | Index of the body to remove |
PLPHYSICS_API bool PLPhysics::SNRagdoll::RemoveBodyAndJoint | ( | PLCore::uint32 | nIndex | ) |
Removes a body and the joint attached to it.
[in] | nIndex | Index of the body to remove |
PLPHYSICS_API PLCore::uint32 PLPhysics::SNRagdoll::GetNumOfJoints | ( | ) | const |
Returns the number of joints.
PLPHYSICS_API RagdollJoint* PLPhysics::SNRagdoll::GetJoint | ( | PLCore::uint32 | nIndex | ) | const |
Returns a joint.
[in] | nIndex | Index of the requested joint |
PLPHYSICS_API RagdollJoint* PLPhysics::SNRagdoll::GetJoint | ( | const PLCore::String & | sName | ) | const |
Returns a joint.
[in] | sName | Name of the requested joint |
PLPHYSICS_API RagdollJoint* PLPhysics::SNRagdoll::AddJoint | ( | const PLCore::String & | sName = "Joint" , |
bool | bCreatePhysics = true |
||
) |
Adds a new joint.
[in] | sName | Desired name |
[in] | bCreatePhysics | Create the physics joint after the joint was added? |
PLPHYSICS_API RagdollJoint* PLPhysics::SNRagdoll::CloneJoint | ( | PLCore::uint32 | nIndex, |
bool | bCreatePhysics = true |
||
) |
Clones a joint.
[in] | nIndex | Index of the joint to clone |
[in] | bCreatePhysics | Create the physics joint after the cloned joint was added? |
PLPHYSICS_API bool PLPhysics::SNRagdoll::RemoveJoint | ( | PLCore::uint32 | nIndex | ) |
Removes a joint.
[in] | nIndex | Index of the joint to remove |
PLPHYSICS_API PLCore::uint32 PLPhysics::SNRagdoll::GetNumOfNoCollisions | ( | ) | const |
Returns the number of no collisions.
PLPHYSICS_API NoCollision* PLPhysics::SNRagdoll::AddNoCollision | ( | ) |
Adds a new no collision.
PLPHYSICS_API NoCollision* PLPhysics::SNRagdoll::GetNoCollision | ( | PLCore::uint32 | nIndex | ) | const |
Returns a no collision.
[in] | nIndex | Index of the requested no collision |
PLPHYSICS_API bool PLPhysics::SNRagdoll::RemoveNoCollision | ( | PLCore::uint32 | nIndex | ) |
Removes a no collision.
[in] | nIndex | Index of the no collision to remove |
PLPHYSICS_API PLCore::uint32 PLPhysics::SNRagdoll::GetNumOfControllers | ( | ) | const |
Returns the number of controllers.
PLPHYSICS_API JointController* PLPhysics::SNRagdoll::AddController | ( | const PLCore::String & | sJointName | ) |
Adds a new controller.
[in] | sJointName | Name of the joint to control |
PLPHYSICS_API JointController* PLPhysics::SNRagdoll::GetController | ( | PLCore::uint32 | nIndex | ) | const |
Returns a controller.
[in] | nIndex | Index of the requested controller |
PLPHYSICS_API JointController* PLPhysics::SNRagdoll::GetController | ( | const PLCore::String & | sName | ) | const |
Returns a controller.
[in] | sName | Name of the requested controller |
PLPHYSICS_API bool PLPhysics::SNRagdoll::RemoveController | ( | PLCore::uint32 | nIndex | ) |
Removes a controller.
[in] | nIndex | Index of the controller to remove |
virtual PLPHYSICS_API void PLPhysics::SNRagdoll::DrawDebug | ( | PLRenderer::Renderer & | cRenderer, |
const PLScene::VisNode * | pVisNode = nullptr |
||
) | [override, virtual] |
This function is called when the debug parts of the scene are drawn.
[in] | cRenderer | The used renderer |
[in] | pVisNode | The current visibility node of this scene node, can be a null pointer |
Reimplemented from PLScene::SNMesh.
virtual PLPHYSICS_API void PLPhysics::SNRagdoll::InitFunction | ( | ) | [override, protected, virtual] |
This function is called when the scene node gets initialized.
Reimplemented from PLScene::SceneNode.
virtual PLPHYSICS_API void PLPhysics::SNRagdoll::DeInitFunction | ( | ) | [override, protected, virtual] |
This function is called when the scene node gets de-initialized.
Reimplemented from PLScene::SNMesh.
virtual PLPHYSICS_API void PLPhysics::SNRagdoll::OnActivate | ( | bool | bActivate | ) | [override, protected, virtual] |
Called when the scene node has been activated or deactivated.
[in] | bActivate | 'true' if the scene node is now active, else 'false' |
Reimplemented from PLScene::SceneNode.
virtual PLPHYSICS_API bool PLPhysics::SNRagdoll::Unload | ( | ) | [override, virtual] |
Unloads the loadable.
Reimplemented from PLCore::Loadable.
virtual PLPHYSICS_API PLCore::String PLPhysics::SNRagdoll::GetLoadableTypeName | ( | ) | const [override, virtual] |
virtual PLPHYSICS_API bool PLPhysics::SNRagdoll::CallLoadable | ( | PLCore::File & | cFile, |
PLCore::Loader & | cLoader, | ||
const PLCore::String & | sMethod, | ||
const PLCore::String & | sParams | ||
) | [override, protected, virtual] |
Calls the loadable in order to load or save.
[in] | cFile | File to load from, MUST be opened |
[in] | cLoader | Loader to use |
[in] | sMethod | Name of the method to use |
[in] | sParams | Method parameters |
Reimplemented from PLCore::Loadable.
|