/// <summary> /// Update the polygon. /// </summary> public override void Update() { renderer.enabled = Visible; var numVertices = vertices.Count; for (int i = 0; i < numVertices; i++) { renderer.SetPosition(i, ReferenceFrame.PositionToWorldSpace(vertices [i])); } renderer.SetPosition(numVertices, ReferenceFrame.PositionToWorldSpace(vertices [0])); }
public static Tuple3 TransformVelocity (Tuple3 position, Tuple3 velocity, ReferenceFrame from, ReferenceFrame to) { CheckReferenceFrames (from, to); var worldPosition = from.PositionToWorldSpace (position.ToVector ()); var worldVelocity = from.VelocityToWorldSpace (position.ToVector (), velocity.ToVector ()); return to.VelocityFromWorldSpace (worldPosition, worldVelocity).ToTuple (); }
public static Tuple3 TransformPosition (Tuple3 position, ReferenceFrame from, ReferenceFrame to) { CheckReferenceFrames (from, to); return to.PositionFromWorldSpace (from.PositionToWorldSpace (position.ToVector ())).ToTuple (); }
/// <summary> /// Update the text. /// </summary> public override void Update() { renderer.enabled = Visible; renderer.transform.position = ReferenceFrame.PositionToWorldSpace(position); renderer.transform.rotation = ReferenceFrame.RotationToWorldSpace(rotation); }
/// <summary> /// Update the line /// </summary> public override void Update() { renderer.enabled = Visible; renderer.SetPosition(0, ReferenceFrame.PositionToWorldSpace(start)); renderer.SetPosition(1, ReferenceFrame.PositionToWorldSpace(end)); }