|
static readonly Vector4 | UnitX = new Vector4(1, 0, 0, 0) |
|
static readonly Vector4 | UnitY = new Vector4(0, 1, 0, 0) |
|
static readonly Vector4 | UnitZ = new Vector4(0, 0, 1, 0) |
|
static readonly Vector4 | UnitW = new Vector4(0, 0, 0, 1) |
|
static readonly Vector4 | Zero = new Vector4(0, 0, 0, 0) |
|
static readonly Vector4 | One = new Vector4(1, 1, 1, 1) |
|
static readonly Vector4 | Identity = new Vector4(0, 0, 0, 1) |
|
◆ Vector4() [1/3]
BrawlLib.Internal.Vector4.Vector4 |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z, |
|
|
float |
w |
|
) |
| |
|
inline |
16 {
21 }
float _x
Definition: Vector4.cs:13
float _z
Definition: Vector4.cs:13
float _y
Definition: Vector4.cs:13
float _w
Definition: Vector4.cs:13
◆ Vector4() [2/3]
BrawlLib.Internal.Vector4.Vector4 |
( |
float |
s | ) |
|
|
inline |
◆ Vector4() [3/3]
BrawlLib.Internal.Vector4.Vector4 |
( |
SerializationInfo |
info, |
|
|
StreamingContext |
context |
|
) |
| |
|
inline |
32 {
33 _x = info.GetSingle(
"_x");
34 _z = info.GetSingle(
"_y");
35 _y = info.GetSingle(
"_z");
36 _w = info.GetSingle(
"_w");
37 }
◆ Dot() [1/2]
float BrawlLib.Internal.Vector4.Dot |
( |
| ) |
|
|
inline |
◆ Dot() [2/2]
float BrawlLib.Internal.Vector4.Dot |
( |
Vector4 |
v | ) |
|
|
inline |
108 {
109 return _x * v._x +
_y * v._y +
_z * v._z +
_w * v._w;
110 }
◆ Dot3() [1/2]
float BrawlLib.Internal.Vector4.Dot3 |
( |
| ) |
|
|
inline |
◆ Dot3() [2/2]
float BrawlLib.Internal.Vector4.Dot3 |
( |
Vector4 |
v | ) |
|
|
inline |
123 {
124 return _x * v._x +
_y * v._y +
_z * v._z;
125 }
◆ Equals()
override bool BrawlLib.Internal.Vector4.Equals |
( |
object |
obj | ) |
|
|
inline |
146 {
147 if (obj is Vector4 vector4)
148 {
149 return this == vector4;
150 }
151
152 return false;
153 }
◆ FromAxisAngle()
static Vector4 BrawlLib.Internal.Vector4.FromAxisAngle |
( |
Vector3 |
axis, |
|
|
float |
angle |
|
) |
| |
|
inlinestatic |
225 {
226 if (axis.Dot() == 0.0f)
227 {
229 }
230
232
233 angle *= 0.5f;
235 result._x = axis._x * (float) Math.Sin(angle);
236 result._y = axis._y * (float) Math.Sin(angle);
237 result._z = axis._z * (float) Math.Sin(angle);
238 result._w = (float) Math.Cos(angle);
239
241 }
Vector4(float x, float y, float z, float w)
Definition: Vector4.cs:15
static readonly Vector4 Identity
Definition: Vector4.cs:188
Vector4 Normalize()
Definition: Vector4.cs:112
◆ FromEulerAngles()
244 {
245 Vector3
246 vx = new Vector3(1, 0, 0),
247 vy = new Vector3(0, 1, 0),
248 vz = new Vector3(0, 0, 1);
250
254
255 return qx * qy * qz;
256 }
static Vector4 FromAxisAngle(Vector3 axis, float angle)
Definition: Vector4.cs:224
◆ GetHashCode()
override int BrawlLib.Internal.Vector4.GetHashCode |
( |
| ) |
|
|
inline |
156 {
157 fixed (Vector4* p = &this)
158 {
159 int* p2 = (int*) p;
160 return p2[0] ^ p2[1] ^ p2[2] ^ p2[3];
161 }
162 }
◆ GetObjectData()
void BrawlLib.Internal.Vector4.GetObjectData |
( |
SerializationInfo |
info, |
|
|
StreamingContext |
context |
|
) |
| |
|
inline |
40 {
41 info.AddValue(
"_x",
_x);
42 info.AddValue(
"_y",
_y);
43 info.AddValue(
"_z",
_z);
44 info.AddValue(
"_w",
_w);
45 }
◆ Length()
float BrawlLib.Internal.Vector4.Length |
( |
| ) |
|
|
inline |
98 {
99 return (
float) Math.Sqrt(
Dot());
100 }
float Dot()
Definition: Vector4.cs:102
◆ Length3()
float BrawlLib.Internal.Vector4.Length3 |
( |
| ) |
|
|
inline |
128 {
129 return (
float) Math.Sqrt(
Dot3());
130 }
float Dot3()
Definition: Vector4.cs:117
◆ Normalize()
Vector4 BrawlLib.Internal.Vector4.Normalize |
( |
| ) |
|
|
inline |
113 {
114 return this * (1.0f /
Length());
115 }
float Length()
Definition: Vector4.cs:97
◆ Normalize3()
Vector4 BrawlLib.Internal.Vector4.Normalize3 |
( |
| ) |
|
|
inline |
133 {
134 float scale = 1.0f /
Length3();
136 }
float Length3()
Definition: Vector4.cs:127
◆ operator Vector4()
49 {
50 return new Vector4(v._x, v._y, v._z, 1.0f);
51 }
◆ operator!=()
static bool BrawlLib.Internal.Vector4.operator!= |
( |
Vector4 |
v1, |
|
|
Vector4 |
v2 |
|
) |
| |
|
inlinestatic |
93 {
94 return v1._x != v2._x || v1._y != v2._y || v1._z != v2._z || v1._w != v2._w;
95 }
◆ operator*() [1/2]
static Vector4 BrawlLib.Internal.Vector4.operator* |
( |
Vector4 |
v, |
|
|
float |
f |
|
) |
| |
|
inlinestatic |
54 {
55 return new Vector4(v._x * f, v._y * f, v._z * f, v._w * f);
56 }
◆ operator*() [2/2]
74 {
76
77 Vector3 x1 = new Vector3(v1._x, v1._y, v1._z);
78 Vector3 x2 = new Vector3(v2._x, v2._y, v2._z);
79 float w1 = v1._w;
80 float w2 = v2._w;
81
82
83
84 return v;
85 }
◆ operator+()
69 {
70 return new Vector4(v1._x + v2._x, v1._y + v2._y, v1._z + v2._z, v1._w + v2._w);
71 }
◆ operator-()
64 {
65 return new Vector4(v1._x - v2._x, v1._y - v2._y, v1._z - v2._z, v1._w - v2._w);
66 }
◆ operator/()
static Vector4 BrawlLib.Internal.Vector4.operator/ |
( |
Vector4 |
v, |
|
|
float |
f |
|
) |
| |
|
inlinestatic |
59 {
60 return new Vector4(v._x / f, v._y / f, v._z / f, v._w / f);
61 }
◆ operator==()
static bool BrawlLib.Internal.Vector4.operator== |
( |
Vector4 |
v1, |
|
|
Vector4 |
v2 |
|
) |
| |
|
inlinestatic |
88 {
89 return v1._x == v2._x && v1._y == v2._y && v1._z == v2._z && v1._w == v2._w;
90 }
◆ ToAxisAngle() [1/2]
Vector4 BrawlLib.Internal.Vector4.ToAxisAngle |
( |
| ) |
|
|
inline |
198 {
200 if (q._w > 1.0f)
201 {
202 q.Normalize();
203 }
204
206 {
207 _w = 2.0f * (float) Math.Acos(q._w)
208 };
209 float den = (float) Math.Sqrt(1.0 - q._w * q._w);
210 if (den > 0.0001f)
211 {
212 result._x = q._x / den;
213 result._y = q._y / den;
214 result._z = q._z / den;
215 }
216 else
217 {
218 result._x = 1;
219 }
220
221 return result;
222 }
◆ ToAxisAngle() [2/2]
void BrawlLib.Internal.Vector4.ToAxisAngle |
( |
out Vector3 |
axis, |
|
|
out float |
angle |
|
) |
| |
|
inline |
191 {
193 axis = new Vector3(result._x, result._y, result._z);
194 angle = result._w;
195 }
Vector4 ToAxisAngle()
Definition: Vector4.cs:197
◆ ToEuler()
Vector3 BrawlLib.Internal.Vector4.ToEuler |
( |
| ) |
|
|
inline |
259 {
260 return new Vector3(
262 (
float) Math.Asin(2 * (
_x *
_z -
_w *
_y)),
264 }
◆ ToString()
override string BrawlLib.Internal.Vector4.ToString |
( |
| ) |
|
|
inline |
139 {
140 return CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator.Contains(",")
141 ? $"({_x} {_y} {_z} {_w})"
142 : $"({_x},{_y},{_z},{_w})";
143 }
◆ _w
float BrawlLib.Internal.Vector4._w |
◆ _x
float BrawlLib.Internal.Vector4._x |
◆ _y
float BrawlLib.Internal.Vector4._y |
◆ _z
float BrawlLib.Internal.Vector4._z |
◆ Identity
readonly Vector4 BrawlLib.Internal.Vector4.Identity = new Vector4(0, 0, 0, 1) |
|
static |
◆ One
readonly Vector4 BrawlLib.Internal.Vector4.One = new Vector4(1, 1, 1, 1) |
|
static |
◆ UnitW
readonly Vector4 BrawlLib.Internal.Vector4.UnitW = new Vector4(0, 0, 0, 1) |
|
static |
◆ UnitX
readonly Vector4 BrawlLib.Internal.Vector4.UnitX = new Vector4(1, 0, 0, 0) |
|
static |
◆ UnitY
readonly Vector4 BrawlLib.Internal.Vector4.UnitY = new Vector4(0, 1, 0, 0) |
|
static |
◆ UnitZ
readonly Vector4 BrawlLib.Internal.Vector4.UnitZ = new Vector4(0, 0, 1, 0) |
|
static |
◆ Zero
readonly Vector4 BrawlLib.Internal.Vector4.Zero = new Vector4(0, 0, 0, 0) |
|
static |
◆ Address
VoidPtr BrawlLib.Internal.Vector4.Address |
|
get |
268 {
269 get
270 {
271 fixed (void* p = &this)
272 {
273 return p;
274 }
275 }
276 }
◆ this[int index]
float BrawlLib.Internal.Vector4.this[int index] |
|
getset |
165 {
166 get
167 {
168 fixed (Vector4* p = &this)
169 {
170 return ((float*) p)[index];
171 }
172 }
173 set
174 {
175 fixed (Vector4* p = &this)
176 {
177 ((float*) p)[index] = value;
178 }
179 }
180 }
The documentation for this struct was generated from the following file:
- BrawlLib/Internal/Vector4.cs