instantreality 1.0

SFVec4f

The SFVec4f object corresponds to an X3D SFVec4f field.

Each component of the vector can be accessed using the x, y, z and w properties or using C-style array dereferencing (i.e., v[0], v[1], v[2] or v[3]).

Properties

TypePropertyDescriptionStandard
numberx

First value of the vector.

Avalon
numbery

Second value of the vector.

Avalon
numberz

Third value of the vector.

Avalon
numberw

Fourth value of the vector.

Avalon

Functions

Return typeFunctionDescriptionStandard
SFVec4f(number x, number y.number z.number w)

Constructs a new SFVec4f object initialized to the values of x, y, z and w.

Missing values default to 0.0.

SFVec4fadd(SFVec4f v)

Returns a new vector with the value of the passed value added, component-wise, to the object.

Avalon
SFVec4fcross(SFVec4f vec)

Returns a new vector which is the cross product of the object and the passed value.

Avalon
SFVec4fdivide(numeric n)

Returns a new vector with the value of the object divided by the passed value.

Avalon
numberdot(SFVec4f v)

Returns the dot product of this vector and the passed value.

Avalon
numberlength()

Returns the geometric length of this vector.

Avalon
SFVec4fmultiply(numeric n)

Returns a new vector with the value of the object multiplied by the passed value.

Avalon
SFVec4fnegate()

Returns a new vector which is the component-wise negation of the object.

Avalon
SFVec4fnormalize()

Returns a new vector with the value of object converted to unit length.

Avalon
SFVec4fsubtract(SFVec4f v)

Returns a new vector with the value of the passed value subtracted, component-wise, from the object.

Avalon
StringtoString()

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

X3D2.0