Dayz Explorer 1.29.162510
Loading...
Searching...
No Matches
Physics system

Topics

 RigidBody API

Classes

class  Contact
class  Physics
class  Physics6DOFJoint
class  Physics6DOFSpringJoint
class  PhysicsBallSocketJoint
class  PhysicsBlock
class  PhysicsConeTwistJoint
class  PhysicsFixedJoint
class  PhysicsGeom
class  PhysicsGeomDef
class  PhysicsHingeJoint
class  PhysicsJoint
class  PhysicsSliderJoint
class  PhysicsWorld
class  SurfaceProperties

Typedefs

typedef int[] Physics
typedef int[] Physics6DOFJoint
typedef int[] Physics6DOFSpringJoint
typedef int[] PhysicsBallSocketJoint
typedef int[] PhysicsBlock
typedef int[] PhysicsConeTwistJoint
typedef int[] PhysicsFixedJoint
typedef PhysicsGeom dGeom
typedef int[] PhysicsGeom
typedef int[] PhysicsHingeJoint
typedef int[] PhysicsJoint
typedef int[] PhysicsSliderJoint
typedef int[] SurfaceProperties
typedef int[] dJoint
typedef int[] dBlock

Enumerations

enum  ActiveState {
  INACTIVE , ACTIVE , ALWAYS_ACTIVE , INACTIVE ,
  ACTIVE , ALWAYS_ACTIVE
}
enum  ActiveState {
  INACTIVE , ACTIVE , ALWAYS_ACTIVE , INACTIVE ,
  ACTIVE , ALWAYS_ACTIVE
}
enum  SimulationState {
  NONE = -1 , COLLISION , SIMULATION , NONE = -1 ,
  COLLISION , SIMULATION
}
enum  SimulationState {
  NONE = -1 , COLLISION , SIMULATION , NONE = -1 ,
  COLLISION , SIMULATION
}

Functions

proto native int dGetNumDynamicBodies (notnull IEntity worldEnt)
proto native IEntity dGetDynamicBody (notnull IEntity worldEnt, int index)
proto native void dSetInteractionLayer (notnull IEntity worldEntity, int mask1, int mask2, bool enable)
proto native bool dGetInteractionLayer (notnull IEntity worldEntity, int mask1, int mask2)
proto native vector dGetGravity (notnull IEntity worldEntity)
 Gets global gravity.
proto native void dSetGravity (notnull IEntity worldEntity, vector g)
 Changes global gravity.
proto native void dSetTimeSlice (notnull IEntity worldEntity, float timeSlice)
 Changes fixed time-slice. Default is 1/40, thus simulation runs on 40fps. With smaller values, there is more precise simulation.

Detailed Description

Typedef Documentation

◆ dBlock

typedef int [] dBlock

Definition at line 7 of file enphysics.c.

◆ dGeom

typedef PhysicsGeom dGeom

Geometric shapes relevant for physics simulation

Definition at line 9 of file physicsgeom.c.

◆ dJoint

typedef int [] dJoint

Definition at line 6 of file enphysics.c.

◆ Physics

typedef int [] Physics

Wrapper over a physics simulation of an entity. The entity is capable of the physics simulation only when such object exists (see IEntity.GetPhysics). Two main types of physics bodies are static and dynamic. Static bodies are represented by a collision object and dynamic bodies by a rigid body. This means certain methods make sense only when dealing with a dynamic physics body, e.g., Physics.GetVelocity, Physics.ApplyImpulse.

Physics bodies rely on physics geometries to support collisions or casting. In general a physics body can be made out of multiply physics geometries. Certain methods allow to work with a specific physics geometry (via geometry index).

Definition at line 15 of file physics.c.

◆ Physics6DOFJoint

typedef int [] Physics6DOFJoint

6 DOF joint simulation.

The first 3 DOF axes represent linear motion (translation) and the latter 3 DOF axes represent angular motion. Each axis can be configured to be either free, locked or limited. All axes are locked initially. Some combinations can lead to an undefined behavior.

Configuration of the axes:

  • upper < lower - free axis
  • upper == lower - locked axis
  • upper > lower - limited axis

Ranges of the angular limits:

  • x axis - (-PI, PI)
  • y axis - (-PI/2, PI/2)
  • z axis - (-PI, PI)

Definition at line 23 of file physics6dofjoint.c.

◆ Physics6DOFSpringJoint

typedef int [] Physics6DOFSpringJoint

6 DOF spring joint simulation.

Definition at line 9 of file physics6dofspringjoint.c.

◆ PhysicsBallSocketJoint

typedef int [] PhysicsBallSocketJoint

Ball socket joint simulation

Definition at line 9 of file physicsballsocketjoint.c.

◆ PhysicsBlock

typedef int [] PhysicsBlock

Disables collisions between two entities.

Definition at line 9 of file physicsblock.c.

◆ PhysicsConeTwistJoint

typedef int [] PhysicsConeTwistJoint

Cone twist joint simulation

Definition at line 9 of file physicsconetwistjoint.c.

◆ PhysicsFixedJoint

typedef int [] PhysicsFixedJoint

Fixed joint simulation

Definition at line 9 of file physicsfixedjoint.c.

◆ PhysicsGeom

typedef int [] PhysicsGeom

Definition at line 10 of file physicsgeom.c.

◆ PhysicsHingeJoint

typedef int [] PhysicsHingeJoint

Hinge joint simulation

Definition at line 9 of file physicshingejoint.c.

◆ PhysicsJoint

typedef int [] PhysicsJoint

Wrapper over joint simulation

Joint parameters

  • softness
    • 0->1, recommend ~0.8->1
    • describes % of limits where movement is free
    • beyond this softness %, the limit is gradually enforced until the "hard" (1.0) limit is reached
  • biasFactor
    • 0->1?, recommend 0.3 +/-0.3 or so
    • strength with which constraint resists zeroth order (angular, not angular velocity) limit violation
  • relaxationFactor
    • 0->1, recommend to stay near 1
    • the lower the value, the less the constraint will fight velocities which violate the angular limits

Definition at line 21 of file physicsjoint.c.

◆ PhysicsSliderJoint

typedef int [] PhysicsSliderJoint

Slider joint simulation

Definition at line 9 of file physicssliderjoint.c.

◆ SurfaceProperties

typedef int [] SurfaceProperties

General surface properties

Definition at line 9 of file surfaceproperties.c.

Enumeration Type Documentation

◆ ActiveState [1/2]

Activation state of the physics controller in the physics world.

Enumerator
INACTIVE 

body is not simulated (sleeps)

ACTIVE 

body is simulated

ALWAYS_ACTIVE 

body is simulated and cannot sleep

INACTIVE 

body is not simulated (sleeps)

ACTIVE 

body is simulated

ALWAYS_ACTIVE 

body is simulated and cannot sleep

Definition at line 9 of file activestate.c.

◆ ActiveState [2/2]

Enumerator
INACTIVE 

body is not simulated (sleeps)

ACTIVE 

body is simulated

ALWAYS_ACTIVE 

body is simulated and cannot sleep

INACTIVE 

body is not simulated (sleeps)

ACTIVE 

body is simulated

ALWAYS_ACTIVE 

body is simulated and cannot sleep

Definition at line 9 of file activestate.c.

◆ SimulationState [1/2]

State/presence of the physics controller in physics world. When it's created as static, only SimulationState::NONE or SimulationState::COLLISION can be used. For dynamic ones, there is also SimulationState::SIMULATION for full dynamic simulation.

Enumerator
NONE 

body is not in simulation, nor in collision world

No automatic destroying.

Flags to pass to ParticleSource.StopParticle.

Plain Effect base.

No flags

COLLISION 

body is in collision world, but it's not simulated

SIMULATION 

dynamic bodies are colliding and are simulated

NONE 

body is not in simulation, nor in collision world

No automatic destroying.

Flags to pass to ParticleSource.StopParticle.

Plain Effect base.

No flags

COLLISION 

body is in collision world, but it's not simulated

SIMULATION 

dynamic bodies are colliding and are simulated

Definition at line 12 of file simulationstate.c.

◆ SimulationState [2/2]

Enumerator
NONE 

body is not in simulation, nor in collision world

No automatic destroying.

Flags to pass to ParticleSource.StopParticle.

Plain Effect base.

No flags

COLLISION 

body is in collision world, but it's not simulated

SIMULATION 

dynamic bodies are colliding and are simulated

NONE 

body is not in simulation, nor in collision world

No automatic destroying.

Flags to pass to ParticleSource.StopParticle.

Plain Effect base.

No flags

COLLISION 

body is in collision world, but it's not simulated

SIMULATION 

dynamic bodies are colliding and are simulated

Definition at line 12 of file simulationstate.c.

Function Documentation

◆ dGetDynamicBody()

proto native IEntity dGetDynamicBody ( notnull IEntity worldEnt,
int index )

◆ dGetGravity()

proto native vector dGetGravity ( notnull IEntity worldEntity)

Gets global gravity.

◆ dGetInteractionLayer()

proto native bool dGetInteractionLayer ( notnull IEntity worldEntity,
int mask1,
int mask2 )

◆ dGetNumDynamicBodies()

proto native int dGetNumDynamicBodies ( notnull IEntity worldEnt)

◆ dSetGravity()

proto native void dSetGravity ( notnull IEntity worldEntity,
vector g )

Changes global gravity.

◆ dSetInteractionLayer()

proto native void dSetInteractionLayer ( notnull IEntity worldEntity,
int mask1,
int mask2,
bool enable )

◆ dSetTimeSlice()

proto native void dSetTimeSlice ( notnull IEntity worldEntity,
float timeSlice )

Changes fixed time-slice. Default is 1/40, thus simulation runs on 40fps. With smaller values, there is more precise simulation.