Struct SpatialPosition
The representation of a Position (Vector3) in a spatial attachment context.
Inherited Members
Namespace: Unity.Cloud.Collaboration.Models.Abstractions
Assembly: Unity.Cloud.Collaboration.dll
Syntax
[DataContract(Name = "assets.Position")]
public struct SpatialPosition
Constructors
SpatialPosition(float, float, float)
Initializes a new instance of the SpatialPosition struct with the specified x, y, and z components.
Declaration
public SpatialPosition(float x = 0, float y = 0, float z = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | The x component of the position. |
| float | y | The y component of the position. |
| float | z | The z component of the position. |
Properties
X
The x component of the Position.
Declaration
[DataMember(Name = "x", EmitDefaultValue = true)]
public float X { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Y
The y component of the Position.
Declaration
[DataMember(Name = "y", EmitDefaultValue = true)]
public float Y { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Z
The z component of the Position.
Declaration
[DataMember(Name = "z", EmitDefaultValue = true)]
public float Z { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
Equals(object)
Validate obj is a SpatialPosition 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(SpatialPosition)
Returns whether two SpatialPosition objects are equals.
Declaration
public bool Equals(SpatialPosition other)
Parameters
| Type | Name | Description |
|---|---|---|
| SpatialPosition | other | The other SpatialPosition 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 ==(SpatialPosition, SpatialPosition)
Get if two SpatialPosition represent the same.
Declaration
public static bool operator ==(SpatialPosition left, SpatialPosition right)
Parameters
| Type | Name | Description |
|---|---|---|
| SpatialPosition | left | Compare with this first instance. |
| SpatialPosition | right | Compare with this other instance. |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(SpatialPosition, SpatialPosition)
Get if two SpatialPosition does not represent the same.
Declaration
public static bool operator !=(SpatialPosition left, SpatialPosition right)
Parameters
| Type | Name | Description |
|---|---|---|
| SpatialPosition | left | Compare with this first instance. |
| SpatialPosition | 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. |