DIFF

class DayZPhysicsSource

Constructors 2

private void DayZPhysics()
private void ~DayZPhysics()

Methods 13

proto static 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

begPos
vector Begin position of raycast (e.g. player position)
endPos
vector End position of raycast (e.g. player direction)
contactPos
vector out, world position of first contact
contactDir
vector out, direction of first contact (available only when object is hitted)
contactComponent
int out, object component index (available only when object is hitted)
results
set<Object> out, set of objects hitted by raycast. Can be NULL if not needed
with
Object Ignores the object from collision. Used only when ground_only is false. Can be NULL if not needed
ignore
Object Ignores the object from collision. Used only when ground_only is false. Can be NULL if not needed
sorted
bool Default value is false, used only if ground_only = false
ground_only
\bool raycasts only ground (ignores all objects). Default value is false if not needed.
iType
int, type of intersection, possible values ObjIntersectFire(0), ObjIntersectView(1), ObjIntersectGeom(2), ObjIntersectIFire(3), ObjIntersectNone(4)
radius
float Radius of the ray, default value set to 0

Returns: bool return true if raycast hits ground or object

// raycast test
PlayerBase player = g_Game.GetPlayer();

if (player)
{
	vector begPos = player.GetPosition();
	vector endPos = begPos + (player.GetDirection() * 100);
	vector contactPos;
	vector contactDir;
	int contactComponent;
	set<Object> results = new set<Object>;
	Object with;
	Object ignore;
	bool sorted;
	bool ground_only;
	int iType;
	float radius;

	if ( g_Game.Raycast(begPos, endPos, contactPos, contactDir, contactComponent, results, with, ignore, sorted, ground_only, iType, radius) )
	{
		Print(begPos);
		Print(endPos);
		Print(contactPos);
		Print(contactDir);
		Print(contactComponent);
		Print(results);
		Print(with);
		Print(ignore);
		Print(sorted);
		Print(ground_only);
		Print(iType);
		Print(radius);

		Print( g_Game.Raycast(begPos, endPos, contactPos, contactDir, contactComponent, results, with, ignore, sorted, ground_only, iType, radius) );
	}
}

	>> vector begPos = 0x00000000dd62df30 {<750.573,49.8043,2167.25>}
	>> vector endPos = 0x00000000dd62df3c {<849.589,49.8043,2181.25>}
	>> vector contactPos = 0x00000000dd62df48 {<751.068,49.8043,2167.32>}
	>> vector contactDir = 0x00000000dd62df54 {<0.987203,2.04891e-08,0.139505>}
	>> int contactComponent = 8
	>> set<Object> results = set<Object><a022d840>
	>> Object with = NULL
	>> Object ignore = NULL
	>> bool sorted = 0
	>> bool ground_only = 0
	>> int iType =   0
	>> float radius = 0

	>> 1
proto static bool GetHitSurface(Object other, vector begPos, vector endPos, string surface)
proto static bool GetHitSurfaceAndLiquid(Object other, vector begPos, vector endPos, string surface, out int liquidType)
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)
proto static bool GeometryOverlapBullet(vector transform[4], dGeom geometry, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback)
proto static bool EntityOverlapBullet(vector transform[4], IEntity entity, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback)
proto static bool EntityOverlapSingleBullet(vector transform[4], IEntity entity, IEntity other, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback)
proto static bool SphereOverlapBullet(vector position, float radius, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback)
proto static bool CylinderOverlapBullet(vector transform[4], vector extents, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback)
proto static bool CapsuleOverlapBullet(vector transform[4], float radius, float height, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback)
proto static bool BoxOverlapBullet(vector transform[4], vector extents, PhxInteractionLayers layerMask, notnull CollisionOverlapCallback callback)