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(); } }
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); }
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(); } }