Empeld
Empeld plugin documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
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

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

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:232
Math extensions
Definition: MathExtensions.cs:7
Rotation2(float x, float z)
Definition: Rotation2.cs:16
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
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
static implicit pluginbase.Helpers.Coords.Rotation2.operator Vector2 ( Rotation2  rot)
static
82  {
83  return new Vector2(rot.X, rot.Z);
84  }
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
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
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
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
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
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
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

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

Property Documentation

float pluginbase.Helpers.Coords.Rotation2.DegreesX
get
float pluginbase.Helpers.Coords.Rotation2.DegreesZ
get
Vector3 pluginbase.Helpers.Coords.Rotation2.Vector
get
Vector3 pluginbase.Helpers.Coords.Rotation2.VectorZAxis
get

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