- // Compute circular measure of the rotation angle.
- this.rotation_angle_box += ((Math.PI) / 180) * (this.rot_per_cycle);
- // Compute rotation matrix rows. (rotation around z - axis)
- Vector3d row1 = new Vector3d((float)(Math.Cos(rotation_angle_box)), (float)(-(Math.Sin(rotation_angle_box))), 0);
- Vector3d row2 = new Vector3d((float)(Math.Sin(rotation_angle_box)), (float)(Math.Cos(rotation_angle_box)), 0);
- Vector3d row3 = new Vector3d(0, 0, 1);
- this.hitboxNewBody = new List<Vector3d>();
- for (int i = 0; i < this.hitboxCurrentBody.Count; i++)
- {
- this.hitboxNewBody.Add(new Vector3d()
- {
- X = ((row1.X * (this.hitboxCurrentBody[i].X)) + (row1.Y * (this.hitboxCurrentBody[i].Y)) + (row1.Z * (this.hitboxCurrentBody[i].Z))),
- Y = ((row2.X * (this.hitboxCurrentBody[i].X)) + (row2.Y * (this.hitboxCurrentBody[i].Y)) + (row2.Z * (this.hitboxCurrentBody[i].Z))),
- Z = ((row3.X * (this.hitboxCurrentBody[i].X)) + (row3.Y * (this.hitboxCurrentBody[i].Y)) + (row3.Z * (this.hitboxCurrentBody[i].Z)))
- });
- }