Entry point for lag compensated Hitbox queries, which maintains a history buffer, and provides lag compensated raycast and overlap methods. Singleton instance is accessible through the property Runner.LagCompensation. More...
Inherits SimulationBehaviour.
Public Member Functions | |
override void | FixedUpdateNetwork () |
Internal use. Inserts (new ones) and updates all registered hitboxes into lag compensation history. More... | |
int | OverlapBox (Vector3 center, Vector3 extents, Quaternion orientation, int tick, int? tickTo, float? alpha, List< LagCompensatedHit > hits, int layerMask=-1, HitOptions options=HitOptions.None, bool clearHits=true, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal, PreProcessingDelegate preProcessRoots=null) |
Performs a lag-compensated box overlap query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes. More... | |
int | OverlapBox (Vector3 center, Vector3 extents, Quaternion orientation, int tick, List< LagCompensatedHit > hits, int layerMask=-1, HitOptions options=HitOptions.None, bool clearHits=true, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal) |
int | OverlapBox (Vector3 center, Vector3 extents, Quaternion orientation, PlayerRef player, List< LagCompensatedHit > hits, int layerMask=-1, HitOptions options=HitOptions.None, bool clearHits=true, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal, PreProcessingDelegate preProcessRoots=null) |
Performs a lag-compensated box overlap query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes. More... | |
int | OverlapSphere (Vector3 origin, float radius, int tick, int? tickTo, float? alpha, List< LagCompensatedHit > hits, int layerMask=-1, HitOptions options=HitOptions.None, bool clearHits=true, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal, PreProcessingDelegate preProcessRoots=null) |
Performs a lag-compensated overlap sphere query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes. More... | |
int | OverlapSphere (Vector3 origin, float radius, int tick, List< LagCompensatedHit > hits, int layerMask=-1, HitOptions options=HitOptions.None, bool clearHits=true, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal) |
int | OverlapSphere (Vector3 origin, float radius, PlayerRef player, List< LagCompensatedHit > hits, int layerMask=-1, HitOptions options=HitOptions.None, bool clearHits=true, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal, PreProcessingDelegate preProcessRoots=null) |
Performs a lag-compensated overlap sphere query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes. More... | |
void | PositionRotation (Hitbox hitbox, int tick, out Vector3 position, out Quaternion rotation, bool subtickAccuracy=false, int? tickTo=null, float? alpha=null) |
Performs a lag-compensated query for a specific Hitbox position and rotation. More... | |
void | PositionRotation (Hitbox hitbox, PlayerRef player, out Vector3 position, out Quaternion rotation, bool subtickAccuracy=false) |
Performs a lag-compensated query for a specific Hitbox position and rotation. More... | |
Boolean | Raycast (Vector3 origin, Vector3 direction, float length, int tick, int? tickTo, float? alpha, out LagCompensatedHit hit, int layerMask=-1, HitOptions options=HitOptions.None, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal, PreProcessingDelegate preProcessRoots=null) |
Performs a lag-compensated raycast query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes. More... | |
Boolean | Raycast (Vector3 origin, Vector3 direction, float length, int tick, out LagCompensatedHit hit, int layerMask=-1, HitOptions options=HitOptions.None, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal) |
Boolean | Raycast (Vector3 origin, Vector3 direction, float length, PlayerRef player, out LagCompensatedHit hit, int layerMask=-1, HitOptions options=HitOptions.None, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal, PreProcessingDelegate preProcessRoots=null) |
Performs a lag-compensated raycast query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes. More... | |
int | RaycastAll (Vector3 origin, Vector3 direction, float length, int tick, int? tickTo, float? alpha, List< LagCompensatedHit > hits, int layerMask=-1, bool clearHits=true, HitOptions options=HitOptions.None, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal, PreProcessingDelegate preProcessRoots=null) |
Performs a lag-compensated raycast query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes. Important: results are NOT sorted by distance. More... | |
int | RaycastAll (Vector3 origin, Vector3 direction, float length, int tick, List< LagCompensatedHit > hits, int layerMask=-1, bool clearHits=true, HitOptions options=HitOptions.None, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal) |
int | RaycastAll (Vector3 origin, Vector3 direction, float length, PlayerRef player, List< LagCompensatedHit > hits, int layerMask=-1, bool clearHits=true, HitOptions options=HitOptions.None, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal, PreProcessingDelegate preProcessRoots=null) |
Performs a lag-compensated raycast query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes. Important: results are NOT sorted by distance. More... | |
int | ResolveQuery (ref Query query, List< LagCompensatedHit > hits, bool clearHits=true) |
Performs a raycast, raycast-all, sphere- or box-overlap query. Use the CreateQuery method of RaycastQuery, SphereOverlapQuery or BoxOverlapQuery, respectively, to create a query. More... | |
Public Member Functions inherited from SimulationBehaviour | |
virtual void | Render () |
Post simulation frame rendering callback. Runs after all simulations have finished. Use in place of Unity's Update when Fusion is handling Physics. More... | |
Public Member Functions inherited from Behaviour | |
T | AddBehaviour< T > () |
Wrapper for Unity's GameObject.AddComponent() More... | |
T | GetBehaviour< T > () |
Wrapper for Unity's GameObject.GetComponentInChildren() More... | |
bool | TryGetBehaviour< T > (out T behaviour) |
Wrapper for Unity's GameObject.TryGetComponent() More... | |
Public Attributes | |
int | BVHDepth |
Debug data from Broadphase BVH (tree depth). More... | |
int | BVHNodes |
Debug data from Broadphase BVH (total nodes count). More... | |
int | TotalHitboxes |
Debug data from lag compensation history (registered Hitbox count). More... | |
Public Attributes inherited from SimulationBehaviour | |
NetworkObject | Object |
The NetworkObject this component is associated with. May be null if this GameObject does not have a NetworkObject. More... | |
NetworkRunner | Runner |
The NetworkRunner this component is associated with. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Behaviour | |
static void | DestroyBehaviour (Behaviour behaviour) |
Wrapper for Unity's GameObject.Destroy() More... | |
Properties inherited from SimulationBehaviour | |
bool | CanReceiveCallback [get] |
virtual bool? | HasInputAuthority [get] |
Returns true if the Simulation.LocalPlayer of the associated NetworkRunner is the designated as Input Authority for this network entity. More... | |
virtual bool? | HasStateAuthority [get] |
Returns true if the associated NetworkRunner is the State Authority for this network entity. More... | |
virtual bool? | IsProxy [get] |
Returns true if the associated NetworkRunner is neither the Input nor State Authority for this network entity. It is recommended to use !HasStateAuthority or !HasInputAuthority when possible instead, as this check requires evaluating both authorities - and is therefore less performant than the individual checks. More... | |
Entry point for lag compensated Hitbox queries, which maintains a history buffer, and provides lag compensated raycast and overlap methods. Singleton instance is accessible through the property Runner.LagCompensation.
Usage - Call any of the following methods:
HitboxManager.Raycast()
HitboxManager.RaycastAll()
HitboxManager.PositionRotation()
HitboxManager.OverlapSphere()
These methods use the history buffer to perform a Hitbox query against a state consistent with how the indicated PlayerRef perceived them locally.
|
virtual |
Internal use. Inserts (new ones) and updates all registered hitboxes into lag compensation history.
Reimplemented from SimulationBehaviour.
int OverlapBox | ( | Vector3 | center, |
Vector3 | extents, | ||
Quaternion | orientation, | ||
int | tick, | ||
int? | tickTo, | ||
float? | alpha, | ||
List< LagCompensatedHit > | hits, | ||
int | layerMask = -1 , |
||
HitOptions | options = HitOptions.None , |
||
bool | clearHits = true , |
||
QueryTriggerInteraction | queryTriggerInteraction = QueryTriggerInteraction.UseGlobal , |
||
PreProcessingDelegate | preProcessRoots = null |
||
) |
Performs a lag-compensated box overlap query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes.
center | Center of the box in world space. |
extents | Half of the size of the box in each dimension. |
orientation | Rotation of the box. |
tick | The exact tick to be queried |
tickTo | Simulation tick number to use as the time reference for the lag compensation. If provided, must be combined with the alpha parameter for interpolation between tick and tickTo . If HitOptions.SubtickAccuracy is included on options , this query will be resolved against hitbox colliders interpolated between the specified ticks. Otherwise, only one of the two ticks will be considered, according to the rounded value of alpha . |
alpha | Interpolation value when querying between tick and tickTo . If HitOptions.SubtickAccuracy is included on options , this query will be resolved against hitbox colliders interpolated between the specified ticks. Otherwise, only one of the two ticks will be considered, according to the rounded alpha value. |
hits | List to be filled with hits (both hitboxes and/or PhysX colliders, if included). |
layerMask | Only objects with matching layers will be checked against. |
options | Opt-in flags to compute with sub-tick accuracy (HitOptions.SubtickAccuracy) and/or to include PhysX (HitOptions.IncludePhysX). |
clearHits | Clear list of hits before filling with new ones (defaults to true). |
queryTriggerInteraction | Trigger interaction behavior when also querying PhysX. |
preProcessRoots | Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query. Roots removed from the list will not be processed any further. Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in the query narrow-phase resolution. Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root processing steps (e.g. layer mask match). |
int OverlapBox | ( | Vector3 | center, |
Vector3 | extents, | ||
Quaternion | orientation, | ||
PlayerRef | player, | ||
List< LagCompensatedHit > | hits, | ||
int | layerMask = -1 , |
||
HitOptions | options = HitOptions.None , |
||
bool | clearHits = true , |
||
QueryTriggerInteraction | queryTriggerInteraction = QueryTriggerInteraction.UseGlobal , |
||
PreProcessingDelegate | preProcessRoots = null |
||
) |
Performs a lag-compensated box overlap query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes.
center | Center of the box in world space. |
extents | Half of the size of the box in each dimension. |
orientation | Rotation of the box. |
player | Player who "owns" this overlap. Used by the server to find the exact hitbox snapshots to check against. |
hits | List to be filled with hits (both hitboxes and/or PhysX colliders, if included). |
layerMask | Only objects with matching layers will be checked against. |
options | Opt-in flags to compute with sub-tick accuracy (HitOptions.SubtickAccuracy) and/or to include PhysX (HitOptions.IncludePhysX). |
clearHits | Clear list of hits before filling with new ones (defaults to true). |
queryTriggerInteraction | Trigger interaction behavior when also querying PhysX. |
preProcessRoots | Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query. Roots removed from the list will not be processed any further. Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in the query narrow-phase resolution. Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root processing steps (e.g. layer mask match). |
int OverlapSphere | ( | Vector3 | origin, |
float | radius, | ||
int | tick, | ||
int? | tickTo, | ||
float? | alpha, | ||
List< LagCompensatedHit > | hits, | ||
int | layerMask = -1 , |
||
HitOptions | options = HitOptions.None , |
||
bool | clearHits = true , |
||
QueryTriggerInteraction | queryTriggerInteraction = QueryTriggerInteraction.UseGlobal , |
||
PreProcessingDelegate | preProcessRoots = null |
||
) |
Performs a lag-compensated overlap sphere query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes.
origin | Sphere center, in world-space |
radius | Sphere radius |
tick | The tick to be queried |
tickTo | Simulation tick number to use as the time reference for the lag compensation. If provided, must be combined with the alpha parameter for interpolation between tick and tickTo . If HitOptions.SubtickAccuracy is included on options , this query will be resolved against hitbox colliders interpolated between the specified ticks. Otherwise, only one of the two ticks will be considered, according to the rounded value of alpha . |
alpha | Interpolation value when querying between tick and tickTo . If HitOptions.SubtickAccuracy is included on options , this query will be resolved against hitbox colliders interpolated between the specified ticks. Otherwise, only one of the two ticks will be considered, according to the rounded alpha value. |
hits | List to be filled with hits (both hitboxes and/or PhysX colliders, if included). |
layerMask | Only objects with matching layers will be checked against. |
options | Opt-in flags to compute with sub-tick accuracy (HitOptions.SubtickAccuracy) and/or to include PhysX (HitOptions.IncludePhysX). |
clearHits | Clear list of hits before filling with new ones (defaults to true). |
queryTriggerInteraction | Trigger interaction behavior when also querying PhysX. |
preProcessRoots | Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query. Roots removed from the list will not be processed any further. Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in the query narrow-phase resolution. Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root processing steps (e.g. layer mask match). |
int OverlapSphere | ( | Vector3 | origin, |
float | radius, | ||
PlayerRef | player, | ||
List< LagCompensatedHit > | hits, | ||
int | layerMask = -1 , |
||
HitOptions | options = HitOptions.None , |
||
bool | clearHits = true , |
||
QueryTriggerInteraction | queryTriggerInteraction = QueryTriggerInteraction.UseGlobal , |
||
PreProcessingDelegate | preProcessRoots = null |
||
) |
Performs a lag-compensated overlap sphere query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes.
origin | Sphere center, in world-space |
radius | Sphere radius |
player | Player who "owns" this overlap. Used by the server to find the exact hitbox snapshots to check against. |
hits | List to be filled with hits (both hitboxes and/or PhysX colliders, if included). |
layerMask | Only objects with matching layers will be checked against. |
options | Opt-in flags to compute with sub-tick accuracy (HitOptions.SubtickAccuracy) and/or to include PhysX (HitOptions.IncludePhysX). |
clearHits | Clear list of hits before filling with new ones (defaults to true). |
queryTriggerInteraction | Trigger interaction behavior when also querying PhysX. |
preProcessRoots | Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query. Roots removed from the list will not be processed any further. Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in the query narrow-phase resolution. Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root processing steps (e.g. layer mask match). |
void PositionRotation | ( | Hitbox | hitbox, |
int | tick, | ||
out Vector3 | position, | ||
out Quaternion | rotation, | ||
bool | subtickAccuracy = false , |
||
int? | tickTo = null , |
||
float? | alpha = null |
||
) |
Performs a lag-compensated query for a specific Hitbox position and rotation.
hitbox | The target hitbox to be queried in the past |
tick | The tick to be queried |
tickTo | Simulation tick number to use as the time reference for the lag compensation. If provided, must be combined with the alpha parameter for interpolation between tick and tickTo . If subtickAccuracy is requested, the query will return the hitbox state interpolated between the specified ticks. Otherwise, only one of the two ticks will be considered, according to the rounded value of alpha . |
alpha | Interpolation value when querying between tick and tickTo . If subtickAccuracy is requested, the query will return the hitbox state interpolated between the specified ticks. Otherwise, only one of the two ticks will be considered, according to the rounded alpha value. |
position | Will be filled with the hitbox position at the time of the tick |
rotation | Will be filled with the hitbox rotation at the time of the tick |
subtickAccuracy | If the query should interpolate between ticks to reflect exactly what was seen on the client. |
void PositionRotation | ( | Hitbox | hitbox, |
PlayerRef | player, | ||
out Vector3 | position, | ||
out Quaternion | rotation, | ||
bool | subtickAccuracy = false |
||
) |
Performs a lag-compensated query for a specific Hitbox position and rotation.
hitbox | The target hitbox to be queried in the past |
player | Player who "owns" this overlap. Used by the server to find the exact hitbox snapshots to check against. |
position | Will be filled with the hitbox position at the time of the tick |
rotation | Will be filled with the hitbox rotation at the time of the tick |
subtickAccuracy | If the query should interpolate between ticks to reflect exactly what was seen on the client. |
Boolean Raycast | ( | Vector3 | origin, |
Vector3 | direction, | ||
float | length, | ||
int | tick, | ||
int? | tickTo, | ||
float? | alpha, | ||
out LagCompensatedHit | hit, | ||
int | layerMask = -1 , |
||
HitOptions | options = HitOptions.None , |
||
QueryTriggerInteraction | queryTriggerInteraction = QueryTriggerInteraction.UseGlobal , |
||
PreProcessingDelegate | preProcessRoots = null |
||
) |
Performs a lag-compensated raycast query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes.
origin | Raycast origin, in world-space |
direction | Raycast direction, in world-space |
length | Raycast length |
tick | Simulation tick number to use as the time reference for the lag compensation (use this for server AI, and similar). |
tickTo | Simulation tick number to use as the time reference for the lag compensation. If provided, must be combined with the alpha parameter for interpolation between tick and tickTo . If HitOptions.SubtickAccuracy is included on options , this query will be resolved against hitbox colliders interpolated between the specified ticks. Otherwise, only one of the two ticks will be considered, according to the rounded value of alpha . |
alpha | Interpolation value when querying between tick and tickTo . If HitOptions.SubtickAccuracy is included on options , this query will be resolved against hitbox colliders interpolated between the specified ticks. Otherwise, only one of the two ticks will be considered, according to the rounded alpha value. |
hit | Raycast results will be filled in here. |
layerMask | Only objects with matching layers will be checked against. |
options | Opt-in flags to compute with sub-tick accuracy (HitOptions.SubtickAccuracy) and/or to include PhysX (HitOptions.IncludePhysX). |
queryTriggerInteraction | Trigger interaction behavior when also querying PhysX. |
preProcessRoots | Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query. Roots removed from the list will not be processed any further. Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in the query narrow-phase resolution. Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root processing steps (e.g. layer mask match). |
Boolean Raycast | ( | Vector3 | origin, |
Vector3 | direction, | ||
float | length, | ||
PlayerRef | player, | ||
out LagCompensatedHit | hit, | ||
int | layerMask = -1 , |
||
HitOptions | options = HitOptions.None , |
||
QueryTriggerInteraction | queryTriggerInteraction = QueryTriggerInteraction.UseGlobal , |
||
PreProcessingDelegate | preProcessRoots = null |
||
) |
Performs a lag-compensated raycast query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes.
origin | Raycast origin, in world-space |
direction | Raycast direction, in world-space |
length | Raycast length |
player | Player who "owns" this raycast. Used by the server to find the exact hitbox snapshots to check against. |
hit | Raycast results will be filled in here. |
layerMask | Only objects with matching layers will be checked against. |
options | Opt-in flags to compute with sub-tick accuracy (HitOptions.SubtickAccuracy) and/or to include PhysX (HitOptions.IncludePhysX). |
queryTriggerInteraction | Trigger interaction behavior when also querying PhysX. |
preProcessRoots | Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query. Roots removed from the list will not be processed any further. Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in the query narrow-phase resolution. Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root processing steps (e.g. layer mask match). |
int RaycastAll | ( | Vector3 | origin, |
Vector3 | direction, | ||
float | length, | ||
int | tick, | ||
int? | tickTo, | ||
float? | alpha, | ||
List< LagCompensatedHit > | hits, | ||
int | layerMask = -1 , |
||
bool | clearHits = true , |
||
HitOptions | options = HitOptions.None , |
||
QueryTriggerInteraction | queryTriggerInteraction = QueryTriggerInteraction.UseGlobal , |
||
PreProcessingDelegate | preProcessRoots = null |
||
) |
Performs a lag-compensated raycast query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes. Important: results are NOT sorted by distance.
origin | Raycast origin, in world-space |
direction | Raycast direction, in world-space |
length | Raycast length |
tick | Simulation tick number to use as the time reference for the lag compensation (use this for server AI, and similar). |
tickTo | Simulation tick number to use as the time reference for the lag compensation. If provided, must be combined with the alpha parameter for interpolation between tick and tickTo . If HitOptions.SubtickAccuracy is included on options , this query will be resolved against hitbox colliders interpolated between the specified ticks. Otherwise, only one of the two ticks will be considered, according to the rounded value of alpha . |
alpha | Interpolation value when querying between tick and tickTo . If HitOptions.SubtickAccuracy is included on options , this query will be resolved against hitbox colliders interpolated between the specified ticks. Otherwise, only one of the two ticks will be considered, according to the rounded alpha value. |
hits | List to be filled with hits (both hitboxes and/or PhysX colliders, if included). |
layerMask | Only objects with matching layers will be checked against. |
options | Opt-in flags to compute with sub-tick accuracy (HitOptions.SubtickAccuracy) and/or to include PhysX (HitOptions.IncludePhysX). |
clearHits | Clear list of hits before filling with new ones (defaults to true). |
queryTriggerInteraction | Trigger interaction behavior when also querying PhysX. |
preProcessRoots | Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query. Roots removed from the list will not be processed any further. Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in the query narrow-phase resolution. Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root processing steps (e.g. layer mask match). |
int RaycastAll | ( | Vector3 | origin, |
Vector3 | direction, | ||
float | length, | ||
PlayerRef | player, | ||
List< LagCompensatedHit > | hits, | ||
int | layerMask = -1 , |
||
bool | clearHits = true , |
||
HitOptions | options = HitOptions.None , |
||
QueryTriggerInteraction | queryTriggerInteraction = QueryTriggerInteraction.UseGlobal , |
||
PreProcessingDelegate | preProcessRoots = null |
||
) |
Performs a lag-compensated raycast query against all registered hitboxes. If the HitOptions.IncludePhysX flag is indicated, query will also include PhysX colliders, PhysX colliders are recommended for static geometry, rather than Hitboxes. Important: results are NOT sorted by distance.
origin | Raycast origin, in world-space |
direction | Raycast direction, in world-space |
length | Raycast length |
player | Player who "owns" this raycast. Used by the server to find the exact hitbox snapshots to check against. |
hits | List to be filled with hits (both hitboxes and/or PhysX colliders, if included). |
layerMask | Only objects with matching layers will be checked against. |
options | Opt-in flags to compute with sub-tick accuracy (HitOptions.SubtickAccuracy) and/or to include PhysX (HitOptions.IncludePhysX). |
clearHits | Clear list of hits before filling with new ones (defaults to true). |
queryTriggerInteraction | Trigger interaction behavior when also querying PhysX. |
preProcessRoots | Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query. Roots removed from the list will not be processed any further. Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in the query narrow-phase resolution. Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root processing steps (e.g. layer mask match). |
int ResolveQuery | ( | ref Query | query, |
List< LagCompensatedHit > | hits, | ||
bool | clearHits = true |
||
) |
Performs a raycast, raycast-all, sphere- or box-overlap query. Use the CreateQuery method of RaycastQuery, SphereOverlapQuery or BoxOverlapQuery, respectively, to create a query.
query | The lag-compensated query to be performed. |
hits | List to be filled with hits (both hitboxes and/or PhysX colliders, if included). |
clearHits | Clear list of hits before filling with new ones (defaults to true). |
ArgumentException | If the query type is not supported by this method. |
int BVHDepth |
Debug data from Broadphase BVH (tree depth).
int BVHNodes |
Debug data from Broadphase BVH (total nodes count).
int TotalHitboxes |
Debug data from lag compensation history (registered Hitbox count).