Browse Source

Added helper function to translate a ray

Jorrit Rouwe 1 year ago
parent
commit
4880a3aead
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Jolt/Physics/Collision/RayCast.h

+ 6 - 0
Jolt/Physics/Collision/RayCast.h

@@ -27,6 +27,12 @@ struct RayCastT
 		return { ray_origin, ray_direction };
 	}
 
+	/// Translate ray using inTranslation
+	RayCastType					Translated(typename Vec::ArgType inTranslation) const
+	{
+		return { inTranslation + mOrigin, mDirection };
+	}
+
 	/// Get point with fraction inFraction on ray (0 = start of ray, 1 = end of ray)
 	inline Vec					GetPointOnRay(float inFraction) const
 	{