コード例 #1
0
 /// <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;
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 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);
 }
コード例 #7
0
 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);
 }
コード例 #8
0
 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);
 }
コード例 #9
0
 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);
 }
コード例 #10
0
 /// <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));
 }