Class Rotation

Definition

Namespace:
Tizen.NUI
Assembly:
Tizen.NUI.dll
API Level:
3

The Rotation class.

C#
Copy
public class Rotation : Disposable
Inheritance
Rotation

Constructors

View Source

Rotation()

The default constructor.

Declaration
C#
Copy
public Rotation()
API Level: 3
View Source

Rotation(Radian, Radian, Radian)

The constructor of Rotation from Euler angles.

Declaration
C#
Copy
public Rotation(Radian pitch, Radian yaw, Radian roll)
Parameters
Type Name Description
Radian pitch

Pitch value as Radian.

Radian yaw

Yaw value as Radian

Radian roll

Roll value as Radian

View Source

Rotation(Radian, Vector3)

The constructor from an axis and angle.

Declaration
C#
Copy
public Rotation(Radian angle, Vector3 axis)
Parameters
Type Name Description
Radian angle

The angle around the axis.

Vector3 axis

The vector of the axis.

API Level: 3
View Source

Rotation(Vector3, Vector3)

The constructor of Rotation which describes minimum rotation to align v0 with v1.

Declaration
C#
Copy
public Rotation(Vector3 v0, Vector3 v1)
Parameters
Type Name Description
Vector3 v0

The first normalized vector.

Vector3 v1

The second normalized vector.

Remarks

v0 and v1 should be normalized.

View Source

Rotation(Vector4)

The constructor of Rotation from Quaternion Vector4.

Declaration
C#
Copy
public Rotation(Vector4 vector)
Parameters
Type Name Description
Vector4 vector

Quaternion vector for Rotation.

Properties

View Source

IDENTITY

(0.0f,0.0f,0.0f,1.0f).

Declaration
C#
Copy
public static Rotation IDENTITY { get; }
Property Value
Type Description
Rotation
API Level: 3

Methods

View Source

AngleBetween(Rotation, Rotation)

Returns the shortest angle between two rotations in radians.

Declaration
C#
Copy
public static float AngleBetween(Rotation q1, Rotation q2)
Parameters
Type Name Description
Rotation q1

The first rotation.

Rotation q2

The second rotation.

Returns
Type Description
Single

The angle between the two rotation.

API Level: 3
View Source

Conjugate()

Conjugates this rotation.

Declaration
C#
Copy
public void Conjugate()
API Level: 3
View Source

Dot(Rotation, Rotation)

Returns the dot product of two rotations.

Declaration
C#
Copy
public static float Dot(Rotation q1, Rotation q2)
Parameters
Type Name Description
Rotation q1

The first rotation.

Rotation q2

The second rotation.

Returns
Type Description
Single

The dot product of the two rotations.

API Level: 3
View Source

Exp()

Performs an exponent.

Declaration
C#
Copy
public Rotation Exp()
Returns
Type Description
Rotation

The rotation representing the exponent.

API Level: 3
View Source

GetAxisAngle(Vector3, Radian)

Converts the quaternion to an axis or angle pair.

Declaration
C#
Copy
public bool GetAxisAngle(Vector3 axis, Radian angle)
Parameters
Type Name Description
Vector3 axis

The result of an axis.

Radian angle

The result of angle in radians.

Returns
Type Description
Boolean

True if converted correctly.

API Level: 3
View Source

GetEulerAngle(Radian, Radian, Radian)

Get the Euler angles from this quaternion.

Declaration
C#
Copy
public void GetEulerAngle(Radian pitch, Radian yaw, Radian roll)
Parameters
Type Name Description
Radian pitch

The result of pitch value as Radian.

Radian yaw

The result of yaw value as Radian

Radian roll

The result of roll value as Radian

View Source

Invert()

Inverts this rotation.

Declaration
C#
Copy
public void Invert()
API Level: 3
View Source

IsIdentity()

Helper to check if this is an identity quaternion.

Declaration
C#
Copy
public bool IsIdentity()
Returns
Type Description
Boolean

True if this is identity quaternion.

API Level: 3
View Source

Length()

Returns the length of the rotation.

Declaration
C#
Copy
public float Length()
Returns
Type Description
Single

The length of the rotation.

API Level: 3
View Source

LengthSquared()

Returns the squared length of the rotation.

Declaration
C#
Copy
public float LengthSquared()
Returns
Type Description
Single

The squared length of the rotation.

API Level: 3
View Source

Lerp(Rotation, Rotation, Single)

The linear interpolation (using a straight line between the two rotations).

Declaration
C#
Copy
public static Rotation Lerp(Rotation q1, Rotation q2, float t)
Parameters
Type Name Description
Rotation q1

The start rotation.

Rotation q2

The end rotation.

Single t

A progress value between 0 and 1.

Returns
Type Description
Rotation

The interpolated rotation.

API Level: 3
View Source

Log()

Performs the logarithm of a rotation.

Declaration
C#
Copy
public Rotation Log()
Returns
Type Description
Rotation

The rotation representing the logarithm.

API Level: 3
View Source

Normalize()

Normalizes this to unit length.

Declaration
C#
Copy
public void Normalize()
API Level: 3
View Source

Normalized()

Normalized.

Declaration
C#
Copy
public Rotation Normalized()
Returns
Type Description
Rotation

A normalized version of this rotation.

API Level: 3
View Source

ReleaseSwigCPtr(Runtime.InteropServices.HandleRef)

Declaration
C#
Copy
protected override void ReleaseSwigCPtr(Runtime.InteropServices.HandleRef swigCPtr)
Parameters
Type Name Description
Tizen.System.Runtime.InteropServices.HandleRef swigCPtr
Overrides
View Source

Rotate(Vector3)

Rotate a vector3 with the Rotation. For example, if this Rotation has (0, 1, 0) rotation axis and Math.PI radian angle and the input vector is (1, 0, 0), this Rotation method returns (-1, 0, 0) that is rotated along Y axis amount of Math.PI.

Declaration
C#
Copy
public Vector3 Rotate(Vector3 vector)
Parameters
Type Name Description
Vector3 vector

The vector of vector3 to be rotated with this Rotation

Returns
Type Description
Vector3

Vector3 that is the rotation result of this rotation.

View Source

Rotate(Vector4)

Rotate a vector4 with the Rotation. For example, if this Rotation has (0, 1, 0) rotation axis and Math.PI radian angle and the input vector is (1, 0, 0, 0), this Rotation method returns (-1, 0, 0, 0) that is rotated along Y axis amount of Math.PI.

Declaration
C#
Copy
public Vector4 Rotate(Vector4 vector)
Parameters
Type Name Description
Vector4 vector

The vector of vector4 to be rotated with this Rotation

Returns
Type Description
Vector4

Vector4 that is the rotation result of this rotation.

View Source

SetEulerAngle(Radian, Radian, Radian)

Set the quaternion from Euler angles.

Declaration
C#
Copy
public void SetEulerAngle(Radian pitch, Radian yaw, Radian roll)
Parameters
Type Name Description
Radian pitch

Pitch value as Radian.

Radian yaw

Yaw value as Radian

Radian roll

Roll value as Radian

View Source

Slerp(Rotation, Rotation, Single)

The spherical linear interpolation (using the shortest arc of a great circle between the two rotations).

Declaration
C#
Copy
public static Rotation Slerp(Rotation q1, Rotation q2, float progress)
Parameters
Type Name Description
Rotation q1

The start rotation.

Rotation q2

The end rotation.

Single progress

A progress value between 0 and 1.

Returns
Type Description
Rotation

The interpolated rotation.

API Level: 3
View Source

SlerpNoInvert(Rotation, Rotation, Single)

This version of slerp, used by squad, does not check for theta > 90.

Declaration
C#
Copy
public static Rotation SlerpNoInvert(Rotation q1, Rotation q2, float t)
Parameters
Type Name Description
Rotation q1

The start rotation.

Rotation q2

The end rotation.

Single t

A progress value between 0 and 1.

Returns
Type Description
Rotation

The interpolated rotation.

API Level: 3
View Source

Squad(Rotation, Rotation, Rotation, Rotation, Single)

The spherical cubic interpolation.

Declaration
C#
Copy
public static Rotation Squad(Rotation start, Rotation end, Rotation ctrl1, Rotation ctrl2, float t)
Parameters
Type Name Description
Rotation start

The start rotation.

Rotation end

The end rotation.

Rotation ctrl1

The control rotation for q1.

Rotation ctrl2

The control rotation for q2.

Single t

A progress value between 0 and 1.

Returns
Type Description
Rotation

The interpolated rotation.

API Level: 3

Operators

View Source

Addition(Rotation, Rotation)

The addition operator.

Declaration
C#
Copy
public static Rotation operator +(Rotation arg1, Rotation arg2)
Parameters
Type Name Description
Rotation arg1

The first rotation.

Rotation arg2

The second rotation.

Returns
Type Description
Rotation

The rotation containing the result of the addition.

API Level: 3
View Source

Division(Rotation, Single)

The scale operator.

Declaration
C#
Copy
public static Rotation operator /(Rotation arg1, float arg2)
Parameters
Type Name Description
Rotation arg1

Rotation.

Single arg2

A value to scale by.

Returns
Type Description
Rotation

The rotation containing the result of scaling.

API Level: 3
View Source

Division(Rotation, Rotation)

The division operator.

Declaration
C#
Copy
public static Rotation operator /(Rotation arg1, Rotation arg2)
Parameters
Type Name Description
Rotation arg1

The first rotation.

Rotation arg2

The second rotation.

Returns
Type Description
Rotation

The rotation containing the result of scaling.

API Level: 3
View Source

Multiply(Rotation, Single)

The scale operator.

Declaration
C#
Copy
public static Rotation operator *(Rotation arg1, float arg2)
Parameters
Type Name Description
Rotation arg1

Rotation.

Single arg2

A value to scale by.

Returns
Type Description
Rotation

The rotation containing the result of scaling.

API Level: 3
View Source

Multiply(Rotation, Rotation)

The multiplication operator.

Declaration
C#
Copy
public static Rotation operator *(Rotation arg1, Rotation arg2)
Parameters
Type Name Description
Rotation arg1

The first rotation.

Rotation arg2

The second rotation.

Returns
Type Description
Rotation

The rotation containing the result of the multiplication.

API Level: 3
View Source

Multiply(Rotation, Vector3)

The multiplication operator.

Declaration
C#
Copy
public static Vector3 operator *(Rotation arg1, Vector3 arg2)
Parameters
Type Name Description
Rotation arg1

Rotation.

Vector3 arg2

The vector to multiply.

Returns
Type Description
Vector3

The rotation containing the result of the multiplication.

API Level: 3
View Source

Subtraction(Rotation, Rotation)

The subtraction operator.

Declaration
C#
Copy
public static Rotation operator -(Rotation arg1, Rotation arg2)
Parameters
Type Name Description
Rotation arg1

The first rotation.

Rotation arg2

The second rotation.

Returns
Type Description
Rotation

The rotation containing the result of the subtraction.

API Level: 3
View Source

UnaryNegation(Rotation)

The unary negation operator.

Declaration
C#
Copy
public static Rotation operator -(Rotation arg1)
Parameters
Type Name Description
Rotation arg1

The first rotation.

Returns
Type Description
Rotation

The rotation containing the negated result.

API Level: 3

Extension Methods