Photon Fusion 2.0.0

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.
 
bool Equals (Angle other)
 Checks equality with another Angle.
 
override bool Equals (object obj)
 Checks equality with an object.
 
override int GetHashCode ()
 Gets the hash code.
 
override string ToString ()
 String representation of the Angle.
 

Static Public Member Functions

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

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.
 

Detailed Description

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

Member Function Documentation

◆ 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.

◆ 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.