Photon Fusion 1.1.2

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 (Quaternion quaternion)
 
 Rotation (Vector3 euler)
 
 Rotation (float z)
 

Static Public Member Functions

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

Public Attributes

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

Properties

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

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.