Ejemplo n.º 1
0
 /// <summary>
 /// Calculates the local direction of this line in <paramref name="parent"/> frame.
 /// </summary>
 /// <param name="parent">Parent object in which frame the local direction should be calculated.</param>
 /// <returns>Direction in given parent coordinate frame.</returns>
 public Vector3 CalculateLocalDirection(GameObject parent)
 {
     return(Vector3.Normalize(End.CalculateLocalPosition(parent) - Start.CalculateLocalPosition(parent)));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Convert to native agx.Edge. If <paramref name="parent"/> is given, the native
 /// edge will be given in the parents coordinate frame - otherwise world frame.
 /// </summary>
 /// <param name="parent">Parent in which this edge should be transformed to.</param>
 /// <returns>Native agx.Edge.</returns>
 public agx.Edge ToNativeEdge(GameObject parent)
 {
     return(new agx.Edge(Start.CalculateLocalPosition(parent).ToHandedVec3(),
                         End.CalculateLocalPosition(parent).ToHandedVec3()));
 }