@@ -965,9 +965,39 @@ public static Vector3d InverseRotate(Vector3d source, Vector3d position, FixedQu
965965 }
966966
967967 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
968- public static Vector3d operator + ( Vector3d v1 , Fixed64 add )
968+ public static Vector3d operator + ( Vector3d v1 , Fixed64 mag )
969969 {
970- return new Vector3d ( v1 . x + add , v1 . y + add , v1 . z + add ) ;
970+ return new Vector3d ( v1 . x + mag , v1 . y + mag , v1 . z + mag ) ;
971+ }
972+
973+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
974+ public static Vector3d operator + ( Fixed64 mag , Vector3d v1 )
975+ {
976+ return v1 + mag ;
977+ }
978+
979+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
980+ public static Vector3d operator + ( Vector3d v1 , ( int x , int y , int z ) v2 )
981+ {
982+ return new Vector3d ( v1 . x + v2 . x , v1 . y + v2 . y , v1 . z + v2 . z ) ;
983+ }
984+
985+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
986+ public static Vector3d operator + ( ( int x , int y , int z ) v2 , Vector3d v1 )
987+ {
988+ return v1 + v2 ;
989+ }
990+
991+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
992+ public static Vector3d operator + ( Vector3d v1 , ( float x , float y , float z ) v2 )
993+ {
994+ return new Vector3d ( v1 . x + v2 . x , v1 . y + v2 . y , v1 . z + v2 . z ) ;
995+ }
996+
997+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
998+ public static Vector3d operator + ( ( float x , float y , float z ) v1 , Vector3d v2 )
999+ {
1000+ return v2 + v1 ;
9711001 }
9721002
9731003 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
@@ -977,9 +1007,39 @@ public static Vector3d InverseRotate(Vector3d source, Vector3d position, FixedQu
9771007 }
9781008
9791009 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
980- public static Vector3d operator - ( Vector3d v1 , Fixed64 sub )
1010+ public static Vector3d operator - ( Vector3d v1 , Fixed64 mag )
1011+ {
1012+ return new Vector3d ( v1 . x - mag , v1 . y - mag , v1 . z - mag ) ;
1013+ }
1014+
1015+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
1016+ public static Vector3d operator - ( Fixed64 mag , Vector3d v1 )
1017+ {
1018+ return new Vector3d ( mag - v1 . x , mag - v1 . y , mag - v1 . z ) ;
1019+ }
1020+
1021+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
1022+ public static Vector3d operator - ( Vector3d v1 , ( int x , int y , int z ) v2 )
1023+ {
1024+ return new Vector3d ( v1 . x - v2 . x , v1 . y - v2 . y , v1 . z - v2 . z ) ;
1025+ }
1026+
1027+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
1028+ public static Vector3d operator - ( ( int x , int y , int z ) v1 , Vector3d v2 )
9811029 {
982- return new Vector3d ( v1 . x - sub , v1 . y - sub , v1 . z - sub ) ;
1030+ return new Vector3d ( v1 . x - v2 . x , v1 . y - v2 . y , v1 . z - v2 . z ) ;
1031+ }
1032+
1033+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
1034+ public static Vector3d operator - ( Vector3d v1 , ( float x , float y , float z ) v2 )
1035+ {
1036+ return new Vector3d ( v1 . x - v2 . x , v1 . y - v2 . y , v1 . z - v2 . z ) ;
1037+ }
1038+
1039+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
1040+ public static Vector3d operator - ( ( float x , float y , float z ) v1 , Vector3d v2 )
1041+ {
1042+ return new Vector3d ( v1 . x - v2 . x , v1 . y - v2 . y , v1 . z - v2 . z ) ;
9831043 }
9841044
9851045 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
@@ -1187,6 +1247,22 @@ public Vector2d ToVector2d()
11871247 return new Vector2d ( x , z ) ;
11881248 }
11891249
1250+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
1251+ public readonly void Deconstruct ( out float x , out float y , out float z )
1252+ {
1253+ x = this . x . ToPreciseFloat ( ) ;
1254+ y = this . y . ToPreciseFloat ( ) ;
1255+ z = this . z . ToPreciseFloat ( ) ;
1256+ }
1257+
1258+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
1259+ public readonly void Deconstruct ( out int x , out int y , out int z )
1260+ {
1261+ x = this . x . RoundToInt ( ) ;
1262+ y = this . y . RoundToInt ( ) ;
1263+ z = this . z . RoundToInt ( ) ;
1264+ }
1265+
11901266 /// <summary>
11911267 /// Converts each component of the vector from radians to degrees.
11921268 /// </summary>
@@ -1220,7 +1296,7 @@ public static Vector3d ToRadians(Vector3d degrees)
12201296 #region Equality and HashCode Overrides
12211297
12221298 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
1223- public override bool Equals ( object obj )
1299+ public override bool Equals ( object ? obj )
12241300 {
12251301 return obj is Vector3d other && Equals ( other ) ;
12261302 }
0 commit comments