Space Engineers
Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
Sandbox.Engine.Voxels.MyVoxelPhysicsBody Class Reference
Inheritance diagram for Sandbox.Engine.Voxels.MyVoxelPhysicsBody:
Sandbox.Engine.Physics.MyPhysicsBody VRage.Game.Components.MyPhysicsComponentBase VRageMath.Spatial.MyClusterTree.IMyActivationHandler VRage.Game.Components.MyEntityComponentBase VRage.Game.Components.MyComponentBase

Public Member Functions

HkRigidBody GetRigidBody (int lod)
 Get the per lod rigid bodies, will assert if LOD1 is not available but is requested. More...
 
HkUniformGridShape GetShape (int lod)
 
override void DebugDraw ()
 Debug draw of this physics object. More...
 
override void Activate (object world, ulong clusterObjectID)
 Called when standalone object is added to cluster More...
 
override void ActivateBatch (object world, ulong clusterObjectID)
 Called when multiple objects are added to cluster. More...
 
override void Deactivate (object world)
 Called when standalone object is removed from cluster More...
 
override void DeactivateBatch (object world)
 Called when multiple objects are removed from cluster. More...
 
override void Close ()
 Initializes a new instance of the MyPhysicsBody class. More...
 
override MyStringHash GetMaterialAt (Vector3D worldPos)
 
void PrefetchShapeOnRay (ref LineD ray)
 
- Public Member Functions inherited from Sandbox.Engine.Physics.MyPhysicsBody
delegate void PhysicsContactHandler (ref MyPhysics.MyContactPointEvent e)
 
 MyPhysicsBody ()
 
 MyPhysicsBody (IMyEntity entity, RigidBodyFlag flags)
 Initializes a new instance of the MyPhysicsBody class. More...
 
override void AddForce (MyPhysicsForceType type, Vector3?force, Vector3D?position, Vector3?torque)
 Applies external force to the physics object. More...
 
override void ApplyImpulse (Vector3 impulse, Vector3D pos)
 Applies the impulse. More...
 
override void ClearSpeed ()
 Clears the speeds. More...
 
override void Clear ()
 Clear all dynamic values of physics object. More...
 
virtual void CreateFromCollisionObject (HkShape shape, Vector3 center, MatrixD worldTransform, HkMassProperties?massProperties=null, int collisionFilter=MyPhysics.CollisionLayers.DefaultCollisionLayer)
 
void PlayContactSound (HkContactPointEvent value, float volume=0)
 
override void CreateCharacterCollision (Vector3 center, float characterWidth, float characterHeight, float crouchHeight, float ladderHeight, float headSize, float headHeight, MatrixD worldTransform, float mass, ushort collisionLayer, bool isOnlyVertical, float maxSlope, float maxImpulse, float maxSpeedRelativeToShip, bool networkProxy, float?maxForce=null)
 
override void Deactivate ()
 Deactivates this rigid body in physics. More...
 
void FinishAddBatch ()
 Called when adding multiple objects is finished. More...
 
void FinishRemoveBatch (object userData)
 Called when removing multiple objects is finished. More...
 
override void ForceActivate ()
 
virtual void OnMotion (HkRigidBody rbo, float step, bool fromParent=false)
 Called when [motion]. More...
 
void SynchronizeKeyframedRigidBody ()
 
override MatrixD GetWorldMatrix ()
 
override Vector3 GetVelocityAtPoint (Vector3D worldPos)
 
override void OnWorldPositionChanged (object source)
 Called when [world position changed]. More...
 
virtual void ChangeQualityType (HkCollidableQualityType quality)
 
void AddConstraint (HkConstraint constraint)
 
void RemoveConstraint (HkConstraint constraint)
 
override Vector3D WorldToCluster (Vector3D worldPos)
 Converts global space position to local cluster space. More...
 
override Vector3D ClusterToWorld (Vector3 clusterPos)
 Converts local cluster position to global space. More...
 
override void Activate ()
 Activates this rigid body in physics. More...
 
void UpdateCluster ()
 
virtual HkShape GetShape ()
 Gets shape of this physics body even if its welded with other More...
 
override void Init (MyComponentDefinitionBase definition)
 
override void OnAddedToContainer ()
 Gets called after the container of this component changes More...
 
override void OnAddedToScene ()
 CH: TOOD: Be careful! This does not get called if the component is added to a container that is in the scene already! More...
 
override void UpdateFromSystem ()
 
virtual void FracturedBody_AfterReplaceBody (ref HkdReplaceBodyEvent e)
 
void CloseRagdoll ()
 
void SwitchToRagdollMode (bool deadMode=true, int firstRagdollSubID=1)
 
void CloseRagdollMode ()
 
void CloseRagdollMode (HkWorld world)
 
void SetRagdollDefaults ()
 Sets default values for ragdoll bodies and constraints - useful if ragdoll model is not correct More...
 
void Weld (MyPhysicsComponentBase other, bool recreateShape=true)
 
void Weld (MyPhysicsBody other, bool recreateShape=true)
 
void RecreateWeldedShape ()
 
void UpdateMassProps ()
 
void UnweldAll (bool insertInWorld)
 
void Unweld (MyPhysicsBody other, bool insertToWorld=true, bool recreateShape=true)
 
void Unweld (bool insertInWorld=true)
 
- Public Member Functions inherited from VRage.Game.Components.MyPhysicsComponentBase
void UpdateAccelerations ()
 
void SetSpeeds (Vector3 linear, Vector3 angular)
 Set the current linear and angular velocities of this physics body. More...
 
override void Init (MyComponentDefinitionBase definition)
 
override void OnAddedToContainer ()
 Gets called after the container of this component changes More...
 
override void OnBeforeRemovedFromContainer ()
 Gets called before the removal of this component from a container More...
 
override bool IsSerialized ()
 Tells the component container serializer whether this component should be saved More...
 
override MyObjectBuilder_ComponentBase Serialize (bool copy=false)
 
override void Deserialize (MyObjectBuilder_ComponentBase baseBuilder)
 
- Public Member Functions inherited from VRage.Game.Components.MyComponentBase
virtual void SetContainer (MyComponentContainer container)
 Sets the container of this component. Note that the component is not added to the container here! Therefore, use MyComponentContainer.Add(...) method and it will in turn call this method. Actually, you should seldom have the need to call this method yourself. More...
 
virtual T GetAs< T > ()
 
virtual void OnRemovedFromScene ()
 CH: TOOD: Be careful! This does not get called if the component is removed from a container that is still in the scene! More...
 

Public Attributes

readonly MyVoxelBase m_voxelMap
 
- Public Attributes inherited from Sandbox.Engine.Physics.MyPhysicsBody
HkSolverDeactivation InitialSolverDeactivation = HkSolverDeactivation.Low
 Must be set before creating rigid body More...
 
readonly MyWeldInfo WeldInfo = new MyWeldInfo()
 
- Public Attributes inherited from VRage.Game.Components.MyPhysicsComponentBase
ushort ContactPointDelay = 0xffff
 Must be set before creating rigid body More...
 
RigidBodyFlag Flags
 
bool IsPhantom
 Use something from Havok to detect this More...
 

Static Public Attributes

static bool UseLod1VoxelPhysics = false
 

Properties

override bool IsStatic [get]
 
bool QueueInvalidate [get, set]
 
override bool IsStaticForCluster [get, set]
 
- Properties inherited from Sandbox.Engine.Physics.MyPhysicsBody
ulong ClusterObjectID [get, set]
 
new MyPhysicsBodyComponentDefinition Definition [get]
 
HkWorld HavokWorld [get]
 
virtual int HavokCollisionSystemID [get, protected set]
 
override HkRigidBody RigidBody [get, protected set]
 
override HkRigidBody RigidBody2 [get, protected set]
 
override float Mass [get]
 Gets or sets the mass. More...
 
override float Speed [get]
 Gets or sets the speed. More...
 
override float Friction [get, set]
 
override bool IsStatic [get]
 
override bool IsKinematic [get]
 
bool IsSubpart [get, set]
 
MyCharacterProxy CharacterProxy [get, set]
 
int CharacterSystemGroupCollisionFilterID [get]
 This system group id will is used to set's this character rigid bodies collision filters. More...
 
uint CharacterCollisionFilter [get]
 This is character collision filter, use this to avoid collisions with character and character holding bodies. More...
 
override bool IsInWorld [get, protected set]
 
override Vector3 LinearVelocity [get, set]
 Gets or sets the linear velocity. More...
 
override float LinearDamping [get, set]
 Gets or sets the linear damping. More...
 
override float AngularDamping [get, set]
 Gets or sets the angular damping. More...
 
override Vector3 AngularVelocity [get, set]
 Gets or sets the angular velocity. More...
 
override bool IsMoving [get]
 Returns true when linear velocity or angular velocity is non-zero. More...
 
override Vector3 Gravity [get]
 
override bool HasRigidBody [get]
 
override Vector3D CenterOfMassWorld [get]
 
HashSetReader< HkConstraint > Constraints [get]
 
virtual bool IsStaticForCluster [get, set]
 
override HkdBreakableBody BreakableBody [get, set]
 
int RagdollSystemGroupCollisionFilterID [get]
 This System Collision ID is used for ragdoll in non-dead mode to avoid collision with character's rigid body. More...
 
bool IsRagdollModeActive [get]
 Returns true when ragdoll is in world More...
 
HkRagdoll Ragdoll [get, set]
 
bool ReactivateRagdoll [get, set]
 
bool SwitchToRagdollModeOnActivate [get, set]
 
bool IsWelded [get]
 
HkRigidBody WeldedRigidBody [get, protected set]
 
- Properties inherited from VRage.Game.Components.MyPhysicsComponentBase
bool ReportAllContacts [get, set]
 
IMyEntity Entity [get, protected set]
 
bool CanUpdateAccelerations [get, set]
 
MyStringHash MaterialType [get, set]
 Gets or sets the type of the material. More...
 
virtual bool IsStatic [get]
 Gets or sets a value indicating whether this MyGameRigidBody is static. More...
 
virtual bool IsKinematic [get]
 Gets or sets a value indicating whether this MyGameRigidBody is kinematic. More...
 
virtual bool Enabled [get, set]
 Gets or sets a value indicating whether this MyPhysicsBody is enabled. More...
 
bool PlayCollisionCueEnabled [get, set]
 Gets or sets a value indicating whether [play collision cue enabled]. More...
 
abstract float Mass [get]
 Gets or sets the type of the material. More...
 
Vector3 Center [get, set]
 
abstract Vector3 LinearVelocity [get, set]
 Gets or sets the linear velocity. More...
 
virtual Vector3 LinearAcceleration [get, protected set]
 
virtual Vector3 AngularAcceleration [get, protected set]
 
abstract float LinearDamping [get, set]
 Gets or sets the linear damping. More...
 
abstract float AngularDamping [get, set]
 Gets or sets the angular damping. More...
 
abstract Vector3 AngularVelocity [get, set]
 Gets or sets the angular velocity. More...
 
abstract float Speed [get]
 Gets or sets the speed. More...
 
abstract float Friction [get, set]
 
abstract HkRigidBody RigidBody [get, protected set]
 Obtain/set (default) rigid body of this physics object. More...
 
abstract HkRigidBody RigidBody2 [get, protected set]
 Obtain/set secondary rigid body of this physics object (not used by default, it is used sometimes on grids for kinematic layer). More...
 
abstract HkdBreakableBody BreakableBody [get, set]
 
abstract bool IsMoving [get]
 
abstract Vector3 Gravity [get]
 
MyPhysicsComponentDefinitionBase Definition [get]
 
MatrixD ServerWorldMatrix [get, set]
 
abstract bool HasRigidBody [get]
 
abstract Vector3D CenterOfMassWorld [get]
 
virtual bool IsInWorld [get, protected set]
 
override string ComponentTypeDebugString [get]
 
- Properties inherited from VRage.Game.Components.MyEntityComponentBase
MyEntityComponentContainer Container [get]
 
IMyEntity Entity [get]
 
abstract string ComponentTypeDebugString [get]
 Name of the base component type for debug purposes (e.g.: "Position") More...
 
- Properties inherited from VRage.Game.Components.MyComponentBase
MyComponentContainer ContainerBase [get]
 This cannot be named Container to not conflict with the definition of Container in MyEntityComponentBase. More...
 
- Properties inherited from VRageMath.Spatial.MyClusterTree.IMyActivationHandler
bool IsStaticForCluster [get]
 If true, than this object is not calculated into cluster division algorithm. It is just added or removed if dynamic object is in range. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Sandbox.Engine.Physics.MyPhysicsBody
static bool IsConstraintValid (HkConstraint constraint)
 
- Protected Member Functions inherited from Sandbox.Engine.Physics.MyPhysicsBody
override void CloseRigidBody ()
 
virtual void CreateBody (ref HkShape shape, HkMassProperties?massProperties)
 
virtual void ActivateCollision ()
 
void GetRigidBodyMatrix (out Matrix m)
 
Matrix GetRigidBodyMatrix (MatrixD worldMatrix)
 
virtual void OnWelded (MyPhysicsBody other)
 
virtual void OnUnwelded (MyPhysicsBody other)
 
- Static Protected Member Functions inherited from Sandbox.Engine.Physics.MyPhysicsBody
static void GetInfoFromFlags (HkRigidBodyCinfo rbInfo, RigidBodyFlag flags)
 
- Protected Attributes inherited from Sandbox.Engine.Physics.MyPhysicsBody
float m_angularDamping
 
float m_linearDamping
 
Vector3D Offset = Vector3D.Zero
 
Matrix m_bodyMatrix
 
HkWorld m_world
 
HkRagdoll m_ragdoll
 
- Protected Attributes inherited from VRage.Game.Components.MyPhysicsComponentBase
bool m_enabled
 
- Events inherited from Sandbox.Engine.Physics.MyPhysicsBody
PhysicsContactHandler ContactPointCallback
 
- Events inherited from VRage.Game.Components.MyEntityComponentBase
static Action< MyEntityComponentBaseOnAfterAddedToContainer
 
Action< MyEntityComponentBaseBeforeRemovedFromContainer
 

Detailed Description

Definition at line 26 of file MyVoxelPhysicsBody.cs.

Member Function Documentation

override void Sandbox.Engine.Voxels.MyVoxelPhysicsBody.Activate ( object  userData,
ulong  clusterObjectID 
)
inlinevirtual

Called when standalone object is added to cluster

Parameters
userData
clusterObjectID

Reimplemented from Sandbox.Engine.Physics.MyPhysicsBody.

Definition at line 758 of file MyVoxelPhysicsBody.cs.

override void Sandbox.Engine.Voxels.MyVoxelPhysicsBody.ActivateBatch ( object  userData,
ulong  clusterObjectID 
)
inlinevirtual

Called when multiple objects are added to cluster.

Parameters
userData
clusterObjectID

Reimplemented from Sandbox.Engine.Physics.MyPhysicsBody.

Definition at line 764 of file MyVoxelPhysicsBody.cs.

override void Sandbox.Engine.Voxels.MyVoxelPhysicsBody.Close ( )
inlinevirtual

Initializes a new instance of the MyPhysicsBody class.

Parameters
entityThe entity.

Reimplemented from Sandbox.Engine.Physics.MyPhysicsBody.

Definition at line 782 of file MyVoxelPhysicsBody.cs.

override void Sandbox.Engine.Voxels.MyVoxelPhysicsBody.Deactivate ( object  userData)
inlinevirtual

Called when standalone object is removed from cluster

Parameters
userData

Reimplemented from Sandbox.Engine.Physics.MyPhysicsBody.

Definition at line 770 of file MyVoxelPhysicsBody.cs.

override void Sandbox.Engine.Voxels.MyVoxelPhysicsBody.DeactivateBatch ( object  userData)
inlinevirtual

Called when multiple objects are removed from cluster.

Parameters
userData

Reimplemented from Sandbox.Engine.Physics.MyPhysicsBody.

Definition at line 776 of file MyVoxelPhysicsBody.cs.

override void Sandbox.Engine.Voxels.MyVoxelPhysicsBody.DebugDraw ( )
inlinevirtual

Debug draw of this physics object.

Reimplemented from Sandbox.Engine.Physics.MyPhysicsBody.

Definition at line 579 of file MyVoxelPhysicsBody.cs.

override MyStringHash Sandbox.Engine.Voxels.MyVoxelPhysicsBody.GetMaterialAt ( Vector3D  worldPos)
inlinevirtual

Reimplemented from VRage.Game.Components.MyPhysicsComponentBase.

Definition at line 950 of file MyVoxelPhysicsBody.cs.

HkRigidBody Sandbox.Engine.Voxels.MyVoxelPhysicsBody.GetRigidBody ( int  lod)
inline

Get the per lod rigid bodies, will assert if LOD1 is not available but is requested.

Parameters
lod
Returns

Definition at line 120 of file MyVoxelPhysicsBody.cs.

HkUniformGridShape Sandbox.Engine.Voxels.MyVoxelPhysicsBody.GetShape ( int  lod)
inline

Definition at line 129 of file MyVoxelPhysicsBody.cs.

void Sandbox.Engine.Voxels.MyVoxelPhysicsBody.PrefetchShapeOnRay ( ref LineD  ray)
inline

Definition at line 957 of file MyVoxelPhysicsBody.cs.

Member Data Documentation

readonly MyVoxelBase Sandbox.Engine.Voxels.MyVoxelPhysicsBody.m_voxelMap

Definition at line 37 of file MyVoxelPhysicsBody.cs.

bool Sandbox.Engine.Voxels.MyVoxelPhysicsBody.UseLod1VoxelPhysics = false
static

Definition at line 1000 of file MyVoxelPhysicsBody.cs.

Property Documentation

override bool Sandbox.Engine.Voxels.MyVoxelPhysicsBody.IsStatic
get

Definition at line 99 of file MyVoxelPhysicsBody.cs.

override bool Sandbox.Engine.Voxels.MyVoxelPhysicsBody.IsStaticForCluster
getset

Definition at line 753 of file MyVoxelPhysicsBody.cs.

bool Sandbox.Engine.Voxels.MyVoxelPhysicsBody.QueueInvalidate
getset

Definition at line 102 of file MyVoxelPhysicsBody.cs.


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