Information returned from a valid hit of a physics query. More...
Public Member Functions | |
override int | GetHashCode () |
Overrides the hash code generation of this type. More... | |
Shape3D * | GetShape (FrameBase f) |
Gets the shape of the collider hit by the query. More... | |
ref MapStaticCollider3D | GetStaticCollider (FrameBase f) |
Gets a reference to the static collider hit. Does not perform additional safety checks. More... | |
ref MapStaticCollider3D | GetStaticCollider (FrameThreadSafe f) |
Gets the static collider hit by the query. 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... | |
ref StaticColliderData | GetStaticData (FrameThreadSafe f) |
Gets the static collider data of the collision hit in the specified frame. More... | |
void | SetHitEntity (EntityRef entity) |
Sets the entity that was hit. Automatically resets StaticColliderIndex to -1. More... | |
void | SetHitStaticCollider (int staticColliderIndex, AssetRef< Map > mapRef) |
Sets the index of the static collider hit on the Map.StaticColliders3D array of the referenced map. More... | |
bool | TryGetShape (FrameBase f, out Shape3D *shape) |
Tries to get the shape of the collider hit by the query. More... | |
bool | TryGetStaticCollider (FrameBase f, out MapStaticCollider3D collider) |
Tries to access the static collider that was hit. More... | |
bool | TryGetStaticCollider (FrameThreadSafe f, out MapStaticCollider3D collider) |
Tries to retrieve the static collider associated with the hit in the given frame. More... | |
bool | TryGetStaticData (FrameBase f, out StaticColliderData data) |
Tries to access the data of the static collider that was hit (MapStaticCollider3D.StaticData). More... | |
bool | TryGetStaticData (FrameThreadSafe f, out StaticColliderData data) |
Tries to retrieve the static collider data associated with the hit. More... | |
Static Public Member Functions | |
static void | Serialize (void *ptr, FrameSerializer serializer) |
Serializes a Hit3D into a FrameSerializer. 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... | |
Static Public Attributes | |
const int | SIZE = FirstVector3 + FPVector3.SIZE * 2 + sizeof(Int64) |
The size of the struct in bytes. 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 | IsStatic [get] |
If the collider hit was static. 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... | |
AssetRef< Map > | 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... | |
Int32 | TriangleIndex [get, set] |
The index of the triangle touched by a query. More... | |
Information returned from a valid hit of a physics query.
Gets the shape of the collider hit by the query.
f | The Frame. |
Tries to get the shape of the collider hit by the query.
f | The frame. |
shape | The shape of the collider, if found. |
|
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 ). |
false
if the collider hit is not static or the collide index or referenced map are not valid. true
otherwise.
|
inline |
Tries to retrieve the static collider associated with the hit in the given frame.
f | The frame from which to retrieve the static collider. |
collider | The static collider associated with the hit, if found. Otherwise, it will be set to default. |
|
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 ). |
false
if the collider hit is not static or the collide index or referenced map are not valid. true
otherwise.
|
inline |
Tries to retrieve the static collider data associated with the hit.
f | The FrameThreadSafe object. |
data | When this method returns, contains the static collider data associated with the hit, if the hit is a static hit; otherwise, the value is default. |
|
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 the static collider hit by the query.
f | The FrameThreadSafe. |
|
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. |
|
inline |
Gets the static collider data of the collision hit in the specified frame.
f | The frame containing the collision data. |
|
inlinestatic |
|
inline |
Overrides the hash code generation of this type.
|
static |
The size of the struct in bytes.
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 |
If the collider hit was static.
|
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.
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.
|
getset |
The index of the triangle touched by a query.
|
get |
The reference of the entity hit by the query, EntityRef.None if hitting a static collider (IsDynamic false
).