Space Engineers
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
Sandbox.Engine.Physics.MyRagdollMapper Class Reference

Maps Ragdoll instance to Character Bones More...

Public Member Functions

 MyRagdollMapper (MyCharacter character, MyCharacterBone[] bones)
 Constructs the new mapper More...
 
int BodyIndex (string bodyName)
 
bool Init (Dictionary< string, MyCharacterDefinition.RagdollBoneSet > ragdollBonesMappings)
 Initializes the mapper More...
 
void UpdateRagdollPose ()
 Sets the pose of the ragdoll to match the pose of the bones More...
 
void UpdateCharacterPose (float dynamicBodiesWeight=1.0f, float keyframedBodiesWeight=1.0f)
 Sets the character's bones to the ragdoll's pose More...
 
void Activate ()
 
void Deactivate ()
 
void SetRagdollToKeyframed ()
 
void SetRagdollToDynamic ()
 
List< int > GetBodiesBindedToBones (List< String > bones)
 
void ActivatePartialSimulation (List< int > dynamicRigidBodies=null)
 
void DeactivatePartialSimulation ()
 
void DebugDraw (MatrixD worldMatrix)
 
void UpdateRagdollPosition ()
 Update Ragdoll position in the Havok world to copy the Physics position More...
 
void ResetRagdollVelocities ()
 
void SetLinearVelocity (Vector3 linearVelocity, bool onKeyframedOnly=true)
 
void SetAngularVelocity (Vector3 angularVelocity, bool onKeyframedOnly=true)
 
void SetVelocities ()
 
void SetLimitedVelocities ()
 
void UpdateRagdollAfterSimulation ()
 
void SyncRigidBodiesTransforms (MatrixD worldTransform)
 
HkRigidBody GetBodyBindedToBone (MyCharacterBone myCharacterBone)
 

Static Public Member Functions

static void DrawShape (HkShape shape, MatrixD worldMatrix, Color color, float alpha, bool shaded=true)
 

Public Attributes

const float RAGDOLL_DEACTIVATION_TIME = 10f
 
Matrix[] BodiesRigTransfoms
 Rigid Body transform matrices as on load More...
 
Matrix[] BonesRigTransforms
 Bodies absolute rig transforms More...
 
Matrix[] BodiesRigTransfomsInverted
 Bodies rig tranfsforms inverted More...
 
Matrix[] BonesRigTransformsInverted
 Bones absolute rig transforms inverted More...
 
bool PositionChanged
 true if position of ragdoll changed after simulation More...
 
float DeactivationCounter = RAGDOLL_DEACTIVATION_TIME
 

Properties

bool IsKeyFramed [get]
 Indicates whether ragdoll associated with this mapper was set to keyframed or not More...
 
bool IsPartiallySimulated [get]
 True if at least some of the bones are simulated and ragdoll was added to world. Partly = some bodies set to dynamic, some keyframed More...
 
Dictionary< int, List< int > > RigidBodiesToBonesIndices [get]
 Dictionary of rigid bodies indices to the list of bones that should be bound to these bodies More...
 
bool IsActive [get]
 True if the mapper was set to be active and can be used More...
 
HkRagdoll Ragdoll [get]
 

Detailed Description

Maps Ragdoll instance to Character Bones

Definition at line 21 of file MyRagdollMapper.cs.

Constructor & Destructor Documentation

Sandbox.Engine.Physics.MyRagdollMapper.MyRagdollMapper ( MyCharacter  character,
MyCharacterBone[]  bones 
)
inline

Constructs the new mapper

Parameters
ragdollThe ragdoll model
bonesList of the mapped bones

Definition at line 172 of file MyRagdollMapper.cs.

Member Function Documentation

void Sandbox.Engine.Physics.MyRagdollMapper.Activate ( )
inline

Definition at line 545 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.ActivatePartialSimulation ( List< int >  dynamicRigidBodies = null)
inline

Definition at line 661 of file MyRagdollMapper.cs.

int Sandbox.Engine.Physics.MyRagdollMapper.BodyIndex ( string  bodyName)
inline

Definition at line 190 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.Deactivate ( )
inline

Definition at line 570 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.DeactivatePartialSimulation ( )
inline

Definition at line 736 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.DebugDraw ( MatrixD  worldMatrix)
inline

Definition at line 770 of file MyRagdollMapper.cs.

static void Sandbox.Engine.Physics.MyRagdollMapper.DrawShape ( HkShape  shape,
MatrixD  worldMatrix,
Color  color,
float  alpha,
bool  shaded = true 
)
inlinestatic

Definition at line 945 of file MyRagdollMapper.cs.

List<int> Sandbox.Engine.Physics.MyRagdollMapper.GetBodiesBindedToBones ( List< String >  bones)
inline

Definition at line 641 of file MyRagdollMapper.cs.

HkRigidBody Sandbox.Engine.Physics.MyRagdollMapper.GetBodyBindedToBone ( MyCharacterBone  myCharacterBone)
inline

Definition at line 1158 of file MyRagdollMapper.cs.

bool Sandbox.Engine.Physics.MyRagdollMapper.Init ( Dictionary< string, MyCharacterDefinition.RagdollBoneSet ragdollBonesMappings)
inline

Initializes the mapper

Parameters
ragdollBonesMappingsDictionary containing rigid body names and the corresponding character bones names list
Returns

Definition at line 208 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.ResetRagdollVelocities ( )
inline

Definition at line 926 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.SetAngularVelocity ( Vector3  angularVelocity,
bool  onKeyframedOnly = true 
)
inline

Definition at line 983 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.SetLimitedVelocities ( )
inline

Definition at line 1020 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.SetLinearVelocity ( Vector3  linearVelocity,
bool  onKeyframedOnly = true 
)
inline

Definition at line 964 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.SetRagdollToDynamic ( )
inline

Definition at line 615 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.SetRagdollToKeyframed ( )
inline

Definition at line 592 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.SetVelocities ( )
inline

Definition at line 1002 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.SyncRigidBodiesTransforms ( MatrixD  worldTransform)
inline

Definition at line 1138 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.UpdateCharacterPose ( float  dynamicBodiesWeight = 1.0f,
float  keyframedBodiesWeight = 1.0f 
)
inline

Sets the character's bones to the ragdoll's pose

Parameters
weighttransform influence weight on dynamic bodies

Definition at line 446 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.UpdateRagdollAfterSimulation ( )
inline

Definition at line 1054 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.UpdateRagdollPose ( )
inline

Sets the pose of the ragdoll to match the pose of the bones

Definition at line 347 of file MyRagdollMapper.cs.

void Sandbox.Engine.Physics.MyRagdollMapper.UpdateRagdollPosition ( )
inline

Update Ragdoll position in the Havok world to copy the Physics position

Definition at line 829 of file MyRagdollMapper.cs.

Member Data Documentation

Matrix [] Sandbox.Engine.Physics.MyRagdollMapper.BodiesRigTransfoms

Rigid Body transform matrices as on load

Definition at line 63 of file MyRagdollMapper.cs.

Matrix [] Sandbox.Engine.Physics.MyRagdollMapper.BodiesRigTransfomsInverted

Bodies rig tranfsforms inverted

Definition at line 73 of file MyRagdollMapper.cs.

Matrix [] Sandbox.Engine.Physics.MyRagdollMapper.BonesRigTransforms

Bodies absolute rig transforms

Definition at line 68 of file MyRagdollMapper.cs.

Matrix [] Sandbox.Engine.Physics.MyRagdollMapper.BonesRigTransformsInverted

Bones absolute rig transforms inverted

Definition at line 79 of file MyRagdollMapper.cs.

float Sandbox.Engine.Physics.MyRagdollMapper.DeactivationCounter = RAGDOLL_DEACTIVATION_TIME

Definition at line 135 of file MyRagdollMapper.cs.

bool Sandbox.Engine.Physics.MyRagdollMapper.PositionChanged

true if position of ragdoll changed after simulation

Definition at line 111 of file MyRagdollMapper.cs.

const float Sandbox.Engine.Physics.MyRagdollMapper.RAGDOLL_DEACTIVATION_TIME = 10f

Definition at line 23 of file MyRagdollMapper.cs.

Property Documentation

bool Sandbox.Engine.Physics.MyRagdollMapper.IsActive
get

True if the mapper was set to be active and can be used

Definition at line 153 of file MyRagdollMapper.cs.

bool Sandbox.Engine.Physics.MyRagdollMapper.IsKeyFramed
get

Indicates whether ragdoll associated with this mapper was set to keyframed or not

Definition at line 100 of file MyRagdollMapper.cs.

bool Sandbox.Engine.Physics.MyRagdollMapper.IsPartiallySimulated
get

True if at least some of the bones are simulated and ragdoll was added to world. Partly = some bodies set to dynamic, some keyframed

Definition at line 142 of file MyRagdollMapper.cs.

HkRagdoll Sandbox.Engine.Physics.MyRagdollMapper.Ragdoll
get

Definition at line 156 of file MyRagdollMapper.cs.

Dictionary<int, List<int> > Sandbox.Engine.Physics.MyRagdollMapper.RigidBodiesToBonesIndices
get

Dictionary of rigid bodies indices to the list of bones that should be bound to these bodies

Definition at line 147 of file MyRagdollMapper.cs.


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