Struct SpatialRotation
The representation of a Rotation (Euler) in a spatial attachment context.
Inherited Members
Namespace: Unity.Cloud.Collaboration.Models.Abstractions
Assembly: Unity.Cloud.Collaboration.dll
Syntax
[DataContract(Name = "assets.Rotation")]
public struct SpatialRotation
Constructors
SpatialRotation(float, float, float)
Initializes a new instance of the SpatialRotation struct with the specified x, y, z, and w components.
Declaration
public SpatialRotation(float x = 0, float y = 0, float z = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | The x component of the rotation. |
| float | y | The y component of the rotation. |
| float | z | The z component of the rotation. |
Properties
X
The x component of the Rotation.
Declaration
[DataMember(Name = "x", EmitDefaultValue = true)]
public float X { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Y
The y component of the Rotation.
Declaration
[DataMember(Name = "y", EmitDefaultValue = true)]
public float Y { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Z
The z component of the Rotation.
Declaration
[DataMember(Name = "z", EmitDefaultValue = true)]
public float Z { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
Equals(object)
Validate obj is a SpatialRotation instance and have the same values as this instance.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | Compare the values with this instance. |
Returns
| Type | Description |
|---|---|
| bool | true if both instance have the same values; false otherwise. |
Overrides
Equals(SpatialRotation)
Returns whether two SpatialRotation objects are equals.
Declaration
public bool Equals(SpatialRotation other)
Parameters
| Type | Name | Description |
|---|---|---|
| SpatialRotation | other | The other SpatialRotation to compare with this instance. |
Returns
| Type | Description |
|---|---|
| bool | true if both instance have the same values; false otherwise. |
GetHashCode()
Compute a hash code for the object.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
Overrides
Remarks
- You should not assume that equal hash codes imply object equality.
- You should never persist or use a hash code outside the application domain in which it was created, because the same object may hash differently across application domains, processes, and platforms.
Operators
operator ==(SpatialRotation, SpatialRotation)
Get if two SpatialRotation represent the same.
Declaration
public static bool operator ==(SpatialRotation left, SpatialRotation right)
Parameters
| Type | Name | Description |
|---|---|---|
| SpatialRotation | left | Compare with this first instance. |
| SpatialRotation | right | Compare with this other instance. |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(SpatialRotation, SpatialRotation)
Get if two SpatialRotation does not represent the same.
Declaration
public static bool operator !=(SpatialRotation left, SpatialRotation right)
Parameters
| Type | Name | Description |
|---|---|---|
| SpatialRotation | left | Compare with this first instance. |
| SpatialRotation | right | Compare with this other instance. |
Returns
| Type | Description |
|---|---|
| bool | true if both instances are not the same; false if both instances are the same. |