Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
BoundingFrustum.cs
Go to the documentation of this file.
1 namespace SiliconStudio.Core.Mathematics
2 {
3  public struct BoundingFrustum
4  {
5  public Plane Plane1;
6  public Plane Plane2;
7  public Plane Plane3;
8  public Plane Plane4;
9  public Plane Plane5;
10  public Plane Plane6;
11 
12  public BoundingFrustum(ref Matrix matrix)
13  {
14  // Left
15  Plane1 = Plane.Normalize(new Plane(
16  matrix.M14 + matrix.M11,
17  matrix.M24 + matrix.M21,
18  matrix.M34 + matrix.M31,
19  matrix.M44 + matrix.M41));
20 
21  // Right
22  Plane2 = Plane.Normalize(new Plane(
23  matrix.M14 - matrix.M11,
24  matrix.M24 - matrix.M21,
25  matrix.M34 - matrix.M31,
26  matrix.M44 - matrix.M41));
27 
28  // Top
29  Plane3 = Plane.Normalize(new Plane(
30  matrix.M14 - matrix.M12,
31  matrix.M24 - matrix.M22,
32  matrix.M34 - matrix.M32,
33  matrix.M44 - matrix.M42));
34 
35  // Bottom
36  Plane4 = Plane.Normalize(new Plane(
37  matrix.M14 + matrix.M12,
38  matrix.M24 + matrix.M22,
39  matrix.M34 + matrix.M32,
40  matrix.M44 + matrix.M42));
41 
42  // Near
43  Plane5 = Plane.Normalize(new Plane(
44  matrix.M13,
45  matrix.M23,
46  matrix.M33,
47  matrix.M43));
48 
49  // Far
50  Plane6 = Plane.Normalize(new Plane(
51  matrix.M14 - matrix.M13,
52  matrix.M24 - matrix.M23,
53  matrix.M34 - matrix.M33,
54  matrix.M44 - matrix.M43));
55  }
56  }
57 }
Represents a plane in three dimensional space.
Definition: Plane.cs:42
Represents a 4x4 mathematical matrix.
Definition: Matrix.cs:47