Class RaycastHitWrapper
Wrapper for RaycastHit to IRaycastHit.
Implements
Namespace: nickmaltbie.OpenKCC.Utils
Assembly: cs.temp.dll.dll
Syntax
public class RaycastHitWrapper : IRaycastHit
Constructors
RaycastHitWrapper(RaycastHit)
Initialize a raycast hit wrapper for a given raycast hit event.
Declaration
public RaycastHitWrapper(RaycastHit hit)
Parameters
Type | Name | Description |
---|---|---|
RaycastHit | hit | Raycast hit event. |
Properties
barycentricCoordinate
The barycentric coordinate of the triangle we hit.
Declaration
public Vector3 barycentricCoordinate { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
collider
The Collider that was hit.
Declaration
public Collider collider { get; }
Property Value
Type | Description |
---|---|
Collider |
distance
The distance from the ray's origin to the impact point.
Declaration
public float distance { get; set; }
Property Value
Type | Description |
---|---|
Single |
normal
The normal of the surface the ray hit.
Declaration
public Vector3 normal { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
point
The impact point in world space where the ray hit the collider.
Declaration
public Vector3 point { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
rigidbody
The Rigidbody of the collider that was hit. If the collider is not attached to a rigidbody then it is null.
Declaration
public Rigidbody rigidbody { get; }
Property Value
Type | Description |
---|---|
Rigidbody |
textureCoord
The uv texture coordinate at the collision location.
Declaration
public Vector2 textureCoord { get; }
Property Value
Type | Description |
---|---|
Vector2 |
textureCoord2
The secondary uv texture coordinate at the impact point.
Declaration
public Vector2 textureCoord2 { get; }
Property Value
Type | Description |
---|---|
Vector2 |
transform
The Transform of the rigidbody or collider that was hit.
Declaration
public Transform transform { get; }
Property Value
Type | Description |
---|---|
Transform |
triangleIndex
The index of the triangle that was hit.
Declaration
public int triangleIndex { get; }
Property Value
Type | Description |
---|---|
Int32 |