Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
dayzphysics.c
Go to the documentation of this file.
44
45
50{
53
56
57 float radius;
58
64
73 int type;
74
75 bool sorted;
77
78 void RaycastRVParams( vector vBeg, vector vEnd, Object pIgnore = null, float fRadius = 0.0 )
79 {
80 begPos = vBeg;
81 endPos = vEnd;
82 ignore = pIgnore;
83 radius = fRadius;
84
85 // default values
86 with = null;
87 flags = CollisionFlags.NEARESTCONTACT;
88 type = ObjIntersectView;
89 sorted = false;
90 groundOnly = false;
91 }
92};
93
94
114
116{
117 bool OnContact(IEntity other, Contact contact)
118 {
119 return true;
120 }
121};
122
124{
125 private void DayZPhysics() {}
126 private void ~DayZPhysics() {}
127
199 proto static bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, /*out*/ set<Object> results = NULL, Object with = NULL, Object ignore = NULL, bool sorted = false, bool ground_only = false, int iType = ObjIntersectView, float radius = 0.0, CollisionFlags flags = CollisionFlags.NEARESTCONTACT);
200
201 //I am so sorry about this, I am unable to change RaycastRV above without breaking rest of DZ
202 //proto static bool RaycastRVExt(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, /*out*/ array<string> resultSurfaces = NULL, /*out*/ array<Object> resultObjects = NULL, Object with = NULL, Object ignore = NULL, bool sorted = false, bool ground_only = false, int iType = ObjIntersectView, float radius = 0.0, CollisionFlags flags = CollisionFlags.NEARESTCONTACT);
203
204 proto static bool GetHitSurface(Object other, vector begPos, vector endPos, string surface);
205
206 proto static bool GetHitSurfaceAndLiquid(Object other, vector begPos, vector endPos, string surface, out int liquidType);
207
208 proto static bool RaycastRVProxy( notnull RaycastRVParams in, out notnull array< ref RaycastRVResult> results, array< Object > excluded = null );
209
210
211 proto static bool RayCastBullet(vector begPos, vector endPos, PhxInteractionLayers layerMask, Object ignoreObj, out Object hitObject, out vector hitPosition, out vector hitNormal, out float hitFraction);
212
213 proto static bool SphereCastBullet(vector begPos, vector endPos, float radius, PhxInteractionLayers layerMask, Object ignoreObj, out Object hitObject, out vector hitPosition, out vector hitNormal, out float hitFraction);
214
215
216 proto static bool GeometryOverlapBullet(vector transform[4], dGeom geometry, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback);
217
218 proto static bool EntityOverlapBullet(vector transform[4], IEntity entity, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback);
219
220 proto static bool EntityOverlapSingleBullet(vector transform[4], IEntity entity, IEntity other, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback);
221
222 proto static bool SphereOverlapBullet(vector position, float radius, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback);
223
224 proto static bool CylinderOverlapBullet(vector transform[4], vector extents, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback);
225
226 proto static bool CapsuleOverlapBullet(vector transform[4], float radius, float height, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback);
227
228 proto static bool BoxOverlapBullet(vector transform[4], vector extents, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback);
229
230}
enum PGPolyFlags TERRAIN
enum PGPolyFlags ROADWAY
DOOR
Definition aiworld.c:4
enum PGPolyFlags BUILDING
bool OnContact(IEntity other, Contact contact)
Output structure for reporting collisions.
Definition contact.c:10
void ~DayZPhysics()
static proto bool RayCastBullet(vector begPos, vector endPos, PhxInteractionLayers layerMask, Object ignoreObj, out Object hitObject, out vector hitPosition, out vector hitNormal, out float hitFraction)
static proto bool RaycastRVProxy(notnull RaycastRVParams in, out notnull array< ref RaycastRVResult > results, array< Object > excluded=null)
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
void DayZPhysics()
static proto bool BoxOverlapBullet(vector transform[4], vector extents, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback)
static proto bool SphereOverlapBullet(vector position, float radius, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback)
static proto bool CylinderOverlapBullet(vector transform[4], vector extents, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback)
static proto bool EntityOverlapSingleBullet(vector transform[4], IEntity entity, IEntity other, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback)
static proto bool CapsuleOverlapBullet(vector transform[4], float radius, float height, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback)
static proto bool SphereCastBullet(vector begPos, vector endPos, float radius, PhxInteractionLayers layerMask, Object ignoreObj, out Object hitObject, out vector hitPosition, out vector hitNormal, out float hitFraction)
static proto bool GetHitSurface(Object other, vector begPos, vector endPos, string surface)
static proto bool GeometryOverlapBullet(vector transform[4], dGeom geometry, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback)
static proto bool GetHitSurfaceAndLiquid(Object other, vector begPos, vector endPos, string surface, out int liquidType)
static proto bool EntityOverlapBullet(vector transform[4], IEntity entity, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback)
Internal ancestor of all Entity implementations.
Definition enentity.c:165
TODO doc.
Definition enscript.c:118
Input parameters for RaycastRVProxy function.
Definition dayzphysics.c:50
Object ignore
ignore this object in collision, used only if groundOnly is false
Definition dayzphysics.c:54
CollisionFlags flags
Sets the raycast behaviour in terms of result.
Definition dayzphysics.c:63
float radius
radius along the ray tested
Definition dayzphysics.c:57
vector begPos
begin position of raycast (e.g.
Definition dayzphysics.c:51
vector endPos
end position of raycast (e.g.
Definition dayzphysics.c:52
bool groundOnly
raycasts only ground (ignores all objects).
Definition dayzphysics.c:76
void RaycastRVParams(vector vBeg, vector vEnd, Object pIgnore=null, float fRadius=0.0)
Definition dayzphysics.c:78
int type
type of intersection, possible values ObjIntersectFire(0), ObjIntersectView(1), ObjIntersectGeom(2),...
Definition dayzphysics.c:73
bool sorted
used only if groundOnly = false
Definition dayzphysics.c:75
Object with
ignore object with this object, otherwise collision hits, used only if groundOnly is false
Definition dayzphysics.c:55
Contains result data of RaycastRVProxy function.
Definition dayzphysics.c:99
vector dir
direction outside (in world coord) or (in case of line-object collision) direction and size of the in...
vector pos
position of collision (in world coord)
SurfaceInfo surface
surface material info handle
Object obj
object,that we collide with (NULL if none), If hierLevel > 0 object is the proxy object
int component
index of component in corresponding geometry level
bool entry
is false if begining point was TriggerInsider
Object parent
if hierLevel > 0 most parent of the proxy object
int hierLevel
which hierarchy level is the collision detected at, == 0 = objects in landscape, > 0 = proxy
bool exit
is false if end point was inside
Unmanaged surface info handle.
Definition surfaceinfo.c:9
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
PhxInteractionLayers
Definition dayzphysics.c:2
@ ITEM_LARGE
Definition dayzphysics.c:38
@ AI_COMPLEX
Definition dayzphysics.c:31
@ TRIGGER_NOTERRAIN
Definition dayzphysics.c:35
@ DYNAMICITEM_NOCHAR
Definition dayzphysics.c:10
@ ITEM_SMALL
Definition dayzphysics.c:37
@ DYNAMICITEM
Definition dayzphysics.c:9
@ CHARACTER_NO_GRAVITY
Definition dayzphysics.c:13
@ WATERLAYER
Definition dayzphysics.c:22
@ TEMP
Definition dayzphysics.c:42
@ GHOST
Definition dayzphysics.c:25
@ AI_NO_COLLISION
Definition dayzphysics.c:30
@ RAGDOLL
Definition dayzphysics.c:20
@ CHARACTER
Definition dayzphysics.c:7
@ FIREGEOM
Redefinition of 'RAGDOLL_NO_CHARACTER'.
Definition dayzphysics.c:17
@ AI
Definition dayzphysics.c:29
@ RAGDOLL_NO_CHARACTER
Definition dayzphysics.c:14
@ TINYCAPSULE
Definition dayzphysics.c:33
@ WORLDBOUNDS
Definition dayzphysics.c:26
@ VEHICLE_NOTERRAIN
Definition dayzphysics.c:12
@ FENCE
Definition dayzphysics.c:27
@ VEHICLE
Definition dayzphysics.c:8
@ CAMERA
Definition dayzphysics.c:40
@ NOCOLLISION
Definition dayzphysics.c:3
@ DEFAULT
CollisionFlags
Definition endebug.c:141
@ TRIGGER
Is not collidable, but invokes touch events.
Definition enentity.c:124
PhysicsGeom dGeom
Geometric shapes relevant for physics simulation.
Definition physicsgeom.c:9