/// <summary> /// Constructs a polyhedron with the provided faces. /// </summary> /// <param name="faces">Array of faces (polygon)</param> public Polyhedron(Polygon[] faces) { _faces = new List<Polygon>(faces); _trajectory = Center; _trajectory.x += 1; _roll = Center; _roll.y += 1; }
public void YawAboutPoint(double yaw, Point point) { Vector trajectory = new Vector(Center, _trajectory); Vector vRoll = new Vector(Center, _roll); for (int i = 0; i < _faces.Count; ++i) { _faces[i].YawAboutPoint(yaw, point, trajectory, vRoll); } _trajectory = Rotation.Yaw(_trajectory, yaw, point, trajectory, vRoll); _roll = Rotation.Yaw(_trajectory, yaw, point, trajectory, vRoll); }
public void YawAboutPoint(double yaw, Point point, Vector trajectory, Vector vRoll) { for (int i = 0; i < _faces.Count; ++i) { _faces[i].YawAboutPoint(yaw, point, trajectory, vRoll); } _trajectory = Rotation.Yaw(_trajectory, yaw, point, trajectory, vRoll); _roll = Rotation.Yaw(_trajectory, yaw, point, trajectory, vRoll); }
public void RotateAboutPoint(double yaw, double pitch, double roll, Point point) { Vector trajectory = new Vector(Center, _trajectory); Vector vRoll = new Vector(Center, _roll); for (int i = 0; i < _faces.Count; ++i) { _faces[i].RotateAboutPoint(yaw, pitch, roll, Center, trajectory, vRoll); } _trajectory = Rotation.Rotate(_trajectory, yaw, pitch, roll, point, trajectory, vRoll); _roll = Rotation.Rotate(_trajectory, yaw, pitch, roll, point, trajectory, vRoll); }
public void RotateAboutCenter(double yaw, double pitch, double roll, Vector trajectory, Vector vRoll) { for (int i = 0; i < _faces.Count; ++i) { _faces[i].RotateAboutPoint(yaw, pitch, roll, Center, trajectory, vRoll); } _trajectory = Rotation.Rotate(_trajectory, yaw, pitch, roll, Center, trajectory, vRoll); _roll = Rotation.Rotate(_trajectory, yaw, pitch, roll, Center, trajectory, vRoll); }
public void RollAboutPoint(double roll, Point point, Vector trajectory, Vector vRoll) { for (int i = 0; i < _faces.Count; ++i) { _faces[i].RollAboutPoint(roll, point, trajectory, vRoll); } _trajectory = Rotation.Roll(_trajectory, roll, point, trajectory); _roll = Rotation.Roll(_trajectory, roll, point, trajectory); }
public void RollAboutCenter(double roll) { Vector trajectory = new Vector(_trajectory); Vector vRoll = new Vector(_roll); for (int i = 0; i < _faces.Count; ++i) { _faces[i].RollAboutPoint(roll, Center, trajectory, vRoll); } _trajectory = Rotation.Roll(_trajectory, roll, Center, trajectory); _roll = Rotation.Roll(_trajectory, roll, Center, trajectory); }
public void PitchAboutPoint(double pitch, Point point) { Vector trajectory = new Vector(Center, _trajectory); Vector vRoll = new Vector(Center, _roll); for (int i = 0; i < _faces.Count; ++i) { _faces[i].PitchAboutPoint(pitch, point, trajectory, vRoll); } _trajectory = Rotation.Pitch(_trajectory, pitch, point, vRoll); _roll = Rotation.Pitch(_trajectory, pitch, point, vRoll); }
public void PitchAboutCenter(double pitch, Vector trajectory, Vector vRoll) { for (int i = 0; i < _faces.Count; ++i) { _faces[i].PitchAboutPoint(pitch, Center, trajectory, vRoll); } _trajectory = Rotation.Pitch(_trajectory, pitch, Center, vRoll); _roll = Rotation.Pitch(_trajectory, pitch, Center, vRoll); }
/// <summary> /// Constructs a polhedron with the provided faces at the given location. /// </summary> /// <param name="faces">Array of faces (polygon)</param> /// <param name="location">Location (point)</param> public Polyhedron(Polygon[] faces, Point location) { _faces = new List<Polygon>(faces); Offset(new Vector(Center, location)); }