Empeld
Empeld plugin documentation.
pluginbase.Helpers.Coords.Rotation2 Struct Reference

Rotation XZ; In radians More...

Public Member Functions

 Rotation2 (float x, float z)
 
override string ToString ()
 

Static Public Member Functions

static Rotation2 FromDegrees (float x, float z)
 
static Rotation2 FromDirectionZUp (Vector3 dir)
 
static implicit operator Vector2 (Rotation2 rot)
 
static operator Rotation2 (Vector2 vec)
 
static Rotation2 operator+ (Rotation2 a, Rotation2 b)
 
static Rotation2 operator- (Rotation2 a, Rotation2 b)
 
static Rotation2 operator* (Rotation2 a, Rotation2 b)
 
static Rotation2 operator/ (Rotation2 a, Rotation2 b)
 
static Rotation2 operator* (Rotation2 a, float v)
 
static Rotation2 operator* (float v, Rotation2 b)
 

Public Attributes

float X
 
float Z
 

Static Public Attributes

static readonly Rotation2 Zero = new Rotation2(0f, 0f)
 

Properties

float DegreesX [get]
 
float DegreesZ [get]
 
Vector3 Vector [get]
 
Vector3 VectorZAxis [get]
 

Detailed Description

Rotation XZ; In radians

Constructor & Destructor Documentation

◆ Rotation2()

pluginbase.Helpers.Coords.Rotation2.Rotation2 ( float  x,
float  z 
)
17  {
18  X = x;
19  Z = z;
20  }
float X
Definition: Rotation2.cs:12
float Z
Definition: Rotation2.cs:12

Member Function Documentation

◆ FromDegrees()

static Rotation2 pluginbase.Helpers.Coords.Rotation2.FromDegrees ( float  x,
float  z 
)
static
23  {
24  return new Rotation2( MExt.DegreeToRadian(x), MExt.DegreeToRadian(z) );
25  }
static float DegreeToRadian(float degree)
Degrees to radian.
Definition: MathExtensions.cs:286
Math extensions
Definition: MathExtensions.cs:7
Rotation2(float x, float z)
Definition: Rotation2.cs:16

◆ FromDirectionZUp()

static Rotation2 pluginbase.Helpers.Coords.Rotation2.FromDirectionZUp ( Vector3  dir)
static
28  {
29  return new Rotation2(
30  (float)Math.Asin(dir.Z),
31  (float)Math.Atan2(dir.X, dir.Y)
32  );
33  }
Rotation2(float x, float z)
Definition: Rotation2.cs:16

◆ operator Rotation2()

static pluginbase.Helpers.Coords.Rotation2.operator Rotation2 ( Vector2  vec)
explicitstatic
87  {
88  return new Rotation2(vec.X, vec.Y);
89  }
Rotation2(float x, float z)
Definition: Rotation2.cs:16

◆ operator Vector2()

static implicit pluginbase.Helpers.Coords.Rotation2.operator Vector2 ( Rotation2  rot)
static
82  {
83  return new Vector2(rot.X, rot.Z);
84  }

◆ operator*() [1/3]

static Rotation2 pluginbase.Helpers.Coords.Rotation2.operator* ( Rotation2  a,
Rotation2  b 
)
static
104  {
105  return new Rotation2(a.X * b.X, a.Z * b.Z);
106  }
Rotation2(float x, float z)
Definition: Rotation2.cs:16

◆ operator*() [2/3]

static Rotation2 pluginbase.Helpers.Coords.Rotation2.operator* ( Rotation2  a,
float  v 
)
static
114  {
115  return new Rotation2(a.X*v, a.Z*v);
116  }
Rotation2(float x, float z)
Definition: Rotation2.cs:16

◆ operator*() [3/3]

static Rotation2 pluginbase.Helpers.Coords.Rotation2.operator* ( float  v,
Rotation2  b 
)
static
119  {
120  return new Rotation2(v*b.X, v*b.Z);
121  }
Rotation2(float x, float z)
Definition: Rotation2.cs:16

◆ operator+()

static Rotation2 pluginbase.Helpers.Coords.Rotation2.operator+ ( Rotation2  a,
Rotation2  b 
)
static
94  {
95  return new Rotation2(a.X + b.X, a.Z + b.Z);
96  }
Rotation2(float x, float z)
Definition: Rotation2.cs:16

◆ operator-()

static Rotation2 pluginbase.Helpers.Coords.Rotation2.operator- ( Rotation2  a,
Rotation2  b 
)
static
99  {
100  return new Rotation2(a.X - b.X, a.Z - b.Z);
101  }
Rotation2(float x, float z)
Definition: Rotation2.cs:16

◆ operator/()

static Rotation2 pluginbase.Helpers.Coords.Rotation2.operator/ ( Rotation2  a,
Rotation2  b 
)
static
109  {
110  return new Rotation2(a.X/b.X, a.Z/b.Z);
111  }
Rotation2(float x, float z)
Definition: Rotation2.cs:16

◆ ToString()

override string pluginbase.Helpers.Coords.Rotation2.ToString ( )
127  {
128  return string.Format("({0}, {1})", X, Z);
129  }
float X
Definition: Rotation2.cs:12
float Z
Definition: Rotation2.cs:12

Member Data Documentation

◆ X

float pluginbase.Helpers.Coords.Rotation2.X

◆ Z

float pluginbase.Helpers.Coords.Rotation2.Z

◆ Zero

readonly Rotation2 pluginbase.Helpers.Coords.Rotation2.Zero = new Rotation2(0f, 0f)
static

Property Documentation

◆ DegreesX

float pluginbase.Helpers.Coords.Rotation2.DegreesX
get

◆ DegreesZ

float pluginbase.Helpers.Coords.Rotation2.DegreesZ
get

◆ Vector

Vector3 pluginbase.Helpers.Coords.Rotation2.Vector
get

◆ VectorZAxis

Vector3 pluginbase.Helpers.Coords.Rotation2.VectorZAxis
get

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