CollisionCastResult

A result of collision cast.

Properties

Link copied to clipboard
val distance: Float

The distance from the ray origin to the collision point, or the convex shape travel distance, or the cone projection distance.

Link copied to clipboard

The entity that was hit.

Link copied to clipboard
val materialIndex: Int

The index of the sub-mesh that owns the hit triangle. This can be used to identify which material was hit from ModelComponent.materials. When the hit collider is created from ShapeResource.createStaticMesh, this value is a non-negative index. Otherwise, this value is -1.

Link copied to clipboard

The normal of the collision point in given space.

Link copied to clipboard

The position of the collision point in given space.

Link copied to clipboard
val shapeIndex: Int

The index of the collision's shapeResource in the CollisionComponent's shapes array.

Link copied to clipboard

The UV coordinate of the hit point on the first UV channel (UV0). When the hit collider is created from ShapeResource.createStaticMesh and the underlying mesh contains a UV0 set, this value is the interpolated UV at the hit position. Otherwise, this value is Vector2.ZERO.

Link copied to clipboard

The UV coordinate of the hit point on the second UV channel (UV1). When the hit collider is created from ShapeResource.createStaticMesh and the underlying mesh contains a secondary UV set (UV1), this value is the interpolated UV at the hit position. Otherwise, this value is Vector2.ZERO.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String