Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SetMatrix()

void Microsoft.Xna.Framework.BoundingFrustum.SetMatrix ( ref Matrix value)
inlineprivate

Definition at line 117 of file BoundingFrustum.cs.

118 {
119 matrix = value;
120 planes[2].Normal.X = 0f - value.M14 - value.M11;
121 planes[2].Normal.Y = 0f - value.M24 - value.M21;
122 planes[2].Normal.Z = 0f - value.M34 - value.M31;
123 planes[2].D = 0f - value.M44 - value.M41;
124 planes[3].Normal.X = 0f - value.M14 + value.M11;
125 planes[3].Normal.Y = 0f - value.M24 + value.M21;
126 planes[3].Normal.Z = 0f - value.M34 + value.M31;
127 planes[3].D = 0f - value.M44 + value.M41;
128 planes[4].Normal.X = 0f - value.M14 + value.M12;
129 planes[4].Normal.Y = 0f - value.M24 + value.M22;
130 planes[4].Normal.Z = 0f - value.M34 + value.M32;
131 planes[4].D = 0f - value.M44 + value.M42;
132 planes[5].Normal.X = 0f - value.M14 - value.M12;
133 planes[5].Normal.Y = 0f - value.M24 - value.M22;
134 planes[5].Normal.Z = 0f - value.M34 - value.M32;
135 planes[5].D = 0f - value.M44 - value.M42;
136 planes[0].Normal.X = 0f - value.M13;
137 planes[0].Normal.Y = 0f - value.M23;
138 planes[0].Normal.Z = 0f - value.M33;
139 planes[0].D = 0f - value.M43;
140 planes[1].Normal.X = 0f - value.M14 + value.M13;
141 planes[1].Normal.Y = 0f - value.M24 + value.M23;
142 planes[1].Normal.Z = 0f - value.M34 + value.M33;
143 planes[1].D = 0f - value.M44 + value.M43;
144 for (int i = 0; i < 6; i++)
145 {
146 float num = planes[i].Normal.Length();
147 planes[i].Normal /= num;
148 planes[i].D /= num;
149 }
150 Ray ray = ComputeIntersectionLine(ref planes[0], ref planes[2]);
151 ref Vector3 reference = ref cornerArray[0];
152 reference = ComputeIntersection(ref planes[4], ref ray);
153 ref Vector3 reference2 = ref cornerArray[3];
154 reference2 = ComputeIntersection(ref planes[5], ref ray);
155 ray = ComputeIntersectionLine(ref planes[3], ref planes[0]);
156 ref Vector3 reference3 = ref cornerArray[1];
157 reference3 = ComputeIntersection(ref planes[4], ref ray);
158 ref Vector3 reference4 = ref cornerArray[2];
159 reference4 = ComputeIntersection(ref planes[5], ref ray);
160 ray = ComputeIntersectionLine(ref planes[2], ref planes[1]);
161 ref Vector3 reference5 = ref cornerArray[4];
162 reference5 = ComputeIntersection(ref planes[4], ref ray);
163 ref Vector3 reference6 = ref cornerArray[7];
164 reference6 = ComputeIntersection(ref planes[5], ref ray);
165 ray = ComputeIntersectionLine(ref planes[1], ref planes[3]);
166 ref Vector3 reference7 = ref cornerArray[5];
167 reference7 = ComputeIntersection(ref planes[4], ref ray);
168 ref Vector3 reference8 = ref cornerArray[6];
169 reference8 = ComputeIntersection(ref planes[5], ref ray);
170 }
static Vector3 ComputeIntersection(ref Plane plane, ref Ray ray)
static Ray ComputeIntersectionLine(ref Plane p1, ref Plane p2)

References Microsoft.Xna.Framework.BoundingFrustum.ComputeIntersection(), Microsoft.Xna.Framework.BoundingFrustum.ComputeIntersectionLine(), Microsoft.Xna.Framework.BoundingFrustum.cornerArray, Microsoft.Xna.Framework.Plane.D, Microsoft.Xna.Framework.Vector3.Length(), Microsoft.Xna.Framework.BoundingFrustum.matrix, Microsoft.Xna.Framework.Plane.Normal, Microsoft.Xna.Framework.BoundingFrustum.planes, System.value, Microsoft.Xna.Framework.Vector3.X, Microsoft.Xna.Framework.Vector3.Y, and Microsoft.Xna.Framework.Vector3.Z.

Referenced by Microsoft.Xna.Framework.BoundingFrustum.BoundingFrustum().