PixelLightAPI  .
Public Types | Public Member Functions | Protected Member Functions
PLEngine::SNMPhysicsCharacter Class Reference

Basic PL physics character scene node modifier class. More...

#include <SNMPhysicsCharacter.h>

Inheritance diagram for PLEngine::SNMPhysicsCharacter:
Inheritance graph
[legend]

List of all members.

Public Types

enum  EFlags { YMovement = 1<<2 }
 Scene node modifier flags (PLScene::SceneNodeModifier flags extension) More...

Public Member Functions

PL_API bool IsRunning () const
 Gets the running mode.
PL_API void SetRunning (bool bRun=false)
 Sets the running mode.
PL_API bool IsCreeping () const
 Gets the creeping mode.
PL_API void SetCreeping (bool bCreep=false)
 Sets the creeping mode.
PL_API const PLMath::Vector3GetMovement () const
 Gets the movement vector.
PL_API void SetMovement (const PLMath::Vector3 &vMovement)
 Sets the movement vector.
PL_API bool Jump ()
 Performs a jump.

Protected Member Functions

PL_API PLPhysics::BodyGetPhysicsBody () const
 Returns the PL physics body of the scene node.
virtual PL_API void OnActivate (bool bActivate) override
 Called when the scene node modifier has been activated or deactivated.

Detailed Description

Basic PL physics character scene node modifier class.

Remarks:
This class will access the PLPhysics::SNMPhysicsBody scene node modifier and take over control of the physics body. So, this modifier makes only sense if there's a PLPhysics::SNMPhysicsBody, too.
Note:
  • Primary intended for rapid prototyping

Member Enumeration Documentation

Scene node modifier flags (PLScene::SceneNodeModifier flags extension)

Enumerator:
YMovement 

Perform movement also on the y axis, else movement is just performed on the x/z plane

Reimplemented from PLScene::SceneNodeModifier.

Reimplemented in PLEngine::SNMPhysicsCharacterController.


Member Function Documentation

Gets the running mode.

Returns:
'true' if the character runs, else 'false'
PL_API void PLEngine::SNMPhysicsCharacter::SetRunning ( bool  bRun = false)

Sets the running mode.

Parameters:
[in]bRunDid the character run?

Gets the creeping mode.

Returns:
'true' if the character creeps, else 'false'
PL_API void PLEngine::SNMPhysicsCharacter::SetCreeping ( bool  bCreep = false)

Sets the creeping mode.

Parameters:
[in]bCreepDid the character creep?

Gets the movement vector.

Returns:
The movement vector
Note:
  • The movement vector should be normalized
PL_API void PLEngine::SNMPhysicsCharacter::SetMovement ( const PLMath::Vector3 vMovement)

Sets the movement vector.

Parameters:
[in]vMovementThe new movement vector, if the length is >1, the vector is used in a normalized form inside OnUpdate()
See also:

Performs a jump.

Returns:
'true' if all went fine an the jump is performed, else 'false' (maybe the character does not stand on the ground)

Returns the PL physics body of the scene node.

Returns:
The PL physics body of the scene node, a null pointer if there's no such body
virtual PL_API void PLEngine::SNMPhysicsCharacter::OnActivate ( bool  bActivate) [override, protected, virtual]

Called when the scene node modifier has been activated or deactivated.

Parameters:
[in]bActivate'true' if the scene node modifier is now active, else 'false'
Note:
  • The scene node "Inactive"-flag as well as the "Frozen"-flag are taken into account
  • 'bActivate' will be 'true' if the scene node modifier AND the owner scene node AND it's parent scene container (recursive!) are active
  • 'bActivate' will be 'false' if the scene node modifier OR the owner scene node OR it's parent scene container (recursive!) is inactive
  • The default implementation is empty

Reimplemented from PLScene::SceneNodeModifier.

Reimplemented in PLEngine::SNMPhysicsCharacterController.


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


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:30
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported