Rotation XZ; In radians
More...
|
| Rotation2d (double x, double z) |
|
Rotation2d | TurnTo (Rotation2d toRot) |
| Calculates the shortest turn-distance from this rotation to another one. (Not resulting rotation, but how much we have to rotate and which direction) eg. if this rotation is 0, and the other rotation is 7, it should compute the shortest turn to be 0.72 More...
|
|
Rotation2d | TurnToResult (Rotation2d toRot) |
| Calculates the resulting rotation of computing the shortest turn two a given rotation More...
|
|
void | Normalize () |
| Normalize this back into the 0-2pi range More...
|
|
Rotation2d | Normalized () |
| Normalize the current rotation in the 0-2pi range and return the result More...
|
|
override string | ToString () |
|
◆ Rotation2d()
pluginbase.Helpers.Coords.Rotation2d.Rotation2d |
( |
double |
x, |
|
|
double |
z |
|
) |
| |
double X
Definition: Rotation2d.cs:12
double Z
Definition: Rotation2d.cs:12
◆ FromDegrees()
static Rotation2d pluginbase.Helpers.Coords.Rotation2d.FromDegrees |
( |
double |
x, |
|
|
double |
z |
|
) |
| |
|
static |
static float DegreeToRadian(float degree)
Degrees to radian.
Definition: MathExtensions.cs:286
Math extensions
Definition: MathExtensions.cs:7
Rotation2d(double x, double z)
Definition: Rotation2d.cs:16
◆ FromDirectionZUp()
static Rotation2d pluginbase.Helpers.Coords.Rotation2d.FromDirectionZUp |
( |
Vector3d |
dir | ) |
|
|
static |
31 Math.Atan2(dir.X, dir.Y)
Rotation2d(double x, double z)
Definition: Rotation2d.cs:16
◆ Normalize()
void pluginbase.Helpers.Coords.Rotation2d.Normalize |
( |
| ) |
|
Normalize this back into the 0-2pi range
double X
Definition: Rotation2d.cs:12
Math extensions
Definition: MathExtensions.cs:7
static float FloatRemainder(float val, float div)
Get the remainder of two floats divided by each other i.e. 11/4, has a remainder of 3; or 4 / 1...
Definition: MathExtensions.cs:101
double Z
Definition: Rotation2d.cs:12
◆ Normalized()
Rotation2d pluginbase.Helpers.Coords.Rotation2d.Normalized |
( |
| ) |
|
Normalize the current rotation in the 0-2pi range and return the result
- Returns
- The normalized.
double X
Definition: Rotation2d.cs:12
double Z
Definition: Rotation2d.cs:12
Rotation2d(double x, double z)
Definition: Rotation2d.cs:16
◆ operator Rotation2()
149 return new Rotation2((
float)rot.X, (
float)rot.Z);
◆ operator Rotation2d() [1/2]
static pluginbase.Helpers.Coords.Rotation2d.operator Rotation2d |
( |
Vector2d |
vec | ) |
|
|
explicitstatic |
Rotation2d(double x, double z)
Definition: Rotation2d.cs:16
◆ operator Rotation2d() [2/2]
Rotation2d(double x, double z)
Definition: Rotation2d.cs:16
◆ operator Vector2d()
static implicit pluginbase.Helpers.Coords.Rotation2d.operator Vector2d |
( |
Rotation2d |
rot | ) |
|
|
static |
134 return new Vector2d(rot.X, rot.Z);
◆ operator*() [1/3]
Rotation2d(double x, double z)
Definition: Rotation2d.cs:16
◆ operator*() [2/3]
Rotation2d(double x, double z)
Definition: Rotation2d.cs:16
◆ operator*() [3/3]
Rotation2d(double x, double z)
Definition: Rotation2d.cs:16
◆ operator+()
Rotation2d(double x, double z)
Definition: Rotation2d.cs:16
◆ operator-()
Rotation2d(double x, double z)
Definition: Rotation2d.cs:16
◆ operator/()
Rotation2d(double x, double z)
Definition: Rotation2d.cs:16
◆ ToString()
override string pluginbase.Helpers.Coords.Rotation2d.ToString |
( |
| ) |
|
189 return string.Format(
"({0}, {1})",
X,
Z);
double X
Definition: Rotation2d.cs:12
double Z
Definition: Rotation2d.cs:12
◆ TurnTo()
Calculates the shortest turn-distance from this rotation to another one. (Not resulting rotation, but how much we have to rotate and which direction) eg. if this rotation is 0, and the other rotation is 7, it should compute the shortest turn to be 0.72
- Returns
- The turn.
- Parameters
-
55 const float ThreePi = 3f * MathHelper.Pi;
56 var diff = toRot.Normalized() - this.
Normalized();
Math extensions
Definition: MathExtensions.cs:7
static float FloatRemainder(float val, float div)
Get the remainder of two floats divided by each other i.e. 11/4, has a remainder of 3; or 4 / 1...
Definition: MathExtensions.cs:101
Rotation2d Normalized()
Normalize the current rotation in the 0-2pi range and return the result
Definition: Rotation2d.cs:121
Rotation2d(double x, double z)
Definition: Rotation2d.cs:16
◆ TurnToResult()
Calculates the resulting rotation of computing the shortest turn two a given rotation
- Returns
- The rotation.
- Parameters
-
69 return this + this.
TurnTo(toRot);
Rotation2d TurnTo(Rotation2d toRot)
Calculates the shortest turn-distance from this rotation to another one. (Not resulting rotation...
Definition: Rotation2d.cs:53
◆ UnitX
◆ UnitZ
double pluginbase.Helpers.Coords.Rotation2d.X |
double pluginbase.Helpers.Coords.Rotation2d.Z |
◆ Zero
◆ DegreesX
double pluginbase.Helpers.Coords.Rotation2d.DegreesX |
|
get |
◆ DegreesZ
double pluginbase.Helpers.Coords.Rotation2d.DegreesZ |
|
get |
◆ Vector
Vector3d pluginbase.Helpers.Coords.Rotation2d.Vector |
|
get |
◆ VectorZAxis
Vector3d pluginbase.Helpers.Coords.Rotation2d.VectorZAxis |
|
get |
The documentation for this struct was generated from the following file: