ScriptBind_Physics

SimulateExplosion

Simulate physical explosion. Does not apply any game related explosion damages, this function only apply physical forces. The parameters are passed as a table containing the elements described below.

Physics.SimulateExplosion( explosionParams )
ParameterDescription
posExplosion epicenter position.
radiusExplosion radius.
directionExplosion impulse direction.
impulse_posExplosion impulse position (Can be different from explosion epicenter).
impulse_presureExplosion impulse presur at radius distance from epicenter.
rminExplosion minimal radius, at this radius full pressure is applied.
rmaxExplosion maximal radius, at this radius impulse pressure will be reaching zero.
hole_sizeSize of the explosion hole to create in breakable objects.

RegisterExplosionShape

Register a new explosion shape from the static geometry. Does not apply any game related explosion damages, this function only apply physical forces.

Physics.RegisterExplosionShape( sGeometryFile, fSize, nMaterialId, fProbability, sSplintersFile, fSplintersOffset, sSplintersCloudEffect )
ParameterDescription
sGeometryFileStatic geometry file name (CGF).
fSizeScale for the static geometry.
nMaterialIdID of the breakable material to apply this shape on.
fProbabilityPreference ratio of using this shape then other registered shape.
sSplintersFileadditional non-physicalized splinters cgf to place on cut surfaces.
fSplintersOffsetthe lower splinters piece wrt to the upper one.
sSplintersCloudEffectparticle effect when the splinters constraint breaks.

RegisterExplosionCrack

Register a new crack for breakable object.

Physics.RegisterExplosionCrack( sGeometryFile, int nMaterialId )
ParameterDescription
sGeometryFileStatic geometry file name fro the crack (CGF).
nMaterialIdID of the breakable material to apply this crack on.

RayWorldIntersection

Check if ray segment from src to dst intersect anything.

Physics.RayWorldIntersection( vPos, vDir, nMaxHits, iEntTypes [, skipEntityId1 [, skipEntityId2]] )
ParameterDescription
vPosRay origin point.
vDirRay direction.
nMaxHitsMax number of hits to return, sorted in nearest to farest order.
iEntTypesPhysical Entity types bitmask, ray will only intersect with entities specified by this mask (ent_all,...).
skipEntityId1(optional) Entity id to skip when checking for intersection.
skipEntityId2(optional) Entity id to skip when checking for intersection.

RayTraceCheck

Check if ray segment from src to dst intersect anything.

Physics.RayTraceCheck( src, dst, skipEntityId1, skipEntityId2 )
ParameterDescription
srcRay segment origin point.
dstRay segment end point.
skipEntityId1Entity id to skip when checking for intersection.
skipEntityId2Entity id to skip when checking for intersection.

SamplePhysEnvironment

Find physical entities touched by a sphere.

Physics.SamplePhysEnvironment( pt, r [, objtypes] )
ParameterDescription
ptcenter of sphere.
rradius of sphere.
objtypes(optional) physics entity types.