Raycasts world by given parameters.
- 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
{
bool sorted;
float radius;
if (
GetGame().Raycast(begPos, endPos,
contactPos,
contactDir,
contactComponent,
results, with, ignore, sorted,
ground_only,
iType, radius) )
{
Print(
GetGame().
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>}
>> bool sorted = 0
>> float radius = 0
>> 1
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
Referenced by PoweredOptic_Base::DoMeasurement(), ItemBase::DoMeasurement(), WeaponDebug::DrawLineOfFire(), WeaponDebug::DrawLineOfFireCameraHybrid(), WeaponDebug::DrawLineOfFireMuzzleToHit(), Event_OnClick(), PluginBase::Event_OnClick(), PluginBase::Event_OnClickMiddle(), PluginBase::Event_OnDoubleClick(), PluginBase::Event_OnDrag(), FloatingCrossHair(), ManBase::GetAimPosition(), UIScriptedMenu::GetCameraLookDir(), GetCeilingHeight(), UIScriptedMenu::GetMouseLookDir(), PluginBase::GetMousePositionInScene(), GetProjectedCursorPos3d(), Hologram::GetProjectionEntityPosition(), AreaDamageBase::GetRaycastedHitZone(), HitZoneSelection(), HitZoneSelectionRaycast(), Hologram::IsBaseViable(), Hologram::IsInTerrain(), IsObjectObstructedFilterEx(), IsUnderRoofEx(), UIScriptedMenu::OnClick(), ScriptConsoleItemsTab::OnClick(), ScriptConsoleItemsTab::OnDoubleClick(), Hologram::SetOnGround(), and DeveloperTeleport::TeleportAtCursor().