예제 #1
0
 public void SetLookAt(Vector3D position, Vector3D direction, Vector3D up)
 {
     location = position;
     if (direction != null && up != null && direction.IsNotColinear(up))
     {
         direction.Normalize();
         up.Normalize();
         this.direction = direction.clone();
         this.up        = up.clone();
         CalcRU();
         DeriveMatrix();
     }
 }
예제 #2
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);
        }
예제 #3
0
        public void SetLookAtPoint(Vector3D position, Vector3D target, Vector3D up)
        {
            Vector3D direction = target.clone().Sub(position);

            if (direction != null && up != null && direction.IsNotColinear(up))
            {
                this.location = position;
                this.target   = target;
                direction.Normalize();
                up.Normalize();
                this.direction = direction.clone();
                this.up        = up.clone();
                CalcRU();
                DeriveMatrix();
            }
        }
예제 #4
0
 public void SetLookAt(Vector3D position, Vector3D direction, Vector3D up)
 {
     location = position;
     if (direction != null && up != null && direction.IsNotColinear(up))
     {
         direction.Normalize();
         up.Normalize();
         this.direction = direction.clone();
         this.up = up.clone();
         CalcRU();
         DeriveMatrix();
     }
 }