TrueSync
TSRaycastHit.cs
1 using System;
2 
3 namespace TrueSync
4 {
5 
9  public class TSRaycastHit
10  {
11  public TSRigidBody rigidbody { get; private set; }
12  public TSCollider collider { get; private set; }
13  public TSTransform transform { get; private set; }
14  public TSVector point { get; private set; }
15  public TSVector normal { get; private set; }
16  public FP distance { get; private set; }
17 
18  public TSRaycastHit(TSRigidBody rigidbody, TSCollider collider, TSTransform transform, TSVector normal, TSVector origin, TSVector direction, FP fraction)
19  {
20  this.rigidbody = rigidbody;
21  this.collider = collider;
22  this.transform = transform;
23  this.normal = normal;
24  this.point = origin + direction * fraction;
25  this.distance = fraction * direction.magnitude;
26  }
27  }
28 }
29 
Represents few information about a raycast hit.
Definition: TSRaycastHit.cs:9
Represents a physical 3D rigid body.
Definition: TSRigidBody.cs:11
FP magnitude
Gets the length of the vector.
Definition: TSVector.cs:124
A deterministic version of Unity's Transform component for 3D physics.
Definition: TSTransform.cs:9
A vector structure.
Definition: TSVector.cs:29
Abstract collider for 3D shapes.
Definition: TSCollider.cs:12