Information returned from a valid hit of a physics query. More...
Public Member Functions | |
ref MapStaticCollider3D | GetStaticCollider (FrameBase f) |
Gets a reference to the static collider hit. Does not perform additional safety checks. More... | |
ref StaticColliderData | GetStaticData (FrameBase f) |
Gets a reference to the data of the static collider hit (MapStaticCollider3D.StaticData). Does not perform additional safety checks. More... | |
void | SetHitEntity (EntityRef entity) |
Sets the entity that was hit. Automatically resets StaticColliderIndex to -1. More... | |
void | SetHitStaticCollider (int staticColliderIndex, AssetRefMap mapRef) |
Sets the index of the static collider hit on the Map.StaticColliders3D array of the referenced map. More... | |
bool | TryGetStaticCollider (FrameBase f, out MapStaticCollider3D collider) |
Tries to access the static collider that was hit. More... | |
bool | TryGetStaticData (FrameBase f, out StaticColliderData data) |
Tries to access the data of the static collider that was hit (MapStaticCollider3D.StaticData). More... | |
Public Attributes | |
FP | CastDistanceNormalized |
A normalized value (0 to 1) of the feature being casted when the hit occurs, relative to its full cast distance. More... | |
FPVector3 | Normal |
The surface normal of the hit. More... | |
FP | OverlapPenetration |
The penetration of a shape overlap query on the collider that was hit. More... | |
FPVector3 | Point |
The point in world space where the collider is hit by the query. More... | |
ushort | ShapeUserTag |
The Shape3D.UserTag field of the shape hit by the query. More... | |
Properties | |
EntityRef? | Entity [get] |
The reference of the entity hit by the query, EntityRef.None if hitting a static collider (IsDynamic false). More... | |
Boolean | IsDynamic [get] |
If the collider hit by the query is not static, i.e. it belongs to an Entity. More... | |
Boolean? | IsTrigger [get, set] |
If the collider hit by the query is Trigger. More... | |
int | StaticColliderIndex [get] |
0-based index of the static collider on the Map.StaticColliders3D array of the map referenced by StaticColliderMapRef. If the hit IsDynamic, this value is -1. Tip: use TryGetStaticCollider(FrameBase, out MapStaticCollider3D), TryGetStaticData(FrameBase, out StaticColliderData), GetStaticCollider(FrameBase) or GetStaticData(FrameBase) in order to safely and conveniently access info about a static collider hit. More... | |
AssetRefMap | StaticColliderMapRef [get] |
The reference to the map used by the physics engine when a static collider is hit. Otherwise, this value is default (hit IsDynamic). More... | |
Information returned from a valid hit of a physics query.
|
inline |
Sets the entity that was hit. Automatically resets StaticColliderIndex to -1.
entity | The entity reference. |
|
inline |
Sets the index of the static collider hit on the Map.StaticColliders3D array of the referenced map.
staticColliderIndex | A valid index of the static collider on the array of the map. |
mapRef | A reference to the map where the static collider hit is located. |
|
inline |
Tries to access the static collider that was hit.
f | Current frame. |
collider | A copy of the static collider data found. Default if the metadata is not valid (returns false). |
|
inline |
Tries to access the data of the static collider that was hit (MapStaticCollider3D.StaticData).
f | Current frame. |
data | A copy of the static collider data found. Default if the metadata is not valid (returns false). |
|
inline |
Gets a reference to the static collider hit. Does not perform additional safety checks.
f | Current frame. |
NullReferenceException | If the StaticColliderMapRef does not reference a valid asset. |
IndexOutOfRangeException | If the hit is not static (IsDynamic) or the collider index is not valid for the array of static colliders on the referenced map. |
|
inline |
Gets a reference to the data of the static collider hit (MapStaticCollider3D.StaticData). Does not perform additional safety checks.
f | Current frame. |
NullReferenceException | If the StaticColliderMapRef does not reference a valid asset. |
IndexOutOfRangeException | If the hit is not static (IsDynamic) or the collider index is not valid for the array of static colliders on the referenced map. |
ushort Quantum.Physics3D.Hit3D.ShapeUserTag |
The Shape3D.UserTag field of the shape hit by the query.
FP Quantum.Physics3D.Hit3D.OverlapPenetration |
The penetration of a shape overlap query on the collider that was hit.
This field is not computed unless QueryOptions.ComputeDetailedInfo is used in the query options and only applies to Shape Overlap queries. It overlaps in memory and is mutually exclusive with CastDistanceNormalized.
FP Quantum.Physics3D.Hit3D.CastDistanceNormalized |
A normalized value (0 to 1) of the feature being casted when the hit occurs, relative to its full cast distance.
This field only applies to Ray, Line or Shape casts. It overlaps in memory and is mutually exclusive with OverlapPenetration.
FPVector3 Quantum.Physics3D.Hit3D.Point |
The point in world space where the collider is hit by the query.
FPVector3 Quantum.Physics3D.Hit3D.Normal |
The surface normal of the hit.
This field is not computed unless QueryOptions.ComputeDetailedInfo is used in the query options.
|
get |
If the collider hit by the query is not static, i.e. it belongs to an Entity.
|
get |
0-based index of the static collider on the Map.StaticColliders3D array of the map referenced by StaticColliderMapRef. If the hit IsDynamic, this value is -1. Tip: use TryGetStaticCollider(FrameBase, out MapStaticCollider3D), TryGetStaticData(FrameBase, out StaticColliderData), GetStaticCollider(FrameBase) or GetStaticData(FrameBase) in order to safely and conveniently access info about a static collider hit.
|
get |
The reference to the map used by the physics engine when a static collider is hit. Otherwise, this value is default (hit IsDynamic).
|
getset |
If the collider hit by the query is Trigger.
|
get |
The reference of the entity hit by the query, EntityRef.None if hitting a static collider (IsDynamic false).