PixelLightAPI  .
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
PLPhysics::SNMPhysicsJoint Class Reference

Abstract physics joint scene node modifier. More...

#include <SNMPhysicsJoint.h>

Inheritance diagram for PLPhysics::SNMPhysicsJoint:
Inheritance graph
[legend]

List of all members.

Public Types

enum  EFlags { LocalPinDirection = 1<<2 }
 Scene node modifier flags. More...

Public Member Functions

virtual PLPHYSICS_API void SetFlags (PLCore::uint32 nValue) override
PLPHYSICS_API SCPhysicsWorldGetWorldContainer () const
 Returns the PL physics world scene node container the physics joint is in.
PLPHYSICS_API JointGetJoint () const
 Returns the PL physics joint.
PLPHYSICS_API SNMPhysicsBodyGetOwnerBodyModifier () const
 Returns the owner PL physics body scene node modifier the joint is attached to.
PLPHYSICS_API SNMPhysicsBodyGetTargetBodyModifier () const
 Returns the target PL physics body scene node modifier the joint is attached to.

Protected Member Functions

PLPHYSICS_API SNMPhysicsJoint (PLScene::SceneNode &cSceneNode)
 Constructor.
virtual PLPHYSICS_API ~SNMPhysicsJoint ()
 Destructor.
PLPHYSICS_API void RecreatePhysicsJoint ()
 Recreates the PL physics joint.
PLPHYSICS_API void CalculateJointTransformMatrix (PLMath::Matrix3x4 &mTransform) const
 Calculates the transform matrix that transform from the local owner scene node space into the physics world scene container.
virtual void CreatePhysicsJoint ()=0
 Creates the PL physics joint.
virtual PLPHYSICS_API void InformedOnInit () override
 Informed on scene node modifier initialization.

Protected Attributes

PLCore::String m_sTarget
SCPhysicsWorldm_pWorldContainer
ElementHandlerm_pJointHandler

Detailed Description

Abstract physics joint scene node modifier.

Note:
  • There MUST already be a 'PLPhysics::SNMPhysicsBody'-modifier within the owner scene node, else the joint has no effect. Further the owner body can NOT have an infinity (zero = static, the default value) mass.
  • The scene node 'Target' MUST already exist, else the joint can not be attached to it!
  • By default joint disables collision with the linked bodies

Member Enumeration Documentation

Scene node modifier flags.

Enumerator:
LocalPinDirection 

If this flag is set, the pin direction(s) of the joint is/are defined in local scene node space instead of scene container space

Reimplemented from PLScene::SceneNodeModifier.


Constructor & Destructor Documentation

PLPHYSICS_API PLPhysics::SNMPhysicsJoint::SNMPhysicsJoint ( PLScene::SceneNode cSceneNode) [protected]

Constructor.

Parameters:
[in]cSceneNodeOwner scene node
virtual PLPHYSICS_API PLPhysics::SNMPhysicsJoint::~SNMPhysicsJoint ( ) [protected, virtual]

Destructor.


Member Function Documentation

virtual PLPHYSICS_API void PLPhysics::SNMPhysicsJoint::SetFlags ( PLCore::uint32  nValue) [override, virtual]

Reimplemented from PLScene::SceneNodeModifier.

Returns the PL physics world scene node container the physics joint is in.

Returns:
The PL physics world scene node container the physics joint is in, a null pointer on error (if that's the case, something went totally wrong :)
Note:
  • This PL physics world scene node container can be another as the scene node container this scene node is in
PLPHYSICS_API Joint* PLPhysics::SNMPhysicsJoint::GetJoint ( ) const

Returns the PL physics joint.

Returns:
The PL physics joint, a null pointer on error (if that's the case, something went totally wrong :)

Returns the owner PL physics body scene node modifier the joint is attached to.

Returns:
The owner PL physics body scene node modifier, a null pointer if there's no such body
Note:
  • The implementation is searching for the first "PLPhysics::SNMPhysicsBody" within the owner scene node of this scene node modifier, this is the "owner" physics body

Returns the target PL physics body scene node modifier the joint is attached to.

Returns:
The target PL physics body scene node modifier, a null pointer if there's no such body
PLPHYSICS_API void PLPhysics::SNMPhysicsJoint::RecreatePhysicsJoint ( ) [protected]

Recreates the PL physics joint.

PLPHYSICS_API void PLPhysics::SNMPhysicsJoint::CalculateJointTransformMatrix ( PLMath::Matrix3x4 mTransform) const [protected]

Calculates the transform matrix that transform from the local owner scene node space into the physics world scene container.

Parameters:
[out]mTransformReceives the result
virtual void PLPhysics::SNMPhysicsJoint::CreatePhysicsJoint ( ) [protected, pure virtual]

Creates the PL physics joint.

virtual PLPHYSICS_API void PLPhysics::SNMPhysicsJoint::InformedOnInit ( ) [override, protected, virtual]

Informed on scene node modifier initialization.

Note:
  • The default implementation is empty

Reimplemented from PLScene::SceneNodeModifier.


Member Data Documentation

Name of the target scene node (which must have a 'PLPhysics::SNMPhysicsBody' modifier!), can left undefined

The PL physics world scene node container the physics joint is in, can be a null pointer

Holds the PL physics joint (ALWAYS valid!)


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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:22
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported