instantreality 1.0

SFRotation

The SFRotation object corresponds to an X3D SFRotation field.

It has four numeric properties: x, y, z (the axis of rotation) and angle. These may also be addressed by indices [0] through [3].

Properties

TypePropertyDescriptionStandard
numberx

The first value of the axis vector. [read/write].

X3D2.0
numbery

The second value of the axis vector. [read/write].

X3D2.0
numberz

The third value of the axis vector. [read/write].

X3D2.0
numberangle

The angle of the rotation (in radians). [read/write].

X3D2.0

Functions

Return typeFunctionDescriptionStandard
SFRotation(number x, number y, number z, number angle)

Creates a new SFRotation object.

x, y, and z are the axis of the rotation. angle is the angle of the rotation (in radians). Missing values default to 0.0, except y, which defaults to 1.0.

SFVec3fgetAxis()

Returns the axis of rotation.

X3D2.0
SFRotationinverse()

Returns the inverse of this object's rotation.

X3D2.0
SFRotationmultiply(SFRotation rot)

Returns the object multiplied by the passed value.

X3D2.0
SFVec3fmultVec(SFVec3f vec)

voidsetAxis(SFVec3f vec)

Sets the axis of rotation to the value passed in vec.

X3D2.0
SFRotationslerp(SFRotation dest, number t)

Returns the value of the spherical linear interpolation between this object's rotation and dest at value 0 <= t <= 1. For t=0, the value is this object`s rotation. For t=1, the value is dest.

X3D2.0
StringtoString()

Returns a String containing the value of x, y, z, and angle using the X3D Classic VRML encoding.

X3D2.0