Ejemplo n.º 1
0
        public void MoveTo(Vector3D loc, bool shiftTarget)
        {
            Vector3D previousLocation = location;

            location.SetVector(loc);
            target.Add(loc.Sub(previousLocation));
        }
Ejemplo n.º 2
0
        public void DeriveVectors()
        {
            Matrix3D m = world_to_object.Clone();

            m.Invert();

            double d = target.Sub(location).Length();

            if (d <= 0)
            {
                d = 10;
            }

            location.SetVector(new Vector3D(0, 0, 0));
            location.TransformTranspose(m);

            direction.SetVector(new Vector3D(0, 0, -1));
            direction.RotateTranspose(m);
            direction.Normalize();

            up.SetVector(new Vector3D(0, 1, 0));
            up.RotateTranspose(m);
            up.Normalize();

            right.SetVector(new Vector3D(1, 0, 0));
            right.RotateTranspose(m);
            right.Normalize();

            target = location.clone().Add(direction.clone().Scale(d));
        }
Ejemplo n.º 3
0
        public void LookAtTargetPoint()
        {
            Vector3D lookDir = target.clone();

            lookDir.Sub(location).Normalize();

            if (lookDir.IsNotColinear(ref_up))
            {
                up.SetVector(ref_up);
            }
            else
            {
                up.SetVector(ref_right);
            }
            SetLookAt(location, lookDir, up);
        }
Ejemplo n.º 4
0
 public void MoveTo(Vector3D loc, bool shiftTarget) {
     Vector3D previousLocation = location;
     location.SetVector(loc);
     target.Add(loc.Sub(previousLocation));
 }