13 public Plane(
float x,
float y,
float z,
float d)
36 Vector3 vector = point2 - point1;
37 Vector3 vector2 = point3 - point1;
41 return new Plane(vector3, d);
43 float num = point2.X - point1.
X;
44 float num2 = point2.Y - point1.
Y;
45 float num3 = point2.Z - point1.
Z;
46 float num4 = point3.X - point1.
X;
47 float num5 = point3.Y - point1.
Y;
48 float num6 = point3.Z - point1.
Z;
49 float num7 = num2 * num6 - num3 * num5;
50 float num8 = num3 * num4 - num * num6;
51 float num9 = num * num5 - num2 * num4;
52 float x = num7 * num7 + num8 * num8 + num9 * num9;
54 Vector3 normal =
new Vector3(num7 * num10, num8 * num10, num9 * num10);
55 return new Plane(normal, 0f - (normal.
X * point1.
X + normal.
Y * point1.
Y + normal.
Z * point1.
Z));
61 return plane.Normal.X * value.X + plane.Normal.Y * value.Y + plane.Normal.Z * value.Z + plane.D *
value.W;
71 return plane.Normal.X * value.X + plane.Normal.Y * value.Y + plane.Normal.Z * value.Z + plane.
D;
81 return plane.Normal.X * value.X + plane.Normal.Y * value.Y + plane.Normal.Z *
value.Z;
89 float num =
value.Normal.LengthSquared();
90 if (
MathF.
Abs(num - 1f) < 1.1920929E-07f)
97 float num3 = value.Normal.X * value.Normal.X + value.Normal.Y * value.Normal.Y + value.Normal.Z *
value.Normal.Z;
98 if (
MathF.
Abs(num3 - 1f) < 1.1920929E-07f)
114 return new Plane(x * result.M11 + y * result.M12 + z * result.M13 + d * result.M14, x * result.M21 + y * result.M22 + z * result.M23 + d * result.M24, x * result.M31 + y * result.M32 + z * result.M33 + d * result.M34, x * result.M41 + y * result.M42 + z * result.M43 + d * result.M44);
120 float num = rotation.X + rotation.
X;
121 float num2 = rotation.Y + rotation.
Y;
122 float num3 = rotation.Z + rotation.
Z;
123 float num4 = rotation.W * num;
124 float num5 = rotation.W * num2;
125 float num6 = rotation.W * num3;
126 float num7 = rotation.X * num;
127 float num8 = rotation.X * num2;
128 float num9 = rotation.X * num3;
129 float num10 = rotation.Y * num2;
130 float num11 = rotation.Y * num3;
131 float num12 = rotation.Z * num3;
132 float num13 = 1f - num10 - num12;
133 float num14 = num8 - num6;
134 float num15 = num9 + num5;
135 float num16 = num8 + num6;
136 float num17 = 1f - num7 - num12;
137 float num18 = num11 - num4;
138 float num19 = num9 - num5;
139 float num20 = num11 + num4;
140 float num21 = 1f - num7 - num10;
144 return new Plane(x * num13 + y * num14 + z * num15, x * num16 + y * num17 + z * num18, x * num19 + y * num20 + z * num21, plane.
D);
152 return value1.D == value2.
D;
160 return !(value1 == value2);
164 public override readonly
bool Equals([NotNullWhen(
true)]
object?
obj)
198 return $
"{{Normal:{Normal} D:{D}}}";
static float Abs(float x)
static float Sqrt(float x)
static bool IsHardwareAccelerated
static bool Invert(Matrix4x4 matrix, out Matrix4x4 result)
static float DotNormal(Plane plane, Vector3 value)
static bool operator!=(Plane value1, Plane value2)
static float DotCoordinate(Plane plane, Vector3 value)
static Plane CreateFromVertices(Vector3 point1, Vector3 point2, Vector3 point3)
override readonly bool Equals([NotNullWhen(true)] object? obj)
static Plane Normalize(Plane value)
Plane(float x, float y, float z, float d)
static Plane Transform(Plane plane, Quaternion rotation)
override readonly int GetHashCode()
static float Dot(Plane plane, Vector4 value)
static bool operator==(Plane value1, Plane value2)
readonly bool Equals(Plane other)
override readonly string ToString()
static Plane Transform(Plane plane, Matrix4x4 matrix)
Plane(Vector3 normal, float d)
static Vector3 Cross(Vector3 vector1, Vector3 vector2)
override readonly int GetHashCode()
static float Dot(Vector3 vector1, Vector3 vector2)
override readonly bool Equals([NotNullWhen(true)] object? obj)
static Vector3 Normalize(Vector3 value)