Photon Fusion 1.1.11

Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
Rotation Struct Reference

Wrapper class which unifies rotation handling of Quaternion, Euler or Z-only (used by 2D). Can store a Quaternion, Euler or Z-axis (for 2d rotation), and implicitly casts between those types. More...

Public Types

enum class  RotationTypes
 

Public Member Functions

 Rotation (float z)
 
 Rotation (Quaternion quaternion)
 
 Rotation (Vector3 euler)
 

Static Public Member Functions

static implicit operator float (Rotation rotation)
 
static implicit operator Quaternion (Rotation rotation)
 
static implicit operator Rotation (float z)
 
static implicit operator Rotation (Quaternion quaternion)
 
static implicit operator Rotation (Vector3 euler)
 
static implicit operator Vector3 (Rotation rotation)
 

Public Attributes

readonly Vector3 euler
 
readonly Quaternion quaternion
 
readonly RotationTypes Type
 Indicates of the stored rotation is a Quaternion or Euler type. More...
 
readonly float w
 
readonly float x
 
readonly float y
 
readonly float z
 

Properties

Vector3 AsEuler [get]
 Returns the rotation as a Euler. If original type was Quaternion, that is converted to a Euler. More...
 
float AsFloatZ [get]
 Returns the z-axis value of the rotation. If original type was Quaternion, first converts to a Euler then returns the z value of that Euler. More...
 
Quaternion AsQuaternion [get]
 Returns the rotation as a Quaternion. If original type was a Euler or Rotation Z-axis only, that is converted to a Quaternion. More...
 

Detailed Description

Wrapper class which unifies rotation handling of Quaternion, Euler or Z-only (used by 2D). Can store a Quaternion, Euler or Z-axis (for 2d rotation), and implicitly casts between those types.

Member Data Documentation

◆ Type

readonly RotationTypes Type

Indicates of the stored rotation is a Quaternion or Euler type.

Property Documentation

◆ AsEuler

Vector3 AsEuler
get

Returns the rotation as a Euler. If original type was Quaternion, that is converted to a Euler.

◆ AsFloatZ

float AsFloatZ
get

Returns the z-axis value of the rotation. If original type was Quaternion, first converts to a Euler then returns the z value of that Euler.

◆ AsQuaternion

Quaternion AsQuaternion
get

Returns the rotation as a Quaternion. If original type was a Euler or Rotation Z-axis only, that is converted to a Quaternion.