Space Engineers
Public Member Functions | Properties | List of all members
VRage.Game.ModAPI.IMyPhysics Interface Reference
Inheritance diagram for VRage.Game.ModAPI.IMyPhysics:
Sandbox.ModAPI.Physics.MyPhysics

Public Member Functions

bool CastLongRay (Vector3D from, Vector3D to, out IHitInfo hitInfo, bool any)
 Finds closest or any object on the path of the ray from->to. Uses Storage for voxels for faster search but only good for long rays (more or less more than 50m). Use it only in such cases. More...
 
void CastRay (Vector3D from, Vector3D to, List< IHitInfo > toList, int raycastFilterLayer=0)
 Cast a ray and returns all matching entities. More...
 
bool CastRay (Vector3D from, Vector3D to, out IHitInfo hitInfo, int raycastFilterLayer=0)
 Cast a ray and return first entity. More...
 
bool CastRay (Vector3D from, Vector3D to, out IHitInfo hitInfo, uint raycastCollisionFilter, bool ignoreConvexShape)
 Cast a ray and return first entity. More...
 
void EnsurePhysicsSpace (BoundingBoxD aabb)
 Ensure aabb is inside only one subspace. If no, reorder. More...
 
int GetCollisionLayer (string strLayer)
 Given a string, gets the numeric value for the collision layer. Default: 0. More...
 

Properties

int StepsLastSecond [get]
 Number of physics steps done in last second More...
 
float SimulationRatio [get]
 Simulation ratio, when physics cannot keep up, this is smaller than 1 More...
 

Detailed Description

Definition at line 17 of file IMyPhysics.cs.

Member Function Documentation

bool VRage.Game.ModAPI.IMyPhysics.CastLongRay ( Vector3D  from,
Vector3D  to,
out IHitInfo  hitInfo,
bool  any 
)

Finds closest or any object on the path of the ray from->to. Uses Storage for voxels for faster search but only good for long rays (more or less more than 50m). Use it only in such cases.

Parameters
fromStart of the ray.
toEnd of the ray.
hitInfoHit info
anyIndicates if method should return any object found (May not be closest)
Returns
true if hit, false if no hit
void VRage.Game.ModAPI.IMyPhysics.CastRay ( Vector3D  from,
Vector3D  to,
List< IHitInfo toList,
int  raycastFilterLayer = 0 
)

Cast a ray and returns all matching entities.

Parameters
fromStart of ray.
toEnd of ray.
toListList of hits
raycastFilterLayerCollision filter.
bool VRage.Game.ModAPI.IMyPhysics.CastRay ( Vector3D  from,
Vector3D  to,
out IHitInfo  hitInfo,
int  raycastFilterLayer = 0 
)

Cast a ray and return first entity.

Parameters
fromStart of ray.
toEnd of ray.
hitInfoHit info
raycastFilterLayerCollision filter.
Returns
true if hit; false if no hit
bool VRage.Game.ModAPI.IMyPhysics.CastRay ( Vector3D  from,
Vector3D  to,
out IHitInfo  hitInfo,
uint  raycastCollisionFilter,
bool  ignoreConvexShape 
)

Cast a ray and return first entity.

Parameters
fromStart of ray.
toEnd of ray.
hitInfoHit info
raycastCollisionFilterCollision filter.
Returns
true if hit; false if no hit
void VRage.Game.ModAPI.IMyPhysics.EnsurePhysicsSpace ( BoundingBoxD  aabb)

Ensure aabb is inside only one subspace. If no, reorder.

Parameters
aabb
int VRage.Game.ModAPI.IMyPhysics.GetCollisionLayer ( string  strLayer)

Given a string, gets the numeric value for the collision layer. Default: 0.

Parameters
strLayerName of collision layer. See MyPhysics.CollisionLayers for valid names.
Returns
Numeric value from MyPhysics.CollisionLayers

Default string used if not valid: DefaultCollisionLayer

Property Documentation

float VRage.Game.ModAPI.IMyPhysics.SimulationRatio
get

Simulation ratio, when physics cannot keep up, this is smaller than 1

Definition at line 27 of file IMyPhysics.cs.

int VRage.Game.ModAPI.IMyPhysics.StepsLastSecond
get

Number of physics steps done in last second

Definition at line 22 of file IMyPhysics.cs.


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