Package vrml.field
Class ConstMFVec2f
java.lang.Object
vrml.Field
vrml.ConstField
vrml.ConstMField
vrml.field.ConstMFVec2f
- All Implemented Interfaces:
Cloneable
Constant VRML JSAI type class containing multiple 2 component vector fields.
Internally the class keeps data as a flat array, so that is the most efficient way of interacting with this class.
- Version:
- $Revision: 1.5 $
- Author:
- Alan Hudson, Justin Couch
-
Field Summary
FieldsFields inherited from class vrml.ConstMField
numElements
Fields inherited from class vrml.Field
valueChanged
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Construct an instance with default values.ConstMFVec2f
(float[] vecs) Construct a new field based on all the given data valuesConstMFVec2f
(float[][] vecs) Construct a new field based on all the given 2D array of values.ConstMFVec2f
(int size, float[] vecs) Construct a new field based on subsection the given data values -
Method Summary
Modifier and TypeMethodDescriptionclone()
Make a clone of this object.void
get1Value
(int index, float[] vec) Get the vec value at the given position and copy it into the user provided array.void
Get the vec value at the given position and copy it into the user provided field.void
getValue
(float[] vecs) Copy the vec values used in this field into the user provided array.void
getValue
(float[][] vecs) Get the vec values used in this field and copy them into the user provided array.toString()
Create a string representation of the field values.Methods inherited from class vrml.ConstMField
getSize
-
Field Details
-
data
protected float[] dataThe data of the underlying field
-
-
Constructor Details
-
ConstMFVec2f
protected ConstMFVec2f()Construct an instance with default values. Not available to mere mortals. -
ConstMFVec2f
public ConstMFVec2f(float[][] vecs) Construct a new field based on all the given 2D array of values.- Parameters:
vecs
- The vec values to use
-
ConstMFVec2f
public ConstMFVec2f(float[] vecs) Construct a new field based on all the given data values- Parameters:
vecs
- The vec values to use
-
ConstMFVec2f
public ConstMFVec2f(int size, float[] vecs) Construct a new field based on subsection the given data values- Parameters:
size
- The number of items to use. numElements = size / 2vecs
- The vec values to use
-
-
Method Details
-
getValue
public void getValue(float[][] vecs) Get the vec values used in this field and copy them into the user provided array.- Parameters:
vecs
- The array to copy values to
-
getValue
public void getValue(float[] vecs) Copy the vec values used in this field into the user provided array.- Parameters:
vecs
- The array to copy values to
-
get1Value
public void get1Value(int index, float[] vec) Get the vec value at the given position and copy it into the user provided array.- Parameters:
index
- The position of the vec to copyvec
- The array to copy data to
-
get1Value
Get the vec value at the given position and copy it into the user provided field.- Parameters:
index
- The position of the vec to copyvec
- The field to copy data to
-
toString
-
clone
-