DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
EnPhysics.c
См. документацию.
1
5
6typedef int[] dGeom;
7typedef int[] dJoint;
8typedef int[] dBlock;
9
10proto native int dGetNumDynamicBodies(notnull IEntity worldEnt);
11proto native IEntity dGetDynamicBody(notnull IEntity worldEnt, int index);
12proto native void dSetInteractionLayer(notnull IEntity worldEntity, int mask1, int mask2, bool enable);
13proto native bool dGetInteractionLayer(notnull IEntity worldEntity, int mask1, int mask2);
14
16proto native vector dGetGravity(notnull IEntity worldEntity);
18proto native void dSetGravity(notnull IEntity worldEntity, vector g);
20proto native void dSetTimeSlice(notnull IEntity worldEntity, float timeSlice);
21
26
27//proto native int dMaterialClone(string target, string source, int material_index)
28//proto native int dMaterialGetType(string source)
29//proto native int dMaterialSetType(string source, int material_index)
30
32{
33 string Name;
35 vector Frame[4] = {Vector(1, 0, 0), Vector(0, 1, 0), Vector(0, 0, 1), Vector(0, 0, 0)};
36 int ParentNode = -1;
38 int LayerMask; //<Bit mask of layers we are in
39
40
41 void PhysicsGeomDef(string name, dGeom geom, string materialName, int layerMask)
42 {
43 Name = name;
44 Geometry = geom;
45 MaterialName = materialName;
46 LayerMask = layerMask;
47 }
48};
49
58proto bool dBodyCreateStaticEx(notnull IEntity ent, PhysicsGeomDef geoms[]);
59proto bool dBodyCreateGhostEx(notnull IEntity ent, PhysicsGeomDef geoms[]);
60
71proto bool dBodyCreateDynamicEx(notnull IEntity ent, vector centerOfMass, float mass, PhysicsGeomDef geoms[]);
72
74proto native void dBodyDestroy(notnull IEntity ent);
75
77proto native bool dBodyIsSet(notnull IEntity ent);
78
79proto native void dBodySetInteractionLayer(notnull IEntity ent, int mask);
80proto native int dBodyGetInteractionLayer(notnull IEntity ent);
81proto native void dBodySetGeomInteractionLayer(notnull IEntity ent, int index, int mask);
82proto native int dBodyGetGeomInteractionLayer(notnull IEntity ent, int index);
83
91
92proto native void dBodyActive(notnull IEntity ent, ActiveState activeState);
93proto native void dBodyDynamic(notnull IEntity ent, bool dynamic);
94proto native bool dBodyIsDynamic(notnull IEntity ent);
95
96proto native bool dBodyIsActive(notnull IEntity ent);
97proto native bool dBodyEnableGravity(notnull IEntity ent, bool enable);
98proto native void dBodySetDamping(notnull IEntity ent, float linearDamping, float angularDamping);
99proto native void dBodySetSleepingTreshold(notnull IEntity body, float linearTreshold, float angularTreshold);
100
101proto native bool dBodyIsSolid(notnull IEntity ent);
102proto native void dBodySetSolid(notnull IEntity ent, bool solid);
103
111proto native void dBodyEnableCCD(notnull IEntity body, float maxMotion, float sphereCastRadius);
115proto native void dBodySetLinearFactor(notnull IEntity body, vector linearFactor);
116
118proto native vector dBodyGetCenterOfMass(notnull IEntity body);
119
132proto native vector GetVelocity(notnull IEntity ent);
133
139proto native void SetVelocity(notnull IEntity ent, vector vel);
140
144proto native dBlock dBodyCollisionBlock(notnull IEntity ent1, notnull IEntity ent2);
145proto native void dBodyRemoveBlock(notnull IEntity worldEntity, dBlock block);
146
147proto native void dBodySetInertiaTensorV(notnull IEntity body, vector v);
148proto native void dBodySetInertiaTensorM(notnull IEntity body, vector m[3]);
149
150proto native float dBodyGetMass(notnull IEntity ent);
151proto native void dBodySetMass(notnull IEntity body, float mass);
152
153proto native void dBodyApplyTorqueImpulse(notnull IEntity ent, vector torqueImpulse);
155proto native float dBodyComputeImpulseDenominator(notnull IEntity ent, vector position, vector normal);
156proto native float dBodyComputeAngularImpulseDenominator(notnull IEntity ent, vector axis);
157proto native vector dBodyGetLocalInertia(notnull IEntity ent);
158
159proto void dBodyGetInvInertiaTensorWorld(notnull IEntity body, out vector inertiaTensorWS[3]);
160
164proto void dBodyApplyImpulseAt(notnull IEntity body, vector impulse, vector pos);
165
169proto void dBodyApplyImpulse(notnull IEntity body, vector impulse);
170
174proto void dBodyApplyForce(notnull IEntity body, vector force);
175
179proto void dBodyApplyForceAt(notnull IEntity body, vector pos, vector force);
180
181proto native void dBodyApplyTorque(notnull IEntity body, vector torque);
182
187
193proto void dBodySetAngularVelocity(notnull IEntity body, vector angvel);
194
198proto native void dBodySetTargetMatrix(notnull IEntity body, vector matrix[4], float timeslice);
199
200proto native void dBodyGetWorldTransform(notnull IEntity body, out vector matrix[4]);
201proto native void dBodyGetDirectWorldTransform(notnull IEntity body, out vector matrix[4]);
202
203proto native float dBodyGetKineticEnergy(notnull IEntity body);
204
205proto native vector dBodyGetVelocityAt(notnull IEntity body, vector globalpos);
207
212
214proto native dGeom dGeomCreateBox(vector size);
215
217proto native dGeom dGeomCreateSphere(float radius);
218
220proto native dGeom dGeomCreateCapsule(float radius, vector extent);
221
223proto native dGeom dGeomCreateCylinder(float radius, vector extent);
224
226proto native void dGeomDestroy(dGeom geom);
227
228//proto native int dBodyAddGeom(notnull IEntity body, dGeom geom, vector frame[4], string material, int interactionLayer);
229// find a geometry by its name and returns its index or -1 if the geometry wasn't found
230proto native int dBodyGetGeom(notnull IEntity ent, string name);
231// returns number of geometries of the entity
232proto native int dBodyGetNumGeoms(notnull IEntity ent);
234
239
240proto native dJoint dJointCreateHinge(notnull IEntity ent1, notnull IEntity ent2, vector point1, vector axis1, vector point2, vector axis2, bool block, float breakThreshold);
241proto native dJoint dJointCreateHinge2(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold);
242proto native dJoint dJointCreateSlider(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold);
243proto native dJoint dJointCreateBallSocket(notnull IEntity ent1, notnull IEntity ent2, vector point1, vector point2, bool block, float breakThreshold);
244proto native dJoint dJointCreateFixed(notnull IEntity ent1, notnull IEntity ent2, vector point1, vector point2, bool block, float breakThreshold);
245proto native dJoint dJointCreateConeTwist(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold);
246proto native dJoint dJointCreate6DOF(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold);
247proto native dJoint dJointCreate6DOFSpring(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold);
248proto native void dJointDestroy(dJoint joint);
249
250//only hinge joint
251proto native void dJointHingeSetLimits(dJoint joint, float low, float high, float softness, float biasFactor, float relaxationFactor);
252proto native void dJointHingeSetAxis(dJoint joint, vector axis);
253proto native void dJointHingeSetMotorTargetAngle(dJoint joint, float angle, float dt, float maxImpulse);
254
255//only cone-twist joint
256proto native void dJointConeTwistSetAngularOnly(dJoint joint, bool angularOnly);
257// setLimit(), a few notes:
258// _softness:
259// 0->1, recommend ~0.8->1.
260// describes % of limits where movement is free.
261// beyond this softness %, the limit is gradually enforced until the "hard" (1.0) limit is reached.
262// _biasFactor:
263// 0->1?, recommend 0.3 +/-0.3 or so.
264// strength with which constraint resists zeroth order (angular, not angular velocity) limit violation.
265// __relaxationFactor:
266// 0->1, recommend to stay near 1.
267// the lower the value, the less the constraint will fight velocities which violate the angular limits.
268proto native void dJointConeTwistSetLimit(dJoint joint, int limitIndex, float limitValue);
269proto native void dJointConeTwistSetLimits(dJoint joint, float _swingSpan1, float _swingSpan2, float _twistSpan, float _softness, float _biasFactor, float _relaxationFactor);
270
271//only 6DOF & 6DOFSpring.
278proto native void dJoint6DOFSetLinearLimits(dJoint joint, vector linearLower, vector linearUpper);
279proto native void dJoint6DOFSetAngularLimits(dJoint joint, vector angularLower, vector angularUpper);
280proto native void dJoint6DOFSetLimit(dJoint joint, int axis, float lo, float hi);
281
282//when stiffness == -1 && damping == -1, spring is disabled
283proto native void dJoint6DOFSpringSetSpring(dJoint joint, int axis, float stiffness, float damping);
284
285//only slider joint
286proto native void dJointSliderSetLinearLimits(dJoint joint, float lowerLimit, float upperLimit);
287proto native void dJointSliderSetAngularLimits(dJoint joint, float lowerLimit, float upperLimit);
288proto native void dJointSliderSetDirLinear(dJoint joint, float softness, float restitution, float damping);
289proto native void dJointSliderSetDirAngular(dJoint joint, float softness, float restitution, float damping);
290proto native void dJointSliderSetLimLinear(dJoint joint, float softness, float restitution, float damping);
291proto native void dJointSliderSetLimAngular(dJoint joint, float softness, float restitution, float damping);
292proto native void dJointSliderSetOrthoLinear(dJoint joint, float softness, float restitution, float damping);
293proto native void dJointSliderSetOrthoAngular(dJoint joint, float softness, float restitution, float damping);
294//if force == 0, motor is off
295proto native void dJointSliderSetLinearMotor(dJoint joint, float velocity, float force);
296proto native void dJointSliderSetAngularMotor(dJoint joint, float velocity, float force);
297proto native float dJointSliderGetLinearPos(dJoint joint);
298proto native float dJointSliderGetAngularPos(dJoint joint);
300
301//-----------------------------------------------------------------
302typedef int[] dMaterial;
303
331
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
Определения EnEntity.c:165
TODO doc.
Определения EnScript.c:118
Определения EnPhysics.c:32
Определения EnConvert.c:106
proto native float GetRelativeVelocityBefore(vector vel)
float PenetrationDepth
Определения EnPhysics.c:316
void PhysicsGeomDef(string name, dGeom geom, string materialName, int layerMask)
Определения EnPhysics.c:41
proto native void dJointSliderSetDirAngular(dJoint joint, float softness, float restitution, float damping)
proto native void dJointSliderSetAngularLimits(dJoint joint, float lowerLimit, float upperLimit)
proto native void dJointSliderSetLinearMotor(dJoint joint, float velocity, float force)
string MaterialName
Определения EnPhysics.c:37
int[] dMaterial
Определения EnPhysics.c:302
proto native void dJointSliderSetLimLinear(dJoint joint, float softness, float restitution, float damping)
proto native float GetRelativeVelocityAfter(vector vel)
float Impulse
Определения EnPhysics.c:318
proto native dJoint dJointCreateBallSocket(notnull IEntity ent1, notnull IEntity ent2, vector point1, vector point2, bool block, float breakThreshold)
proto native dJoint dJointCreateSlider(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold)
void Contact()
Определения EnPhysics.c:306
int MaterialIndex1
Определения EnPhysics.c:311
proto native dJoint dJointCreate6DOF(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold)
proto native dJoint dJointCreate6DOFSpring(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold)
dMaterial Material1
Определения EnPhysics.c:309
vector RelativeVelocityBefore
Определения EnPhysics.c:324
proto native void dJointHingeSetMotorTargetAngle(dJoint joint, float angle, float dt, float maxImpulse)
proto native void dJoint6DOFSetAngularLimits(dJoint joint, vector angularLower, vector angularUpper)
int Index2
Определения EnPhysics.c:314
vector Position
Определения EnPhysics.c:323
proto native void dJointSliderSetOrthoLinear(dJoint joint, float softness, float restitution, float damping)
void ~Contact()
Определения EnPhysics.c:307
int LayerMask
Определения EnPhysics.c:38
proto native float dJointSliderGetAngularPos(dJoint joint)
proto native void dJointConeTwistSetAngularOnly(dJoint joint, bool angularOnly)
proto native void dJointSliderSetDirLinear(dJoint joint, float softness, float restitution, float damping)
vector Frame[4]
Определения EnPhysics.c:35
float RelativeNormalVelocityBefore
Определения EnPhysics.c:319
proto native float dJointSliderGetLinearPos(dJoint joint)
proto native void dJointSliderSetLimAngular(dJoint joint, float softness, float restitution, float damping)
string Name
Определения EnPhysics.c:33
vector Normal
Определения EnPhysics.c:322
float RelativeNormalVelocityAfter
Определения EnPhysics.c:320
proto native dJoint dJointCreateConeTwist(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold)
proto native dJoint dJointCreateFixed(notnull IEntity ent1, notnull IEntity ent2, vector point1, vector point2, bool block, float breakThreshold)
proto native void dJointHingeSetLimits(dJoint joint, float low, float high, float softness, float biasFactor, float relaxationFactor)
int MaterialIndex2
Определения EnPhysics.c:312
proto native void dJointConeTwistSetLimit(dJoint joint, int limitIndex, float limitValue)
proto native void dJointDestroy(dJoint joint)
proto native void dJointSliderSetOrthoAngular(dJoint joint, float softness, float restitution, float damping)
dGeom Geometry
Определения EnPhysics.c:34
proto native void dJoint6DOFSetLinearLimits(dJoint joint, vector linearLower, vector linearUpper)
int ParentNode
Определения EnPhysics.c:36
dMaterial Material2
Определения EnPhysics.c:310
proto native void dJointHingeSetAxis(dJoint joint, vector axis)
proto native void dJoint6DOFSetLimit(dJoint joint, int axis, float lo, float hi)
proto native vector GetNormalImpulse()
proto native void dJointConeTwistSetLimits(dJoint joint, float _swingSpan1, float _swingSpan2, float _twistSpan, float _softness, float _biasFactor, float _relaxationFactor)
proto native void dJoint6DOFSpringSetSpring(dJoint joint, int axis, float stiffness, float damping)
int Index1
Определения EnPhysics.c:313
proto native dJoint dJointCreateHinge(notnull IEntity ent1, notnull IEntity ent2, vector point1, vector axis1, vector point2, vector axis2, bool block, float breakThreshold)
proto native void dJointSliderSetLinearLimits(dJoint joint, float lowerLimit, float upperLimit)
proto native void dJointSliderSetAngularMotor(dJoint joint, float velocity, float force)
vector RelativeVelocityAfter
Определения EnPhysics.c:325
proto native dJoint dJointCreateHinge2(notnull IEntity ent1, notnull IEntity ent2, vector matrix1[4], vector matrix2[4], bool block, float breakThreshold)
@ ACTIVE
Определения EnEntity.c:142
proto native dGeom dGeomCreateCylinder(float radius, vector extent)
Creates cylinder geometry.
proto native dGeom dGeomCreateSphere(float radius)
Creates sphere geometry.
proto native dGeom dGeomCreateCapsule(float radius, vector extent)
Creates capsule geometry.
proto native int dBodyGetNumGeoms(notnull IEntity ent)
proto native int dBodyGetGeom(notnull IEntity ent, string name)
proto native void dGeomDestroy(dGeom geom)
Destroys geometry.
proto native dGeom dGeomCreateBox(vector size)
Creates box geometry.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
proto native void dSetInteractionLayer(notnull IEntity worldEntity, int mask1, int mask2, bool enable)
int[] dJoint
Определения EnPhysics.c:7
proto native IEntity dGetDynamicBody(notnull IEntity worldEnt, int index)
proto native int dGetNumDynamicBodies(notnull IEntity worldEnt)
int[] dGeom
Определения EnPhysics.c:6
proto native vector dGetGravity(notnull IEntity worldEntity)
Gets global gravity.
proto native bool dGetInteractionLayer(notnull IEntity worldEntity, int mask1, int mask2)
int[] dBlock
Определения EnPhysics.c:8
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,...
proto native void dSetGravity(notnull IEntity worldEntity, vector g)
Changes global gravity.
proto native bool dBodyEnableGravity(notnull IEntity ent, bool enable)
proto native vector dBodyGetVelocityAt(notnull IEntity body, vector globalpos)
proto native void dBodyEnableCCD(notnull IEntity body, float maxMotion, float sphereCastRadius)
proto native void dBodyApplyTorque(notnull IEntity body, vector torque)
proto native void dBodyApplyTorqueImpulse(notnull IEntity ent, vector torqueImpulse)
proto bool dBodyCreateGhostEx(notnull IEntity ent, PhysicsGeomDef geoms[])
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.
proto native void dBodySetSleepingTreshold(notnull IEntity body, float linearTreshold, float angularTreshold)
proto native int dBodyGetGeomInteractionLayer(notnull IEntity ent, int index)
proto native void dBodySetTargetMatrix(notnull IEntity body, vector matrix[4], float timeslice)
Sets target transformation. If timeslice == dt (simulation step delta time), it will happen in next s...
proto native void dBodyDestroy(notnull IEntity ent)
Destroys attached physics body.
proto native void dBodyActive(notnull IEntity ent, ActiveState activeState)
proto native bool dBodyIsActive(notnull IEntity ent)
proto native void dBodySetDamping(notnull IEntity ent, float linearDamping, float angularDamping)
proto void dBodyGetInvInertiaTensorWorld(notnull IEntity body, out vector inertiaTensorWS[3])
proto void dBodyApplyImpulse(notnull IEntity body, vector impulse)
Applies impuls on a rigidbody (origin)
proto native void dBodyDynamic(notnull IEntity ent, bool dynamic)
proto native void dBodySetSolid(notnull IEntity ent, bool solid)
proto native float dBodyComputeImpulseDenominator(notnull IEntity ent, vector position, vector normal)
proto bool dBodyCreateStaticEx(notnull IEntity ent, PhysicsGeomDef geoms[])
proto void dBodyApplyImpulseAt(notnull IEntity body, vector impulse, vector pos)
Applies impuls on a pos position in world coordinates.
proto native void dBodySetInteractionLayer(notnull IEntity ent, int mask)
proto bool dBodyCreateDynamicEx(notnull IEntity ent, vector centerOfMass, float mass, PhysicsGeomDef geoms[])
proto native void dBodySetInertiaTensorV(notnull IEntity body, vector v)
proto native float dBodyGetKineticEnergy(notnull IEntity body)
proto native vector dBodyGetLocalInertia(notnull IEntity ent)
proto native void dBodySetMass(notnull IEntity body, float mass)
proto native vector dBodyGetCenterOfMass(notnull IEntity body)
returns center of mass offset
proto native void SetVelocity(notnull IEntity ent, vector vel)
Sets linear velocity (for Rigid bodies)
proto native void dBodySetLinearFactor(notnull IEntity body, vector linearFactor)
proto native void dBodySetInertiaTensorM(notnull IEntity body, vector m[3])
proto native vector dBodyGetInvInertiaDiagLocal(notnull IEntity ent)
proto native float dBodyGetMass(notnull IEntity ent)
proto void dBodySetAngularVelocity(notnull IEntity body, vector angvel)
Changed an angular velocity.
proto native float dBodyComputeAngularImpulseDenominator(notnull IEntity ent, vector axis)
proto native void dBodySetGeomInteractionLayer(notnull IEntity ent, int index, int mask)
proto native bool dBodyIsDynamic(notnull IEntity ent)
proto vector dBodyGetAngularVelocity(notnull IEntity body)
Gets angular velocity for a rigidbody.
proto native void dBodyGetDirectWorldTransform(notnull IEntity body, out vector matrix[4])
proto native bool dBodyIsSet(notnull IEntity ent)
Has the entity attached physics body?
proto void dBodyApplyForce(notnull IEntity body, vector force)
Applies constant force on a rigidbody (origin)
proto native void dBodyGetWorldTransform(notnull IEntity body, out vector matrix[4])
ActiveState
state of a rigidbody
Определения EnPhysics.c:86
@ INACTIVE
Определения EnPhysics.c:88
@ ALWAYS_ACTIVE
Определения EnPhysics.c:89
proto native dBlock dBodyCollisionBlock(notnull IEntity ent1, notnull IEntity ent2)
Disables collisions between two entities.
proto native void dBodyRemoveBlock(notnull IEntity worldEntity, dBlock block)
proto void dBodyApplyForceAt(notnull IEntity body, vector pos, vector force)
Applies constant force on a position.
proto native bool dBodyIsSolid(notnull IEntity ent)
proto native int dBodyGetInteractionLayer(notnull IEntity ent)