BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
BrawlLib.Internal.Vector3 Struct Reference
Inheritance diagram for BrawlLib.Internal.Vector3:

Public Member Functions

 Vector3 (float x, float y, float z)
 
 Vector3 (float s)
 
 Vector3 (SerializationInfo info, StreamingContext context)
 
void GetObjectData (SerializationInfo info, StreamingContext context)
 
void Add (Vector3 *v)
 
void Add (float v)
 
void Sub (Vector3 *v)
 
void Sub (float v)
 
void Multiply (Vector3 *v)
 
void Multiply (float v)
 
float Dot (Vector3 v)
 
float Dot (Vector3 *v)
 
float Dot ()
 
void Clamp (float min, float max)
 
void Min (Vector3 v)
 
void Min (Vector3 *v)
 
void Min (float f)
 
void Max (Vector3 v)
 
void Max (Vector3 *v)
 
void Max (float f)
 
float DistanceTo (Vector3 v)
 
Vector3 Cross (Vector3 v)
 
Vector3 Round (int places)
 
override string ToString ()
 
bool Contained (Vector3 start, Vector3 end, float expansion)
 
float TrueDistance (Vector3 p)
 
float TrueDistance ()
 
Vector3 Normalize ()
 
Vector3 Normalize (Vector3 origin)
 
Vector3 GetAngles ()
 
Vector3 GetAngles (Vector3 origin)
 
Vector3 LookatAngles ()
 
Vector3 LookatAngles (Vector3 origin)
 
float AngleX ()
 
float AngleY ()
 
float AngleZ ()
 
override int GetHashCode ()
 
override bool Equals (object obj)
 
void Lerp (Vector3 dest, float percent)
 
Vector3 Lerped (Vector3 dest, float percent)
 
void RemapToRange (float min, float max)
 
Vector3 RemappedToRange (float min, float max)
 
int CompareTo (object obj)
 
Vector4 ToQuat ()
 
bool IsInTriangle (Vector3 triPt1, Vector3 triPt2, Vector3 triPt3)
 

Static Public Member Functions

static operator Vector3 (Vector4 v)
 
static operator Vector3 (OpenTK.Vector3 v)
 
static operator OpenTK.Vector3 (Vector3 v)
 
static operator Vector3 (Color c)
 
static operator Color (Vector3 v)
 
static Vector3 operator- (Vector3 v)
 
static Vector3 operator+ (Vector3 v1, Vector3 v2)
 
static Vector3 operator+ (Vector3 v1, float f)
 
static Vector3 operator+ (float f, Vector3 v1)
 
static Vector3 operator- (Vector3 v1, Vector3 v2)
 
static Vector3 operator- (Vector3 v1, float f)
 
static Vector3 operator* (Vector3 v1, Vector3 v2)
 
static Vector3 operator* (Vector3 v1, float s)
 
static Vector3 operator* (float s, Vector3 v1)
 
static Vector3 operator/ (Vector3 v1, Vector3 v2)
 
static Vector3 operator/ (Vector3 v1, float s)
 
static Vector3 operator/ (float s, Vector3 v1)
 
static bool operator== (Vector3 v1, Vector3 v2)
 
static bool operator!= (Vector3 v1, Vector3 v2)
 
static bool operator< (Vector3 v1, Vector3 v2)
 
static bool operator> (Vector3 v1, Vector3 v2)
 
static bool operator<= (Vector3 v1, Vector3 v2)
 
static bool operator>= (Vector3 v1, Vector3 v2)
 
static float * Mult (float *v1, float *v2)
 
static float * Mult (float *v1, float v2)
 
static float * Add (float *v1, float *v2)
 
static float * Add (float *v1, float v2)
 
static float * Sub (float *v1, float *v2)
 
static float * Sub (float *v1, float v2)
 
static float Dot (Vector3 v1, Vector3 v2)
 
static Vector3 Clamp (Vector3 v1, float min, float max)
 
static Vector3 Min (Vector3 v1, Vector3 v2)
 
static Vector3 Min (Vector3 v1, float f)
 
static Vector3 Max (Vector3 v1, Vector3 v2)
 
static Vector3 Max (Vector3 v1, Vector3 *v2)
 
static Vector3 Max (Vector3 v1, float f)
 
static Vector3 Lerp (Vector3 v1, Vector3 v2, float median)
 
static Vector3 Floor (Vector3 v)
 
static Vector3 Cross (Vector3 v1, Vector3 v2)
 
static Vector3 Truncate (Vector3 v)
 
static bool Contained (Vector3 point, Vector3 start, Vector3 end, float expansion)
 
static Vector3 IntersectZ (Vector3 ray1, Vector3 ray2, float z)
 

Public Attributes

float _x
 
float _y
 
float _z
 

Static Public Attributes

static readonly Vector3 UnitX = new Vector3(1.0f, 0.0f, 0.0f)
 
static readonly Vector3 UnitY = new Vector3(0.0f, 1.0f, 0.0f)
 
static readonly Vector3 UnitZ = new Vector3(0.0f, 0.0f, 1.0f)
 
static readonly Vector3 Zero = new Vector3(0.0f)
 
static readonly Vector3 One = new Vector3(1.0f)
 

Properties

float this[int index] [get, set]
 
VoidPtr Address [get]
 

Constructor & Destructor Documentation

◆ Vector3() [1/3]

BrawlLib.Internal.Vector3.Vector3 ( float  x,
float  y,
float  z 
)
inline
44 {
45 _x = x;
46 _y = y;
47 _z = z;
48 }
float _y
Definition: Vector3.cs:41
float _z
Definition: Vector3.cs:41
float _x
Definition: Vector3.cs:41

◆ Vector3() [2/3]

BrawlLib.Internal.Vector3.Vector3 ( float  s)
inline
51 {
52 _x = s;
53 _y = s;
54 _z = s;
55 }

◆ Vector3() [3/3]

BrawlLib.Internal.Vector3.Vector3 ( SerializationInfo  info,
StreamingContext  context 
)
inline
58 {
59 _x = info.GetSingle("_x");
60 _y = info.GetSingle("_y");
61 _z = info.GetSingle("_z");
62 }

Member Function Documentation

◆ Add() [1/4]

static float * BrawlLib.Internal.Vector3.Add ( float *  v1,
float *  v2 
)
inlinestatic
253 {
254 v1[0] = v1[0] + v2[0];
255 v1[1] = v1[1] + v2[1];
256 v1[2] = v1[2] + v2[2];
257 return v1;
258 }

◆ Add() [2/4]

static float * BrawlLib.Internal.Vector3.Add ( float *  v1,
float  v2 
)
inlinestatic
261 {
262 v1[0] = v1[0] + v2;
263 v1[1] = v1[1] + v2;
264 v1[2] = v1[2] + v2;
265 return v1;
266 }

◆ Add() [3/4]

void BrawlLib.Internal.Vector3.Add ( float  v)
inline
202 {
203 _x += v;
204 _y += v;
205 _z += v;
206 }

◆ Add() [4/4]

void BrawlLib.Internal.Vector3.Add ( Vector3 v)
inline
195 {
196 _x += v->_x;
197 _y += v->_y;
198 _z += v->_z;
199 }

◆ AngleX()

float BrawlLib.Internal.Vector3.AngleX ( )
inline
539 {
540 return (float) Math.Atan2(_y, -_z);
541 }

◆ AngleY()

float BrawlLib.Internal.Vector3.AngleY ( )
inline
544 {
545 return (float) Math.Atan2(-_z, _x);
546 }

◆ AngleZ()

float BrawlLib.Internal.Vector3.AngleZ ( )
inline
549 {
550 return (float) Math.Atan2(_y, _x);
551 }

◆ Clamp() [1/2]

void BrawlLib.Internal.Vector3.Clamp ( float  min,
float  max 
)
inline
311 {
312 Max(min);
313 Min(max);
314 }
static Vector3 Max(Vector3 v1, Vector3 v2)
Definition: Vector3.cs:358
static Vector3 Min(Vector3 v1, Vector3 v2)
Definition: Vector3.cs:316

◆ Clamp() [2/2]

static Vector3 BrawlLib.Internal.Vector3.Clamp ( Vector3  v1,
float  min,
float  max 
)
inlinestatic
305 {
306 v1.Clamp(min, max);
307 return v1;
308 }

◆ CompareTo()

int BrawlLib.Internal.Vector3.CompareTo ( object  obj)
inline
616 {
617 if (obj is Vector3)
618 {
619 Vector3 o = (Vector3) obj;
620 if (_x > o._x)
621 {
622 return 1;
623 }
624
625 if (_x < o._x)
626 {
627 return -1;
628 }
629
630 if (_y > o._y)
631 {
632 return 1;
633 }
634
635 if (_y < o._y)
636 {
637 return -1;
638 }
639
640 if (_z > o._z)
641 {
642 return 1;
643 }
644
645 if (_z < o._z)
646 {
647 return -1;
648 }
649
650 return 0;
651 }
652
653 return 1;
654 }

◆ Contained() [1/2]

static bool BrawlLib.Internal.Vector3.Contained ( Vector3  point,
Vector3  start,
Vector3  end,
float  expansion 
)
inlinestatic
464 {
465 float* sPtr = (float*) &point;
466 float* s1 = (float*) &start, s2 = (float*) &end;
467 float* temp;
468 for (int i = 0; i < 3; i++)
469 {
470 if (s1[i] > s2[i])
471 {
472 temp = s1;
473 s1 = s2;
474 s2 = temp;
475 }
476
477 if (sPtr[i] < s1[i] - expansion || sPtr[i] > s2[i] + expansion)
478 {
479 return false;
480 }
481 }
482
483 return true;
484 }

◆ Contained() [2/2]

bool BrawlLib.Internal.Vector3.Contained ( Vector3  start,
Vector3  end,
float  expansion 
)
inline
459 {
460 return Contained(this, start, end, expansion);
461 }
bool Contained(Vector3 start, Vector3 end, float expansion)
Definition: Vector3.cs:458

◆ Cross() [1/2]

Vector3 BrawlLib.Internal.Vector3.Cross ( Vector3  v)
inline
427 {
428 return new Vector3(_y * v._z - v._y * _z, _z * v._x - v._z * _x, _x * v._y - v._x * _y);
429 }

◆ Cross() [2/2]

static Vector3 BrawlLib.Internal.Vector3.Cross ( Vector3  v1,
Vector3  v2 
)
inlinestatic
432 {
433 return new Vector3(v1._y * v2._z - v2._y * v1._z, v1._z * v2._x - v2._z * v1._x,
434 v1._x * v2._y - v2._x * v1._y);
435 }

◆ DistanceTo()

float BrawlLib.Internal.Vector3.DistanceTo ( Vector3  v)
inline
406 {
407 return (v - this).Dot();
408 }

◆ Dot() [1/4]

float BrawlLib.Internal.Vector3.Dot ( )
inline
300 {
301 return _x * _x + _y * _y + _z * _z;
302 }

◆ Dot() [2/4]

float BrawlLib.Internal.Vector3.Dot ( Vector3 v)
inline
295 {
296 return _x * v->_x + _y * v->_y + _z * v->_z;
297 }

◆ Dot() [3/4]

float BrawlLib.Internal.Vector3.Dot ( Vector3  v)
inline
290 {
291 return _x * v._x + _y * v._y + _z * v._z;
292 }

◆ Dot() [4/4]

static float BrawlLib.Internal.Vector3.Dot ( Vector3  v1,
Vector3  v2 
)
inlinestatic
285 {
286 return v1._x * v2._x + v1._y * v2._y + v1._z * v2._z;
287 }

◆ Equals()

override bool BrawlLib.Internal.Vector3.Equals ( object  obj)
inline
563 {
564 if (obj is Vector3 vector3)
565 {
566 return this == vector3;
567 }
568
569 return false;
570 }

◆ Floor()

static Vector3 BrawlLib.Internal.Vector3.Floor ( Vector3  v)
inlinestatic
416 {
417 return new Vector3((int) v._x, (int) v._y, (int) v._z);
418 }

◆ GetAngles() [1/2]

Vector3 BrawlLib.Internal.Vector3.GetAngles ( )
inline
518 {
519 return new Vector3(AngleX(), AngleY(), AngleZ());
520 }
float AngleX()
Definition: Vector3.cs:538
float AngleZ()
Definition: Vector3.cs:548
float AngleY()
Definition: Vector3.cs:543

◆ GetAngles() [2/2]

Vector3 BrawlLib.Internal.Vector3.GetAngles ( Vector3  origin)
inline
523 {
524 return (this - origin).GetAngles();
525 }

◆ GetHashCode()

override int BrawlLib.Internal.Vector3.GetHashCode ( )
inline
554 {
555 fixed (Vector3* p = &this)
556 {
557 int* p2 = (int*) p;
558 return p2[0] ^ p2[1] ^ p2[2];
559 }
560 }

◆ GetObjectData()

void BrawlLib.Internal.Vector3.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)
inline
65 {
66 info.AddValue("_x", _x);
67 info.AddValue("_y", _y);
68 info.AddValue("_z", _z);
69 }

◆ IntersectZ()

static Vector3 BrawlLib.Internal.Vector3.IntersectZ ( Vector3  ray1,
Vector3  ray2,
float  z 
)
inlinestatic
487 {
488 float a = ray2._z - ray1._z;
489
490 float tanX = (ray1._y - ray2._y) / a;
491 float tanY = (ray2._x - ray1._x) / a;
492
493 a = z - ray1._z;
494 return new Vector3(tanY * a + ray1._x, -tanX * a + ray1._y, z);
495 }

◆ IsInTriangle()

bool BrawlLib.Internal.Vector3.IsInTriangle ( Vector3  triPt1,
Vector3  triPt2,
Vector3  triPt3 
)
inline
680 {
681 Vector3 v0 = triPt2 - triPt1;
682 Vector3 v1 = triPt3 - triPt1;
683 Vector3 v2 = this - triPt1;
684
685 float dot00 = v0.Dot(v0);
686 float dot01 = v0.Dot(v1);
687 float dot02 = v0.Dot(v2);
688 float dot11 = v1.Dot(v1);
689 float dot12 = v1.Dot(v2);
690
691 //Get barycentric coordinates
692 float d = dot00 * dot11 - dot01 * dot01;
693 float u = (dot11 * dot02 - dot01 * dot12) / d;
694 float v = (dot00 * dot12 - dot01 * dot02) / d;
695
696 return u >= 0 && v >= 0 && u + v < 1;
697 }

◆ Lerp() [1/2]

void BrawlLib.Internal.Vector3.Lerp ( Vector3  dest,
float  percent 
)
inline
591 {
592 this += (dest - this) * percent;
593 }

◆ Lerp() [2/2]

static Vector3 BrawlLib.Internal.Vector3.Lerp ( Vector3  v1,
Vector3  v2,
float  median 
)
inlinestatic
411 {
412 return v1 * (1.0f - median) + v2 * median;
413 }

◆ Lerped()

Vector3 BrawlLib.Internal.Vector3.Lerped ( Vector3  dest,
float  percent 
)
inline
596 {
597 return this + (dest - this) * percent;
598 }

◆ LookatAngles() [1/2]

Vector3 BrawlLib.Internal.Vector3.LookatAngles ( )
inline
528 {
529 return new Vector3((float) Math.Atan2(_y, Math.Sqrt(_x * _x + _z * _z)), (float) Math.Atan2(-_x, -_z),
530 0.0f);
531 }

◆ LookatAngles() [2/2]

Vector3 BrawlLib.Internal.Vector3.LookatAngles ( Vector3  origin)
inline
534 {
535 return (this - origin).LookatAngles();
536 }

◆ Max() [1/6]

void BrawlLib.Internal.Vector3.Max ( float  f)
inline
399 {
400 _x = Math.Max(_x, f);
401 _y = Math.Max(_y, f);
402 _z = Math.Max(_z, f);
403 }

◆ Max() [2/6]

void BrawlLib.Internal.Vector3.Max ( Vector3 v)
inline
381 {
382 if (v->_x > _x)
383 {
384 _x = v->_x;
385 }
386
387 if (v->_y > _y)
388 {
389 _y = v->_y;
390 }
391
392 if (v->_z > _z)
393 {
394 _z = v->_z;
395 }
396 }

◆ Max() [3/6]

void BrawlLib.Internal.Vector3.Max ( Vector3  v)
inline
374 {
375 _x = Math.Max(_x, v._x);
376 _y = Math.Max(_y, v._y);
377 _z = Math.Max(_z, v._z);
378 }

◆ Max() [4/6]

static Vector3 BrawlLib.Internal.Vector3.Max ( Vector3  v1,
float  f 
)
inlinestatic
369 {
370 return new Vector3(Math.Max(v1._x, f), Math.Max(v1._y, f), Math.Max(v1._z, f));
371 }

◆ Max() [5/6]

static Vector3 BrawlLib.Internal.Vector3.Max ( Vector3  v1,
Vector3 v2 
)
inlinestatic
364 {
365 return new Vector3(Math.Max(v1._x, v2->_x), Math.Max(v1._y, v2->_y), Math.Max(v1._z, v2->_z));
366 }

◆ Max() [6/6]

static Vector3 BrawlLib.Internal.Vector3.Max ( Vector3  v1,
Vector3  v2 
)
inlinestatic
359 {
360 return new Vector3(Math.Max(v1._x, v2._x), Math.Max(v1._y, v2._y), Math.Max(v1._z, v2._z));
361 }

◆ Min() [1/5]

void BrawlLib.Internal.Vector3.Min ( float  f)
inline
352 {
353 _x = Math.Min(_x, f);
354 _y = Math.Min(_y, f);
355 _z = Math.Min(_z, f);
356 }

◆ Min() [2/5]

void BrawlLib.Internal.Vector3.Min ( Vector3 v)
inline
334 {
335 if (v->_x < _x)
336 {
337 _x = v->_x;
338 }
339
340 if (v->_y < _y)
341 {
342 _y = v->_y;
343 }
344
345 if (v->_z < _z)
346 {
347 _z = v->_z;
348 }
349 }

◆ Min() [3/5]

void BrawlLib.Internal.Vector3.Min ( Vector3  v)
inline
327 {
328 _x = Math.Min(_x, v._x);
329 _y = Math.Min(_y, v._y);
330 _z = Math.Min(_z, v._z);
331 }

◆ Min() [4/5]

static Vector3 BrawlLib.Internal.Vector3.Min ( Vector3  v1,
float  f 
)
inlinestatic
322 {
323 return new Vector3(Math.Min(v1._x, f), Math.Min(v1._y, f), Math.Min(v1._z, f));
324 }

◆ Min() [5/5]

static Vector3 BrawlLib.Internal.Vector3.Min ( Vector3  v1,
Vector3  v2 
)
inlinestatic
317 {
318 return new Vector3(Math.Min(v1._x, v2._x), Math.Min(v1._y, v2._y), Math.Min(v1._z, v2._z));
319 }

◆ Mult() [1/2]

static float * BrawlLib.Internal.Vector3.Mult ( float *  v1,
float *  v2 
)
inlinestatic
237 {
238 v1[0] = v1[0] * v2[0];
239 v1[1] = v1[1] * v2[1];
240 v1[2] = v1[2] * v2[2];
241 return v1;
242 }

◆ Mult() [2/2]

static float * BrawlLib.Internal.Vector3.Mult ( float *  v1,
float  v2 
)
inlinestatic
245 {
246 v1[0] = v1[0] * v2;
247 v1[1] = v1[1] * v2;
248 v1[2] = v1[2] * v2;
249 return v1;
250 }

◆ Multiply() [1/2]

void BrawlLib.Internal.Vector3.Multiply ( float  v)
inline
230 {
231 _x *= v;
232 _y *= v;
233 _z *= v;
234 }

◆ Multiply() [2/2]

void BrawlLib.Internal.Vector3.Multiply ( Vector3 v)
inline
223 {
224 _x *= v->_x;
225 _y *= v->_y;
226 _z *= v->_z;
227 }

◆ Normalize() [1/2]

Vector3 BrawlLib.Internal.Vector3.Normalize ( )
inline
508 {
509 return this / TrueDistance();
510 }
float TrueDistance()
Definition: Vector3.cs:502

◆ Normalize() [2/2]

Vector3 BrawlLib.Internal.Vector3.Normalize ( Vector3  origin)
inline
513 {
514 return (this - origin).Normalize();
515 }

◆ operator Color()

static BrawlLib.Internal.Vector3.operator Color ( Vector3  v)
inlineexplicitstatic
99 {
100 return Color.FromArgb((int) (v._x / _colorFactor), (int) (v._y / _colorFactor),
101 (int) (v._z / _colorFactor));
102 }

◆ operator OpenTK.Vector3()

static BrawlLib.Internal.Vector3.operator OpenTK.Vector3 ( Vector3  v)
inlineexplicitstatic
87 {
88 return new OpenTK.Vector3(v._x, v._y, v._z);
89 }

◆ operator Vector3() [1/3]

static BrawlLib.Internal.Vector3.operator Vector3 ( Color  c)
inlineexplicitstatic
94 {
95 return new Vector3(c.R * _colorFactor, c.G * _colorFactor, c.B * _colorFactor);
96 }

◆ operator Vector3() [2/3]

static BrawlLib.Internal.Vector3.operator Vector3 ( OpenTK.Vector3  v)
inlineexplicitstatic
82 {
83 return new Vector3(v.X, v.Y, v.Z);
84 }

◆ operator Vector3() [3/3]

static BrawlLib.Internal.Vector3.operator Vector3 ( Vector4  v)
inlineexplicitstatic
72 {
73 if (v._w == 0.0f)
74 {
75 return new Vector3(v._x, v._y, v._z);
76 }
77
78 return new Vector3(v._x / v._w, v._y / v._w, v._z / v._w);
79 }

◆ operator!=()

static bool BrawlLib.Internal.Vector3.operator!= ( Vector3  v1,
Vector3  v2 
)
inlinestatic
170 {
171 return v1._x != v2._x || v1._y != v2._y || v1._z != v2._z;
172 }

◆ operator*() [1/3]

static Vector3 BrawlLib.Internal.Vector3.operator* ( float  s,
Vector3  v1 
)
inlinestatic
145 {
146 return new Vector3(v1._x * s, v1._y * s, v1._z * s);
147 }

◆ operator*() [2/3]

static Vector3 BrawlLib.Internal.Vector3.operator* ( Vector3  v1,
float  s 
)
inlinestatic
140 {
141 return new Vector3(v1._x * s, v1._y * s, v1._z * s);
142 }

◆ operator*() [3/3]

static Vector3 BrawlLib.Internal.Vector3.operator* ( Vector3  v1,
Vector3  v2 
)
inlinestatic
135 {
136 return new Vector3(v1._x * v2._x, v1._y * v2._y, v1._z * v2._z);
137 }

◆ operator+() [1/3]

static Vector3 BrawlLib.Internal.Vector3.operator+ ( float  f,
Vector3  v1 
)
inlinestatic
120 {
121 return new Vector3(v1._x + f, v1._y + f, v1._z + f);
122 }

◆ operator+() [2/3]

static Vector3 BrawlLib.Internal.Vector3.operator+ ( Vector3  v1,
float  f 
)
inlinestatic
115 {
116 return new Vector3(v1._x + f, v1._y + f, v1._z + f);
117 }

◆ operator+() [3/3]

static Vector3 BrawlLib.Internal.Vector3.operator+ ( Vector3  v1,
Vector3  v2 
)
inlinestatic
110 {
111 return new Vector3(v1._x + v2._x, v1._y + v2._y, v1._z + v2._z);
112 }

◆ operator-() [1/3]

static Vector3 BrawlLib.Internal.Vector3.operator- ( Vector3  v)
inlinestatic
105 {
106 return new Vector3(-v._x, -v._y, -v._z);
107 }

◆ operator-() [2/3]

static Vector3 BrawlLib.Internal.Vector3.operator- ( Vector3  v1,
float  f 
)
inlinestatic
130 {
131 return new Vector3(v1._x - f, v1._y - f, v1._z - f);
132 }

◆ operator-() [3/3]

static Vector3 BrawlLib.Internal.Vector3.operator- ( Vector3  v1,
Vector3  v2 
)
inlinestatic
125 {
126 return new Vector3(v1._x - v2._x, v1._y - v2._y, v1._z - v2._z);
127 }

◆ operator/() [1/3]

static Vector3 BrawlLib.Internal.Vector3.operator/ ( float  s,
Vector3  v1 
)
inlinestatic
160 {
161 return new Vector3(s / v1._x, s / v1._y, s / v1._z);
162 }

◆ operator/() [2/3]

static Vector3 BrawlLib.Internal.Vector3.operator/ ( Vector3  v1,
float  s 
)
inlinestatic
155 {
156 return new Vector3(v1._x / s, v1._y / s, v1._z / s);
157 }

◆ operator/() [3/3]

static Vector3 BrawlLib.Internal.Vector3.operator/ ( Vector3  v1,
Vector3  v2 
)
inlinestatic
150 {
151 return new Vector3(v1._x / v2._x, v1._y / v2._y, v1._z / v2._z);
152 }

◆ operator<()

static bool BrawlLib.Internal.Vector3.operator< ( Vector3  v1,
Vector3  v2 
)
inlinestatic
175 {
176 return v1._x < v2._x && v1._y < v2._y && v1._z < v2._z;
177 }

◆ operator<=()

static bool BrawlLib.Internal.Vector3.operator<= ( Vector3  v1,
Vector3  v2 
)
inlinestatic
185 {
186 return v1._x <= v2._x && v1._y <= v2._y && v1._z <= v2._z;
187 }

◆ operator==()

static bool BrawlLib.Internal.Vector3.operator== ( Vector3  v1,
Vector3  v2 
)
inlinestatic
165 {
166 return v1._x == v2._x && v1._y == v2._y && v1._z == v2._z;
167 }

◆ operator>()

static bool BrawlLib.Internal.Vector3.operator> ( Vector3  v1,
Vector3  v2 
)
inlinestatic
180 {
181 return v1._x > v2._x && v1._y > v2._y && v1._z > v2._z;
182 }

◆ operator>=()

static bool BrawlLib.Internal.Vector3.operator>= ( Vector3  v1,
Vector3  v2 
)
inlinestatic
190 {
191 return v1._x >= v2._x && v1._y >= v2._y && v1._z >= v2._z;
192 }

◆ RemappedToRange()

Vector3 BrawlLib.Internal.Vector3.RemappedToRange ( float  min,
float  max 
)
inline
608 {
609 return new Vector3(
610 _x.RemapToRange(min, max),
611 _y.RemapToRange(min, max),
612 _z.RemapToRange(min, max));
613 }

◆ RemapToRange()

void BrawlLib.Internal.Vector3.RemapToRange ( float  min,
float  max 
)
inline
601 {
602 _x = _x.RemapToRange(min, max);
603 _y = _y.RemapToRange(min, max);
604 _z = _z.RemapToRange(min, max);
605 }

◆ Round()

Vector3 BrawlLib.Internal.Vector3.Round ( int  places)
inline
438 {
439 return new Vector3((float) Math.Round(_x, places), (float) Math.Round(_y, places),
440 (float) Math.Round(_z, places));
441 }

◆ Sub() [1/4]

static float * BrawlLib.Internal.Vector3.Sub ( float *  v1,
float *  v2 
)
inlinestatic
269 {
270 v1[0] = v1[0] - v2[0];
271 v1[1] = v1[1] - v2[1];
272 v1[2] = v1[2] - v2[2];
273 return v1;
274 }

◆ Sub() [2/4]

static float * BrawlLib.Internal.Vector3.Sub ( float *  v1,
float  v2 
)
inlinestatic
277 {
278 v1[0] = v1[0] - v2;
279 v1[1] = v1[1] - v2;
280 v1[2] = v1[2] - v2;
281 return v1;
282 }

◆ Sub() [3/4]

void BrawlLib.Internal.Vector3.Sub ( float  v)
inline
216 {
217 _x -= v;
218 _y -= v;
219 _z -= v;
220 }

◆ Sub() [4/4]

void BrawlLib.Internal.Vector3.Sub ( Vector3 v)
inline
209 {
210 _x -= v->_x;
211 _y -= v->_y;
212 _z -= v->_z;
213 }

◆ ToQuat()

Vector4 BrawlLib.Internal.Vector3.ToQuat ( )
inline
657 {
658 Vector4 q = new Vector4();
659
660 double
661 xRadian = _x / 2.0f,
662 yRadian = _y / 2.0f,
663 zRadian = _z / 2.0f,
664 sinX = Math.Sin(xRadian),
665 cosX = Math.Cos(xRadian),
666 sinY = Math.Sin(yRadian),
667 cosY = Math.Cos(yRadian),
668 sinZ = Math.Sin(zRadian),
669 cosZ = Math.Cos(zRadian);
670
671 q._x = (float) (cosX * cosY * cosZ + sinX * sinY * sinZ);
672 q._y = (float) (sinX * cosY * cosZ - cosX * sinY * sinZ);
673 q._z = (float) (cosX * sinY * cosZ + sinX * cosY * sinZ);
674 q._w = (float) (cosX * cosY * sinZ - sinX * sinY * cosZ);
675
676 return q;
677 }

◆ ToString()

override string BrawlLib.Internal.Vector3.ToString ( )
inline
452 {
453 return CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator.Contains(",")
454 ? $"({_x} {_y} {_z})"
455 : $"({_x},{_y},{_z})";
456 }

◆ TrueDistance() [1/2]

float BrawlLib.Internal.Vector3.TrueDistance ( )
inline
503 {
504 return (float) Math.Sqrt(Dot());
505 }
float Dot()
Definition: Vector3.cs:299

◆ TrueDistance() [2/2]

float BrawlLib.Internal.Vector3.TrueDistance ( Vector3  p)
inline
498 {
499 return (float) Math.Sqrt((p - this).Dot());
500 }

◆ Truncate()

static Vector3 BrawlLib.Internal.Vector3.Truncate ( Vector3  v)
inlinestatic
444 {
445 return new Vector3(
446 v._x > 0.0f ? (float) Math.Floor(v._x) : (float) Math.Ceiling(v._x),
447 v._y > 0.0f ? (float) Math.Floor(v._y) : (float) Math.Ceiling(v._z),
448 v._z > 0.0f ? (float) Math.Floor(v._z) : (float) Math.Ceiling(v._z));
449 }

Member Data Documentation

◆ _x

float BrawlLib.Internal.Vector3._x

◆ _y

float BrawlLib.Internal.Vector3._y

◆ _z

float BrawlLib.Internal.Vector3._z

◆ One

readonly Vector3 BrawlLib.Internal.Vector3.One = new Vector3(1.0f)
static

◆ UnitX

readonly Vector3 BrawlLib.Internal.Vector3.UnitX = new Vector3(1.0f, 0.0f, 0.0f)
static

◆ UnitY

readonly Vector3 BrawlLib.Internal.Vector3.UnitY = new Vector3(0.0f, 1.0f, 0.0f)
static

◆ UnitZ

readonly Vector3 BrawlLib.Internal.Vector3.UnitZ = new Vector3(0.0f, 0.0f, 1.0f)
static

◆ Zero

readonly Vector3 BrawlLib.Internal.Vector3.Zero = new Vector3(0.0f)
static

Property Documentation

◆ Address

VoidPtr BrawlLib.Internal.Vector3.Address
get
701 {
702 get
703 {
704 fixed (void* p = &this)
705 {
706 return p;
707 }
708 }
709 }

◆ this[int index]

float BrawlLib.Internal.Vector3.this[int index]
getset
573 {
574 get
575 {
576 fixed (Vector3* p = &this)
577 {
578 return ((float*) p)[index];
579 }
580 }
581 set
582 {
583 fixed (Vector3* p = &this)
584 {
585 ((float*) p)[index] = value;
586 }
587 }
588 }

The documentation for this struct was generated from the following file: