Photon Fusion 2.0.4

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Angle Struct Reference

A Networked fusion type for degrees. This can be used with the NetworkedAttribute, in RPCs, or in NetworkInput structs. More...

Inherits INetworkStruct, and IEquatable< Angle >.

Public Member Functions

void Clamp (Angle min, Angle max)
 Clamps the current value to the supplied min-max range. More...
 
bool Equals (Angle other)
 Checks equality with another Angle. More...
 
override bool Equals (object obj)
 Checks equality with an object. More...
 
override int GetHashCode ()
 Gets the hash code. More...
 
override string ToString ()
 String representation of the Angle. More...
 

Static Public Member Functions

static Angle Clamp (Angle value, Angle min, Angle max)
 Returns a the value, clamped to the min-max range. More...
 
static Angle Lerp (Angle a, Angle b, float t)
 Lerps between two angle values. More...
 
static Angle Max (Angle a, Angle b)
 Returns the larger of two supplied angles. More...
 
static Angle Min (Angle a, Angle b)
 Returns the smaller of two supplied angles. More...
 
static implicit operator Angle (double value)
 Converts double to Angle. More...
 
static implicit operator Angle (float value)
 Converts float to Angle. More...
 
static implicit operator Angle (int value)
 Converts int to Angle. More...
 
static operator double (Angle value)
 Converts Angle to double. More...
 
static operator float (Angle value)
 Converts Angle to float. More...
 
static bool operator!= (Angle a, Angle b)
 Inequality operator for Angle struct. More...
 
static Angle operator+ (Angle a, Angle b)
 Addition operator for Angle struct. More...
 
static Angle operator- (Angle a, Angle b)
 Subtraction operator for Angle struct. More...
 
static bool operator< (Angle a, Angle b)
 Less than operator for Angle struct. More...
 
static bool operator<= (Angle a, Angle b)
 Less than or equal to operator for Angle struct. More...
 
static bool operator== (Angle a, Angle b)
 Equality operator for Angle struct. More...
 
static bool operator> (Angle a, Angle b)
 Greater than operator for Angle struct. More...
 
static bool operator>= (Angle a, Angle b)
 Greater than or equal to operator for Angle struct. More...
 

Public Attributes

int _value
 

Static Public Attributes

const int _360 = 360 * ACCURACY
 
const int ACCURACY = 10000
 
const int DECIMALS = 4
 
const int SIZE = 4
 Size of this struct in bytes. More...
 

Detailed Description

A Networked fusion type for degrees. This can be used with the NetworkedAttribute, in RPCs, or in NetworkInput structs.

Member Function Documentation

◆ Clamp() [1/2]

void Clamp ( Angle  min,
Angle  max 
)

Clamps the current value to the supplied min-max range.

◆ Clamp() [2/2]

static Angle Clamp ( Angle  value,
Angle  min,
Angle  max 
)
static

Returns a the value, clamped to the min-max range.

◆ Equals() [1/2]

bool Equals ( Angle  other)

Checks equality with another Angle.

Parameters
otherOther Angle.
Returns
Equality result.

◆ Equals() [2/2]

override bool Equals ( object  obj)

Checks equality with an object.

Parameters
objObject to compare.
Returns
Equality result.

◆ GetHashCode()

override int GetHashCode ( )

Gets the hash code.

Returns
Hash code.

◆ Lerp()

static Angle Lerp ( Angle  a,
Angle  b,
float  t 
)
static

Lerps between two angle values.

◆ Max()

static Angle Max ( Angle  a,
Angle  b 
)
static

Returns the larger of two supplied angles.

◆ Min()

static Angle Min ( Angle  a,
Angle  b 
)
static

Returns the smaller of two supplied angles.

◆ operator Angle() [1/3]

static implicit operator Angle ( double  value)
static

Converts double to Angle.

Parameters
valueDouble value.
Returns
Angle instance with the value of the double.

◆ operator Angle() [2/3]

static implicit operator Angle ( float  value)
static

Converts float to Angle.

Parameters
valueFloat value.
Returns
Angle instance with the value of the float.

◆ operator Angle() [3/3]

static implicit operator Angle ( int  value)
static

Converts int to Angle.

Parameters
valueInteger value.
Returns
Angle instance with the value of the integer.

◆ operator double()

static operator double ( Angle  value)
explicitstatic

Converts Angle to double.

Parameters
valueAngle instance.
Returns
Double representation of the Angle.

◆ operator float()

static operator float ( Angle  value)
explicitstatic

Converts Angle to float.

Parameters
valueAngle instance.
Returns
Float representation of the Angle.

◆ operator!=()

static bool operator!= ( Angle  a,
Angle  b 
)
static

Inequality operator for Angle struct.

Parameters
aFirst Angle instance.
bSecond Angle instance.
Returns
True if the value of the first Angle instance is not equal to the value of the second Angle instance, otherwise false.

◆ operator+()

static Angle operator+ ( Angle  a,
Angle  b 
)
static

Addition operator for Angle struct.

Parameters
aFirst Angle instance.
bSecond Angle instance.
Returns
A new Angle instance that is the sum of the first and second Angle instances, wrapped around at 360 degrees if necessary.

◆ operator-()

static Angle operator- ( Angle  a,
Angle  b 
)
static

Subtraction operator for Angle struct.

Parameters
aFirst Angle instance.
bSecond Angle instance.
Returns
A new Angle instance that is the difference of the first and second Angle instances, wrapped around at 360 degrees if necessary.

◆ operator<()

static bool operator< ( Angle  a,
Angle  b 
)
static

Less than operator for Angle struct.

Parameters
aFirst Angle instance.
bSecond Angle instance.
Returns
True if the value of the first Angle instance is less than the value of the second Angle instance, otherwise false.

◆ operator<=()

static bool operator<= ( Angle  a,
Angle  b 
)
static

Less than or equal to operator for Angle struct.

Parameters
aFirst Angle instance.
bSecond Angle instance.
Returns
True if the value of the first Angle instance is less than or equal to the value of the second Angle instance, otherwise false.

◆ operator==()

static bool operator== ( Angle  a,
Angle  b 
)
static

Equality operator for Angle struct.

Parameters
aFirst Angle instance.
bSecond Angle instance.
Returns
True if the value of the first Angle instance is equal to the value of the second Angle instance, otherwise false.

◆ operator>()

static bool operator> ( Angle  a,
Angle  b 
)
static

Greater than operator for Angle struct.

Parameters
aFirst Angle instance.
bSecond Angle instance.
Returns
True if the value of the first Angle instance is greater than the value of the second Angle instance, otherwise false.

◆ operator>=()

static bool operator>= ( Angle  a,
Angle  b 
)
static

Greater than or equal to operator for Angle struct.

Parameters
aFirst Angle instance.
bSecond Angle instance.
Returns
True if the value of the first Angle instance is greater than or equal to the value of the second Angle instance, otherwise false.

◆ ToString()

override string ToString ( )

String representation of the Angle.

Member Data Documentation

◆ SIZE

const int SIZE = 4
static

Size of this struct in bytes.