|
static Vector2 | operator- (Vector2 v) |
|
static Vector2 | operator+ (Vector2 v1, Vector2 v2) |
|
static Vector2 | operator- (Vector2 v1, Vector2 v2) |
|
static Vector2 | operator- (Vector2 v1, float f) |
|
static Vector2 | operator* (Vector2 v1, Vector2 v2) |
|
static Vector2 | operator* (Vector2 v1, float s) |
|
static Vector2 | operator* (float s, Vector2 v1) |
|
static Vector2 | operator/ (Vector2 v1, Vector2 v2) |
|
static Vector2 | operator/ (Vector2 v1, float s) |
|
static Vector2 | operator+ (Vector2 v1, Vector3 v2) |
|
static Vector2 | operator+ (Vector3 v1, Vector2 v2) |
|
static bool | operator== (Vector2 v1, Vector2 v2) |
|
static bool | operator<= (Vector2 v1, Vector2 v2) |
|
static bool | operator>= (Vector2 v1, Vector2 v2) |
|
static bool | operator!= (Vector2 v1, Vector2 v2) |
|
static float | Dot (Vector2 v1, Vector2 v2) |
|
static Vector2 | Clamp (Vector2 v1, float min, float max) |
|
static Vector2 | Min (Vector2 v1, Vector2 v2) |
|
static Vector2 | Min (Vector2 v1, float f) |
|
static Vector2 | Max (Vector2 v1, Vector2 v2) |
|
static Vector2 | Max (Vector2 v1, float f) |
|
static Vector2 | Lerp (Vector2 v1, Vector2 v2, float median) |
|
static | operator Vector2 (Vector3 v) |
|
static | operator Vector3 (Vector2 v) |
|
static | operator PointF (Vector2 v) |
|
static | operator Vector2 (PointF v) |
|
static | operator Point (Vector2 v) |
|
static | operator Vector2 (Point v) |
|
static Vector2 | Truncate (Vector2 v) |
|
static bool | Contained (Vector2 point, Vector2 start, Vector2 end, float expansion) |
|
|
float | X [get, set] |
|
float | Y [get, set] |
|
◆ Vector2() [1/2]
BrawlLib.Internal.Vector2.Vector2 |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
|
inline |
25 {
28 }
float _y
Definition: Vector2.cs:17
float _x
Definition: Vector2.cs:11
◆ Vector2() [2/2]
BrawlLib.Internal.Vector2.Vector2 |
( |
float |
s | ) |
|
|
inline |
◆ Clamp() [1/2]
void BrawlLib.Internal.Vector2.Clamp |
( |
float |
min, |
|
|
float |
max |
|
) |
| |
|
inline |
128 {
131 }
static Vector2 Max(Vector2 v1, Vector2 v2)
Definition: Vector2.cs:162
static Vector2 Min(Vector2 v1, Vector2 v2)
Definition: Vector2.cs:133
◆ Clamp() [2/2]
static Vector2 BrawlLib.Internal.Vector2.Clamp |
( |
Vector2 |
v1, |
|
|
float |
min, |
|
|
float |
max |
|
) |
| |
|
inlinestatic |
122 {
123 v1.Clamp(min, max);
124 return v1;
125 }
◆ CompareTo()
int BrawlLib.Internal.Vector2.CompareTo |
( |
object |
obj | ) |
|
|
inline |
324 {
325 if (obj is Vector2)
326 {
327 Vector2 o = (Vector2) obj;
329 {
330 return 1;
331 }
332
334 {
335 return -1;
336 }
337
339 {
340 return 1;
341 }
342
344 {
345 return -1;
346 }
347
348 return 0;
349 }
350
351 return 1;
352 }
◆ Contained() [1/2]
static bool BrawlLib.Internal.Vector2.Contained |
( |
Vector2 |
point, |
|
|
Vector2 |
start, |
|
|
Vector2 |
end, |
|
|
float |
expansion |
|
) |
| |
|
inlinestatic |
253 {
254 float* sPtr = (float*) &point;
255 float* s1 = (float*) &start, s2 = (float*) &end;
256 float* temp;
257 for (int i = 0; i < 2; i++)
258 {
259 if (s1[i] > s2[i])
260 {
261 temp = s1;
262 s1 = s2;
263 s2 = temp;
264 }
265
266 if (sPtr[i] < s1[i] - expansion || sPtr[i] > s2[i] + expansion)
267 {
268 return false;
269 }
270 }
271
272 return true;
273 }
◆ Contained() [2/2]
bool BrawlLib.Internal.Vector2.Contained |
( |
Vector2 |
start, |
|
|
Vector2 |
end, |
|
|
float |
expansion |
|
) |
| |
|
inline |
248 {
249 return Contained(
this, start, end, expansion);
250 }
bool Contained(Vector2 start, Vector2 end, float expansion)
Definition: Vector2.cs:247
◆ DistanceTo()
float BrawlLib.Internal.Vector2.DistanceTo |
( |
Vector2 |
v | ) |
|
|
inline |
192 {
193 Vector2 v1 = this - v;
195 }
static float Dot(Vector2 v1, Vector2 v2)
Definition: Vector2.cs:111
◆ Dot() [1/2]
float BrawlLib.Internal.Vector2.Dot |
( |
Vector2 |
v | ) |
|
|
inline |
117 {
118 return _x * v._x +
_y * v._y;
119 }
◆ Dot() [2/2]
112 {
113 return v1._x * v2._x + v1._y * v2._y;
114 }
◆ Equals()
override bool BrawlLib.Internal.Vector2.Equals |
( |
object |
obj | ) |
|
|
inline |
314 {
315 if (obj is Vector2 vector2)
316 {
317 return this == vector2;
318 }
319
320 return false;
321 }
◆ GetHashCode()
override int BrawlLib.Internal.Vector2.GetHashCode |
( |
| ) |
|
|
inline |
305 {
306 fixed (Vector2* p = &this)
307 {
308 int* p2 = (int*) p;
309 return p2[0] ^ p2[1];
310 }
311 }
◆ Lerp()
198 {
199 return v1 * median + v2 * (1.0f - median);
200 }
◆ Max() [1/4]
void BrawlLib.Internal.Vector2.Max |
( |
float |
f | ) |
|
|
inline |
186 {
187 _x = Math.Max(
_x, f);
188 _y = Math.Max(
_y, f);
189 }
◆ Max() [2/4]
void BrawlLib.Internal.Vector2.Max |
( |
Vector2 |
v | ) |
|
|
inline |
173 {
175 {
177 }
178
180 {
182 }
183 }
◆ Max() [3/4]
168 {
169 return new Vector2(Math.Max(v1._x, f), Math.Max(v1._y, f));
170 }
◆ Max() [4/4]
163 {
164 return new Vector2(Math.Max(v1._x, v2._x), Math.Max(v1._y, v2._y));
165 }
◆ Min() [1/4]
void BrawlLib.Internal.Vector2.Min |
( |
float |
f | ) |
|
|
inline |
157 {
158 _x = Math.Min(
_x, f);
159 _y = Math.Min(
_y, f);
160 }
◆ Min() [2/4]
void BrawlLib.Internal.Vector2.Min |
( |
Vector2 |
v | ) |
|
|
inline |
144 {
146 {
148 }
149
151 {
153 }
154 }
◆ Min() [3/4]
139 {
140 return new Vector2(Math.Min(v1._x, f), Math.Min(v1._y, f));
141 }
◆ Min() [4/4]
134 {
135 return new Vector2(Math.Min(v1._x, v2._x), Math.Min(v1._y, v2._y));
136 }
◆ operator Point()
static BrawlLib.Internal.Vector2.operator Point |
( |
Vector2 |
v | ) |
|
|
inlineexplicitstatic |
223 {
225 return new Point((int) t._x, (int) t._y);
226 }
static Vector2 Truncate(Vector2 v)
Definition: Vector2.cs:233
◆ operator PointF()
static BrawlLib.Internal.Vector2.operator PointF |
( |
Vector2 |
v | ) |
|
|
inlineexplicitstatic |
213 {
214 return new PointF(v._x, v._y);
215 }
◆ operator Vector2() [1/3]
static BrawlLib.Internal.Vector2.operator Vector2 |
( |
Point |
v | ) |
|
|
inlineexplicitstatic |
229 {
230 return new Vector2(v.X, v.Y);
231 }
◆ operator Vector2() [2/3]
static BrawlLib.Internal.Vector2.operator Vector2 |
( |
PointF |
v | ) |
|
|
inlineexplicitstatic |
218 {
219 return new Vector2(v.X, v.Y);
220 }
◆ operator Vector2() [3/3]
203 {
204 return new Vector2(v._x, v._y);
205 }
◆ operator Vector3()
208 {
209 return new Vector3(v._x, v._y, 0.0f);
210 }
◆ operator!=()
static bool BrawlLib.Internal.Vector2.operator!= |
( |
Vector2 |
v1, |
|
|
Vector2 |
v2 |
|
) |
| |
|
inlinestatic |
107 {
108 return v1._x != v2._x || v1._y != v2._y;
109 }
◆ operator*() [1/3]
static Vector2 BrawlLib.Internal.Vector2.operator* |
( |
float |
s, |
|
|
Vector2 |
v1 |
|
) |
| |
|
inlinestatic |
67 {
68 return new Vector2(v1._x * s, v1._y * s);
69 }
◆ operator*() [2/3]
static Vector2 BrawlLib.Internal.Vector2.operator* |
( |
Vector2 |
v1, |
|
|
float |
s |
|
) |
| |
|
inlinestatic |
62 {
63 return new Vector2(v1._x * s, v1._y * s);
64 }
◆ operator*() [3/3]
57 {
58 return new Vector2(v1._x * v2._x, v1._y * v2._y);
59 }
◆ operator+() [1/3]
42 {
43 return new Vector2(v1._x + v2._x, v1._y + v2._y);
44 }
◆ operator+() [2/3]
82 {
83 return new Vector2(v1._x + v2._x, v1._y + v2._y);
84 }
◆ operator+() [3/3]
87 {
88 return new Vector2(v1._x + v2._x, v1._y + v2._y);
89 }
◆ operator-() [1/3]
37 {
38 return new Vector2(-v._x, -v._y);
39 }
◆ operator-() [2/3]
static Vector2 BrawlLib.Internal.Vector2.operator- |
( |
Vector2 |
v1, |
|
|
float |
f |
|
) |
| |
|
inlinestatic |
52 {
53 return new Vector2(v1._x - f, v1._y - f);
54 }
◆ operator-() [3/3]
47 {
48 return new Vector2(v1._x - v2._x, v1._y - v2._y);
49 }
◆ operator/() [1/2]
static Vector2 BrawlLib.Internal.Vector2.operator/ |
( |
Vector2 |
v1, |
|
|
float |
s |
|
) |
| |
|
inlinestatic |
77 {
78 return new Vector2(v1._x / s, v1._y / s);
79 }
◆ operator/() [2/2]
72 {
73 return new Vector2(v1._x / v2._x, v1._y / v2._y);
74 }
◆ operator<=()
static bool BrawlLib.Internal.Vector2.operator<= |
( |
Vector2 |
v1, |
|
|
Vector2 |
v2 |
|
) |
| |
|
inlinestatic |
97 {
98 return v1._x <= v2._x && v1._y <= v2._y;
99 }
◆ operator==()
static bool BrawlLib.Internal.Vector2.operator== |
( |
Vector2 |
v1, |
|
|
Vector2 |
v2 |
|
) |
| |
|
inlinestatic |
92 {
93 return v1._x == v2._x && v1._y == v2._y;
94 }
◆ operator>=()
static bool BrawlLib.Internal.Vector2.operator>= |
( |
Vector2 |
v1, |
|
|
Vector2 |
v2 |
|
) |
| |
|
inlinestatic |
102 {
103 return v1._x >= v2._x && v1._y >= v2._y;
104 }
◆ RemappedToRange()
Vector2 BrawlLib.Internal.Vector2.RemappedToRange |
( |
float |
min, |
|
|
float |
max |
|
) |
| |
|
inline |
300 {
301 return new Vector2(
_x.RemapToRange(min, max),
_y.RemapToRange(min, max));
302 }
◆ RemapToRange()
void BrawlLib.Internal.Vector2.RemapToRange |
( |
float |
min, |
|
|
float |
max |
|
) |
| |
|
inline |
294 {
295 _x =
_x.RemapToRange(min, max);
296 _y =
_y.RemapToRange(min, max);
297 }
◆ ToString()
override string BrawlLib.Internal.Vector2.ToString |
( |
| ) |
|
|
inline |
241 {
242 return CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator.Contains(",")
243 ? $"({_x} {_y})"
244 : $"({_x},{_y})";
245 }
◆ TrueDistance()
float BrawlLib.Internal.Vector2.TrueDistance |
( |
Vector2 |
p | ) |
|
|
inline |
276 {
277 float lenX = Math.Abs(p._x -
_x);
278 float lenY = Math.Abs(p._y -
_y);
279
280 if (lenX == 0.0f)
281 {
282 return lenY;
283 }
284
285 if (lenY == 0.0f)
286 {
287 return lenX;
288 }
289
290 return (float) (lenX / Math.Cos(Math.Atan(lenY / lenX)));
291 }
◆ Truncate()
234 {
235 return new Vector2(
236 v._x > 0.0f ? (float) Math.Floor(v._x) : (float) Math.Ceiling(v._x),
237 v._y > 0.0f ? (float) Math.Floor(v._y) : (float) Math.Ceiling(v._y));
238 }
◆ _x
float BrawlLib.Internal.Vector2._x |
◆ _y
float BrawlLib.Internal.Vector2._y |
float BrawlLib.Internal.Vector2.X |
|
getset |
float BrawlLib.Internal.Vector2.Y |
|
getset |
The documentation for this struct was generated from the following file:
- BrawlLib/Internal/Vector2.cs