instantreality 1.0

SFVec2f

The SFVec2f object corresponds to an X3D SFVec2f field.

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

Properties

TypePropertyDescriptionStandard
numberx

First value of the vector.

X3D2.0
numbery

Second value of the vector.

X3D2.0

Functions

Return typeFunctionDescriptionStandard
SFVec2f(number x, number y)

Constructs a new SFVec2f object initialized to the values of x and y.

Missing values default to 0.0.

SFVec2fadd(SFVec2f v)

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

X3D2.0
SFVec2fdivide(numeric n)

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

X3D2.0
numberdot(SFVec2f v)

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

X3D2.0
numberlength()

Returns the geometric length of this vector.

X3D2.0
SFVec2fmultiply(numeric n)

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

X3D2.0
SFVec2fnormalize()

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

X3D2.0
SFVec2fsubtract(SFVec2f v)

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

X3D2.0
StringtoString()

Returns a String containing the ISO/IEC xxxxx UTF-8 encoded value of x and y.

X3D2.0