Ejemplo n.º 1
0
        /// <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]));
        }
Ejemplo n.º 2
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 ();
 }
Ejemplo n.º 3
0
 public static Tuple3 TransformPosition (Tuple3 position, ReferenceFrame from, ReferenceFrame to)
 {
     CheckReferenceFrames (from, to);
     return to.PositionFromWorldSpace (from.PositionToWorldSpace (position.ToVector ())).ToTuple ();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Update the text.
 /// </summary>
 public override void Update()
 {
     renderer.enabled            = Visible;
     renderer.transform.position = ReferenceFrame.PositionToWorldSpace(position);
     renderer.transform.rotation = ReferenceFrame.RotationToWorldSpace(rotation);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Update the line
 /// </summary>
 public override void Update()
 {
     renderer.enabled = Visible;
     renderer.SetPosition(0, ReferenceFrame.PositionToWorldSpace(start));
     renderer.SetPosition(1, ReferenceFrame.PositionToWorldSpace(end));
 }