Class ModelsExtensions
Provides extension methods to convert transform information between Annotation types and Unity Engine types.
Inherited Members
Namespace: Unity.Cloud.Annotation.Runtime
Syntax
public static class ModelsExtensions
Methods
AreEqual(Single, Single, Single)
Checks if two Single values are equal within a specific tolerance.
Declaration
public static bool AreEqual(this float value1, float value2, float tolerance = 0F)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | value1 | The first value to compare. |
| Single | value2 | The second value to compare. |
| Single | tolerance | The optional tolerance. |
Returns
| Type | Description |
|---|---|
| Boolean | Whether the values are equal within the specific tolerance. |
AreEqual(Quaternion, Quaternion, Single)
Checks if two UnityEngine.Quaternion values are equal within a specific tolerance.
Declaration
public static bool AreEqual(this Quaternion quaternion1, Quaternion quaternion2, float tolerance = 0F)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Quaternion | quaternion1 | The first quaternion to compare. |
| UnityEngine.Quaternion | quaternion2 | The second quaternion to compare. |
| Single | tolerance | The optional tolerance. |
Returns
| Type | Description |
|---|---|
| Boolean | Whether the values are equal within the specific tolerance. |
AreEqual(Vector3, Vector3, Single)
Checks if two UnityEngine.Vector3 values are equal within a specific tolerance.
Declaration
public static bool AreEqual(this Vector3 vector1, Vector3 vector2, float tolerance = 0F)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Vector3 | vector1 | The first vector to compare. |
| UnityEngine.Vector3 | vector2 | The second vector to compare. |
| Single | tolerance | The optional tolerance. |
Returns
| Type | Description |
|---|---|
| Boolean | Whether the values are equal within the specific tolerance. |
ToAnnotationPosition(Vector3)
Converts a UnityEngine.Vector3 to a AnnotationPosition.
Declaration
public static AnnotationPosition ToAnnotationPosition(this Vector3 vector)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Vector3 | vector | The vector to convert. |
Returns
| Type | Description |
|---|---|
| AnnotationPosition | A AnnotationPosition equivalent to the UnityEngine.Vector3 parameter. |
ToAnnotationQuaternion(Quaternion)
Converts a UnityEngine.Quaternion to a AnnotationQuaternion.
Declaration
public static AnnotationQuaternion ToAnnotationQuaternion(this Quaternion quaternion)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Quaternion | quaternion | The quaternion to convert. |
Returns
| Type | Description |
|---|---|
| AnnotationQuaternion | A AnnotationQuaternion equivalent to the UnityEngine.Quaternion parameter. |
ToAnnotationTransform(Transform, Boolean)
Converts a UnityEngine.Transform to a ToAnnotationTransform(Transform, Boolean).
Declaration
public static AnnotationTransform ToAnnotationTransform(this Transform transform, bool useLocal)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Transform | transform | The transform to convert. |
| Boolean | useLocal | Whether to use local values. Uses world values if set to |
Returns
| Type | Description |
|---|---|
| AnnotationTransform | A AnnotationTransform equivalent to the UnityEngine.Transform parameter. |
ToQuaternion(AnnotationQuaternion)
Converts a AnnotationQuaternion to a UnityEngine.Quaternion.
Declaration
public static Quaternion ToQuaternion(this AnnotationQuaternion annotationQuaternion)
Parameters
| Type | Name | Description |
|---|---|---|
| AnnotationQuaternion | annotationQuaternion | The quaternion to convert. |
Returns
| Type | Description |
|---|---|
| UnityEngine.Quaternion | A UnityEngine.Quaternion equivalent to the AnnotationQuaternion parameter. |
ToVector3(AnnotationPosition)
Converts a AnnotationPosition to a UnityEngine.Vector3.
Declaration
public static Vector3 ToVector3(this AnnotationPosition annotationPosition)
Parameters
| Type | Name | Description |
|---|---|---|
| AnnotationPosition | annotationPosition | The position to convert. |
Returns
| Type | Description |
|---|---|
| UnityEngine.Vector3 | A UnityEngine.Vector3 equivalent to the AnnotationPosition parameter. |