Class ShapeCastResult
Hierarchy
- CastingResult
- ShapeCastResult
Constructors
constructor
-
Returns ShapeCastResult
Properties
Optionalbody
The Physics body that the query hit.
Optionalbody Index
bodyIndex?: number
The body Index in case the Physics body is using instances
Optionalshape
The shape hit by the query.
Accessors
has Hit
-
get hasHit(): boolean
Gets if there was a hit
Returns boolean
hit Fraction
-
get hitFraction(): number
Gets the hit fraction along the casting ray
Returns number
hit Normal
-
Gets the hit normal.
Returns Vector3
hit Point
-
Gets the hit point.
Returns Vector3
triangle Index
-
get triangleIndex(): number
The index of the original triangle which was hit. Will be -1 if contact point is not on a mesh shape
Returns number
Methods
reset
-
Resets all the values to default
Returns void
set Hit Data
-
Sets the hit data
Parameters
- hitNormal: IXYZ
defines the normal in world space
- hitPoint: IXYZ
defines the point in world space
OptionaltriangleIndex: numberdefines the index of the triangle in case of mesh shape
Returns void
- hitNormal: IXYZ
set Hit Fraction
-
Sets the hit fraction along the casting ray
Parameters
- fraction: number
Returns void
Class representing a contact point produced in a shape cast