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
begPosvectorBegin position of raycast (e.g. player position)endPosvectorEnd position of raycast (e.g. player direction)contactPosvectorout, world position of first contactcontactDirvectorout, direction of first contact (available only when object is hitted)contactComponentintout, object component index (available only when object is hitted)resultsset<Object>out, set of objects hitted by raycast. Can be NULL if not neededwithObjectIgnores the object from collision. Used only whenground_onlyis false. Can be NULL if not neededignoreObjectIgnores the object from collision. Used only whenground_onlyis false. Can be NULL if not neededsortedboolDefault value is false, used only ifground_only= falseground_only- \bool raycasts only ground (ignores all objects). Default value is false if not needed.
iTypeint,type of intersection, possible values ObjIntersectFire(0), ObjIntersectView(1), ObjIntersectGeom(2), ObjIntersectIFire(3), ObjIntersectNone(4)radiusfloatRadius 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
>> 1Referenced by AreaDamageBase.GetRaycastedHitZone(), CameraToolsMenu.GetCameraLookDir(), CameraToolsMenu.GetMouseLookDir()
Show 27 more
, CrossHairSelector.FloatingCrossHair(), DayZPlayerImplementMeleeCombat.HitZoneSelection(), DayZPlayerImplementMeleeCombat.HitZoneSelectionRaycast(), DeveloperTeleport.TeleportAtCursor(), FireplaceBase.GetCeilingHeight(), Hologram.GetProjectionEntityPosition(), Hologram.IsBaseViable(), Hologram.IsInTerrain(), Hologram.SetOnGround(), MiscGameplayFunctions.GetProjectedCursorPos3d(), MiscGameplayFunctions.IsObjectObstructedFilterEx(), MiscGameplayFunctions.IsUnderRoofEx(), PlayerBase.GetAimPosition(), PluginDayZCreatureAIDebug.Event_OnClick(), PluginSceneManager.Event_OnClick(), PluginSceneManager.Event_OnClickMiddle(), PluginSceneManager.Event_OnDoubleClick(), PluginSceneManager.Event_OnDrag(), PluginSceneManager.GetMousePositionInScene(), Rangefinder.DoMeasurement(), Raycaster.DoMeasurement(), SceneEditorMenu.OnClick(), ScriptConsoleItemsTab.OnClick(), ScriptConsoleItemsTab.OnDoubleClick(), WeaponDebug.DrawLineOfFire(), WeaponDebug.DrawLineOfFireCameraHybrid(), and WeaponDebug.DrawLineOfFireMuzzleToHit()proto static bool GetHitSurfaceAndLiquid(Object other, vector begPos, vector endPos, string surface, out int liquidType)Referenced by InventoryItem.GetImpactSurfaceTypeEx()
proto static bool RaycastRVProxy(notnull RaycastRVParams in, out notnull array< ref RaycastRVResult> results, array< Object > excluded = null)Referenced by ActionTargets.Update(), AreaDamageComponentRaycasted.GetRaycastedHitZone(), BearTrap.OnSteppedOn()
Show 8 more
, FlashGrenade.OnExplosionEffects(), Hologram.SetOnGround(), IngameHud.RefreshPlayerTags(), MiscGameplayFunctions.GetRandomizedPositionVerified(), MiscGameplayFunctions.IsObjectObstructedFilterEx(), MiscGameplayFunctions.IsObjectObstructedProxy(), VicinityItemManager.RefreshVicinityItems(), and Weapon_Base.LiftWeaponCheckEx()proto static bool RayCastBullet(vector begPos, vector endPos, PhxInteractionLayers layerMask, Object ignoreObj, out Object hitObject, out vector hitPosition, out vector hitNormal, out float hitFraction)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)Referenced by DeveloperTeleport.TeleportAtCursorEx()
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)