Space Engineers
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
VRage.Game.Components.MyPhysicsComponentBase Class Referenceabstract
Inheritance diagram for VRage.Game.Components.MyPhysicsComponentBase:
VRage.Game.Components.MyEntityComponentBase VRage.Game.Components.MyComponentBase Sandbox.Engine.Physics.MyPhysicsBody Sandbox.Engine.Voxels.MyVoxelPhysicsBody Sandbox.Game.Entities.Cube.MyGridPhysics Sandbox.Game.Entities.Cube.MyGridPhysics Sandbox.Game.Entities.Debris.MyDebrisBase.MyDebrisPhysics Sandbox.Game.Entities.MyHandToolBase.MyBlockingBody Sandbox.Game.Entities.MyManipulationTool.MyCharacterVirtualPhysicsBody

Public Member Functions

virtual MyStringHash GetMaterialAt (Vector3D worldPos)
 
abstract Vector3 GetVelocityAtPoint (Vector3D worldPos)
 
virtual void Close ()
 Initializes a new instance of the MyPhysicsBody class. More...
 
abstract void AddForce (MyPhysicsForceType type, Vector3?force, Vector3D?position, Vector3?torque)
 Applies external force to the physics object. More...
 
abstract void ApplyImpulse (Vector3 dir, Vector3D pos)
 Applies the impulse. More...
 
abstract void ClearSpeed ()
 Clears the speeds. More...
 
abstract void Clear ()
 Clear all dynamic values of physics object. More...
 
abstract 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 maxLimit, float maxSpeedRelativeToShip, bool networkProxy, float?maxForce)
 
abstract void DebugDraw ()
 Debug draw of this physics object. More...
 
abstract void Activate ()
 Activates this rigid body in physics. More...
 
abstract void Deactivate ()
 Deactivates this rigid body in physics. More...
 
abstract void ForceActivate ()
 
void UpdateAccelerations ()
 
void SetSpeeds (Vector3 linear, Vector3 angular)
 Set the current linear and angular velocities of this physics body. More...
 
abstract Vector3D WorldToCluster (Vector3D worldPos)
 Converts global space position to local cluster space. More...
 
abstract Vector3D ClusterToWorld (Vector3 clusterPos)
 Converts local cluster position to global space. More...
 
abstract MatrixD GetWorldMatrix ()
 
abstract void UpdateFromSystem ()
 
abstract void OnWorldPositionChanged (object source)
 Called when [world position changed]. 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 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...
 
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

ushort ContactPointDelay = 0xffff
 Must be set before creating rigid body More...
 
RigidBodyFlag Flags
 
bool IsPhantom
 Use something from Havok to detect this More...
 

Protected Member Functions

abstract void CloseRigidBody ()
 

Protected Attributes

bool m_enabled
 

Properties

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...
 

Additional Inherited Members

- Events inherited from VRage.Game.Components.MyEntityComponentBase
static Action< MyEntityComponentBaseOnAfterAddedToContainer
 
Action< MyEntityComponentBaseBeforeRemovedFromContainer
 

Detailed Description

Definition at line 53 of file MyPhysicsComponentBase.cs.

Member Function Documentation

abstract void VRage.Game.Components.MyPhysicsComponentBase.Activate ( )
pure virtual

Activates this rigid body in physics.

Implemented in Sandbox.Engine.Physics.MyPhysicsBody.

abstract void VRage.Game.Components.MyPhysicsComponentBase.AddForce ( MyPhysicsForceType  type,
Vector3 force,
Vector3D position,
Vector3 torque 
)
pure virtual

Applies external force to the physics object.

Parameters
typeThe type.
forceThe force.
positionThe position.
torqueThe torque.

Implemented in Sandbox.Engine.Physics.MyPhysicsBody.

abstract void VRage.Game.Components.MyPhysicsComponentBase.ApplyImpulse ( Vector3  dir,
Vector3D  pos 
)
pure virtual

Applies the impulse.

Parameters
dirThe dir.
posThe pos.

Implemented in Sandbox.Engine.Physics.MyPhysicsBody.

abstract void VRage.Game.Components.MyPhysicsComponentBase.Clear ( )
pure virtual

Clear all dynamic values of physics object.

Implemented in Sandbox.Engine.Physics.MyPhysicsBody.

abstract void VRage.Game.Components.MyPhysicsComponentBase.ClearSpeed ( )
pure virtual

Clears the speeds.

Implemented in Sandbox.Engine.Physics.MyPhysicsBody.

virtual void VRage.Game.Components.MyPhysicsComponentBase.Close ( )
inlinevirtual

Initializes a new instance of the MyPhysicsBody class.

Parameters
entityThe entity.

Reimplemented in Sandbox.Engine.Voxels.MyVoxelPhysicsBody, Sandbox.Engine.Physics.MyPhysicsBody, and Sandbox.Game.Entities.Cube.MyGridPhysics.

Definition at line 323 of file MyPhysicsComponentBase.cs.

abstract void VRage.Game.Components.MyPhysicsComponentBase.CloseRigidBody ( )
protectedpure virtual
abstract Vector3D VRage.Game.Components.MyPhysicsComponentBase.ClusterToWorld ( Vector3  clusterPos)
pure virtual

Converts local cluster position to global space.

Implemented in Sandbox.Engine.Physics.MyPhysicsBody.

abstract void VRage.Game.Components.MyPhysicsComponentBase.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  maxLimit,
float  maxSpeedRelativeToShip,
bool  networkProxy,
float?  maxForce 
)
pure virtual
abstract void VRage.Game.Components.MyPhysicsComponentBase.Deactivate ( )
pure virtual

Deactivates this rigid body in physics.

Implemented in Sandbox.Engine.Physics.MyPhysicsBody.

abstract void VRage.Game.Components.MyPhysicsComponentBase.DebugDraw ( )
pure virtual
override void VRage.Game.Components.MyPhysicsComponentBase.Deserialize ( MyObjectBuilder_ComponentBase  baseBuilder)
inlinevirtual

Reimplemented from VRage.Game.Components.MyComponentBase.

Definition at line 511 of file MyPhysicsComponentBase.cs.

abstract void VRage.Game.Components.MyPhysicsComponentBase.ForceActivate ( )
pure virtual
virtual MyStringHash VRage.Game.Components.MyPhysicsComponentBase.GetMaterialAt ( Vector3D  worldPos)
inlinevirtual
abstract Vector3 VRage.Game.Components.MyPhysicsComponentBase.GetVelocityAtPoint ( Vector3D  worldPos)
pure virtual
abstract MatrixD VRage.Game.Components.MyPhysicsComponentBase.GetWorldMatrix ( )
pure virtual
override void VRage.Game.Components.MyPhysicsComponentBase.Init ( MyComponentDefinitionBase  definition)
inlinevirtual

Reimplemented from VRage.Game.Components.MyComponentBase.

Definition at line 457 of file MyPhysicsComponentBase.cs.

override bool VRage.Game.Components.MyPhysicsComponentBase.IsSerialized ( )
inlinevirtual

Tells the component container serializer whether this component should be saved

Returns

Reimplemented from VRage.Game.Components.MyComponentBase.

Definition at line 498 of file MyPhysicsComponentBase.cs.

override void VRage.Game.Components.MyPhysicsComponentBase.OnAddedToContainer ( )
inlinevirtual

Gets called after the container of this component changes

Reimplemented from VRage.Game.Components.MyEntityComponentBase.

Definition at line 475 of file MyPhysicsComponentBase.cs.

override void VRage.Game.Components.MyPhysicsComponentBase.OnBeforeRemovedFromContainer ( )
inlinevirtual

Gets called before the removal of this component from a container

Reimplemented from VRage.Game.Components.MyEntityComponentBase.

Definition at line 490 of file MyPhysicsComponentBase.cs.

abstract void VRage.Game.Components.MyPhysicsComponentBase.OnWorldPositionChanged ( object  source)
pure virtual

Called when [world position changed].

Parameters
sourceThe source object that caused this event.

Implemented in Sandbox.Engine.Physics.MyPhysicsBody, Sandbox.Game.Entities.MyManipulationTool.MyCharacterVirtualPhysicsBody, and Sandbox.Game.Entities.MyHandToolBase.MyBlockingBody.

override MyObjectBuilder_ComponentBase VRage.Game.Components.MyPhysicsComponentBase.Serialize ( bool  copy = false)
inlinevirtual

Reimplemented from VRage.Game.Components.MyComponentBase.

Definition at line 503 of file MyPhysicsComponentBase.cs.

void VRage.Game.Components.MyPhysicsComponentBase.SetSpeeds ( Vector3  linear,
Vector3  angular 
)
inline

Set the current linear and angular velocities of this physics body.

Definition at line 391 of file MyPhysicsComponentBase.cs.

void VRage.Game.Components.MyPhysicsComponentBase.UpdateAccelerations ( )
inline

Definition at line 379 of file MyPhysicsComponentBase.cs.

abstract void VRage.Game.Components.MyPhysicsComponentBase.UpdateFromSystem ( )
pure virtual
abstract Vector3D VRage.Game.Components.MyPhysicsComponentBase.WorldToCluster ( Vector3D  worldPos)
pure virtual

Converts global space position to local cluster space.

Implemented in Sandbox.Engine.Physics.MyPhysicsBody.

Member Data Documentation

ushort VRage.Game.Components.MyPhysicsComponentBase.ContactPointDelay = 0xffff

Must be set before creating rigid body

Definition at line 64 of file MyPhysicsComponentBase.cs.

RigidBodyFlag VRage.Game.Components.MyPhysicsComponentBase.Flags

Definition at line 302 of file MyPhysicsComponentBase.cs.

bool VRage.Game.Components.MyPhysicsComponentBase.IsPhantom

Use something from Havok to detect this

Definition at line 307 of file MyPhysicsComponentBase.cs.

bool VRage.Game.Components.MyPhysicsComponentBase.m_enabled
protected

Definition at line 308 of file MyPhysicsComponentBase.cs.

Property Documentation

virtual Vector3 VRage.Game.Components.MyPhysicsComponentBase.AngularAcceleration
getprotected set

Definition at line 190 of file MyPhysicsComponentBase.cs.

abstract float VRage.Game.Components.MyPhysicsComponentBase.AngularDamping
getset

Gets or sets the angular damping.

The angular damping.

Definition at line 257 of file MyPhysicsComponentBase.cs.

abstract Vector3 VRage.Game.Components.MyPhysicsComponentBase.AngularVelocity
getset

Gets or sets the angular velocity.

The angular velocity.

Definition at line 265 of file MyPhysicsComponentBase.cs.

abstract HkdBreakableBody VRage.Game.Components.MyPhysicsComponentBase.BreakableBody
getset

Definition at line 288 of file MyPhysicsComponentBase.cs.

bool VRage.Game.Components.MyPhysicsComponentBase.CanUpdateAccelerations
getset

Definition at line 78 of file MyPhysicsComponentBase.cs.

Vector3 VRage.Game.Components.MyPhysicsComponentBase.Center
getset

Definition at line 173 of file MyPhysicsComponentBase.cs.

abstract Vector3D VRage.Game.Components.MyPhysicsComponentBase.CenterOfMassWorld
get

Definition at line 430 of file MyPhysicsComponentBase.cs.

override string VRage.Game.Components.MyPhysicsComponentBase.ComponentTypeDebugString
get

Definition at line 453 of file MyPhysicsComponentBase.cs.

MyPhysicsComponentDefinitionBase VRage.Game.Components.MyPhysicsComponentBase.Definition
get

Definition at line 294 of file MyPhysicsComponentBase.cs.

virtual bool VRage.Game.Components.MyPhysicsComponentBase.Enabled
getset

Gets or sets a value indicating whether this MyPhysicsBody is enabled.

true if enabled; otherwise, false.

Definition at line 127 of file MyPhysicsComponentBase.cs.

IMyEntity VRage.Game.Components.MyPhysicsComponentBase.Entity
getprotected set

Definition at line 76 of file MyPhysicsComponentBase.cs.

abstract float VRage.Game.Components.MyPhysicsComponentBase.Friction
getset

Definition at line 276 of file MyPhysicsComponentBase.cs.

abstract Vector3 VRage.Game.Components.MyPhysicsComponentBase.Gravity
get

Definition at line 292 of file MyPhysicsComponentBase.cs.

abstract bool VRage.Game.Components.MyPhysicsComponentBase.HasRigidBody
get

Definition at line 428 of file MyPhysicsComponentBase.cs.

virtual bool VRage.Game.Components.MyPhysicsComponentBase.IsInWorld
getprotected set

Definition at line 445 of file MyPhysicsComponentBase.cs.

virtual bool VRage.Game.Components.MyPhysicsComponentBase.IsKinematic
get

Gets or sets a value indicating whether this MyGameRigidBody is kinematic.

true if kinematic; otherwise, false.

Definition at line 111 of file MyPhysicsComponentBase.cs.

abstract bool VRage.Game.Components.MyPhysicsComponentBase.IsMoving
get

Definition at line 290 of file MyPhysicsComponentBase.cs.

virtual bool VRage.Game.Components.MyPhysicsComponentBase.IsStatic
get

Gets or sets a value indicating whether this MyGameRigidBody is static.

true if static; otherwise, false.

Definition at line 96 of file MyPhysicsComponentBase.cs.

virtual Vector3 VRage.Game.Components.MyPhysicsComponentBase.LinearAcceleration
getprotected set

Definition at line 184 of file MyPhysicsComponentBase.cs.

abstract float VRage.Game.Components.MyPhysicsComponentBase.LinearDamping
getset

Gets or sets the linear damping.

The linear damping.

Definition at line 246 of file MyPhysicsComponentBase.cs.

abstract Vector3 VRage.Game.Components.MyPhysicsComponentBase.LinearVelocity
getset

Gets or sets the linear velocity.

The linear velocity.

Definition at line 181 of file MyPhysicsComponentBase.cs.

abstract float VRage.Game.Components.MyPhysicsComponentBase.Mass
get

Gets or sets the type of the material.

The type of the material.

Gets or sets the mass.

The mass.

Definition at line 171 of file MyPhysicsComponentBase.cs.

MyStringHash VRage.Game.Components.MyPhysicsComponentBase.MaterialType
getset

Gets or sets the type of the material.

The type of the material.

Definition at line 86 of file MyPhysicsComponentBase.cs.

bool VRage.Game.Components.MyPhysicsComponentBase.PlayCollisionCueEnabled
getset

Gets or sets a value indicating whether [play collision cue enabled].

true if [play collision cue enabled]; otherwise, false.

Definition at line 154 of file MyPhysicsComponentBase.cs.

bool VRage.Game.Components.MyPhysicsComponentBase.ReportAllContacts
getset

Definition at line 67 of file MyPhysicsComponentBase.cs.

abstract HkRigidBody VRage.Game.Components.MyPhysicsComponentBase.RigidBody
getprotected set

Obtain/set (default) rigid body of this physics object.

Definition at line 281 of file MyPhysicsComponentBase.cs.

abstract HkRigidBody VRage.Game.Components.MyPhysicsComponentBase.RigidBody2
getprotected set

Obtain/set secondary rigid body of this physics object (not used by default, it is used sometimes on grids for kinematic layer).

Definition at line 286 of file MyPhysicsComponentBase.cs.

MatrixD VRage.Game.Components.MyPhysicsComponentBase.ServerWorldMatrix
getset

Definition at line 296 of file MyPhysicsComponentBase.cs.

abstract float VRage.Game.Components.MyPhysicsComponentBase.Speed
get

Gets or sets the speed.

The speed.

Definition at line 273 of file MyPhysicsComponentBase.cs.


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