public Transform3D Clone() { Transform3D c = new Transform3D(); c.world_to_object = world_to_object.Clone(); c.coord_system = coord_system; c.ref_dir = ref_dir.clone(); c.ref_up = ref_up.clone(); c.ref_right = ref_right.clone(); c.location = location.clone(); c.direction = direction.clone(); c.up = up.clone(); c.target = target.clone(); //TODO: Derive Vectors return(c); }
public void pan(double x, double y) { Vector3D dx = right.clone().Scale(x); Vector3D dy = up.clone().Scale(y); location.Add(dx); location.Add(dy); target.Add(dx); target.Add(dy); }
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 Transform3D() { world_to_object = new Matrix3D(); coord_system = COORD_Z_UP; ref_dir = Z_DIR; ref_up = Z_UP; ref_right = Z_RIGHT; location = new Vector3D(); direction = ref_dir.clone(); up = ref_up.clone(); right = ref_right.clone(); target = new Vector3D(); }
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(); } }
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(); } }
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 Transform3D() { world_to_object = new Matrix3D(); coord_system = COORD_Z_UP; ref_dir = Z_DIR; ref_up = Z_UP; ref_right = Z_RIGHT; location = new Vector3D(); direction = ref_dir.clone(); up = ref_up.clone(); right = ref_right.clone(); target = new Vector3D(); }