Class SFRotation
java.lang.Object
org.web3d.vrml.scripting.ecmascript.builtin.FieldScriptableObject
org.web3d.vrml.scripting.ecmascript.builtin.SFRotation
- All Implemented Interfaces:
org.mozilla.javascript.Scriptable
SFRotation field object.
- Version:
- $Revision: 1.22 $
- Author:
- Justin Couch, Alan Hudson
-
Field Summary
Fields inherited from class org.web3d.vrml.scripting.ecmascript.builtin.FieldScriptableObject
BAD_FORMAT_MSG, dataChanged, INVALID_TYPE_MSG, readOnly, READONLY_MSG, scriptField
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
-
Constructor Summary
ConstructorsConstructorDescriptionDefault public constructor required by Rhino for when created by an Ecmascript call.SFRotation
(float[] c) Construct a field based on the given array of data (sourced from a node). -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares two objects for equality base on the components being the same.get
(int index, org.mozilla.javascript.Scriptable start) Get the variable at the given index.Get the value of the named function.void
getRawData
(double[] value) Fetch the raw data held by this instance and copy it into the provided array.void
getRawData
(float[] value) Fetch the raw data held by this instance and copy it into the provided array as float values.boolean
has
(int index, org.mozilla.javascript.Scriptable start) Check for the indexed property presence.boolean
Check for the named property presence.void
jsConstructor
(Object nodes, Object nodes2, Object nodes3, Object nodes4) Constructor for all three values that rhino calls.boolean
jsFunction_equals
(Object val) Comparison of this object to another of the same type.Get the axis of this quaternion.Calculate and return the inverse of this matrix.jsFunction_multiply
(org.mozilla.javascript.Scriptable newRotation) Multiply this rotation by the given rotation.jsFunction_multVec
(org.mozilla.javascript.Scriptable newVector) Turn this rotation into a rotation matrix and then multiply the vector by that matrix.void
jsFunction_setAxis
(org.mozilla.javascript.Scriptable newAxis) Change the axis to the new valuejsFunction_slerp
(org.mozilla.javascript.Scriptable sc, double t) Creates a string version of this node.void
Sets a property based on the index.void
Sets the named property with a new value.void
setRawData
(double[] values) Convenience method to reset the values used by this instance.void
setRawData
(float[] values) Convenience method to reset the values used by this instance.toString()
Format the internal values of this matrix as a string.Methods inherited from class org.web3d.vrml.scripting.ecmascript.builtin.FieldScriptableObject
delete, delete, getClassName, getDefaultValue, getIds, getParentScope, getPrototype, hasChanged, hasInstance, locateFunction, registerFunction, setParentScope, setPrototype, setReadOnly, setScriptField
-
Constructor Details
-
SFRotation
public SFRotation()Default public constructor required by Rhino for when created by an Ecmascript call. -
SFRotation
public SFRotation(float[] c) Construct a field based on the given array of data (sourced from a node).- Parameters:
c
-
-
-
Method Details
-
jsConstructor
-
has
public boolean has(int index, org.mozilla.javascript.Scriptable start) Check for the indexed property presence. Always returns NOT_FOUND as ECMAScript doesn't support indexed objects.- Specified by:
has
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
has
in classFieldScriptableObject
- Returns:
-
has
Check for the named property presence.- Specified by:
has
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
has
in classFieldScriptableObject
- Parameters:
start
-- Returns:
- true if it is a defined eventOut or field
-
get
Get the variable at the given index. Since we don't support integer index values for fields of the script, this always returns NOT_FOUND.- Specified by:
get
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
get
in classFieldScriptableObject
- Returns:
-
get
Get the value of the named function. If no function object is registered for this name, the method will return null.- Specified by:
get
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
get
in classFieldScriptableObject
- Parameters:
name
- The variable namestart
- The object where the lookup began- Returns:
- the corresponding function object or null
-
put
Sets a property based on the index.- Specified by:
put
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
put
in classFieldScriptableObject
- Parameters:
index
- The index of the property to setstart
- The object who's property is being setvalue
- The value being requested
-
put
Sets the named property with a new value. A put usually means changing the entire property. So, if the property has changed using an operation likee = new SFColor(0, 1, 0);
then a whole new object is passed to us.- Specified by:
put
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
put
in classFieldScriptableObject
- Parameters:
name
- The name of the property to definestart
- The object who's property is being setvalue
- The value being requested
-
jsFunction_getAxis
Get the axis of this quaternion.- Returns:
- The object representing the axis
-
jsFunction_setAxis
public void jsFunction_setAxis(org.mozilla.javascript.Scriptable newAxis) Change the axis to the new value- Parameters:
newAxis
- The new axis to use
-
jsFunction_inverse
Calculate and return the inverse of this matrix.- Returns:
- A rotation representing the inverse of this one
-
jsFunction_multiply
Multiply this rotation by the given rotation.- Parameters:
newRotation
- The rotation to multiply this by- Returns:
- The result of the multiplication
-
jsFunction_multVec
Turn this rotation into a rotation matrix and then multiply the vector by that matrix. Mr . V = V' to give the return vector.- Parameters:
newVector
- The vector to multiply by this rotation- Returns:
- A vector containing the result
-
jsFunction_slerp
-
jsFunction_toString
Creates a string version of this node. Just calls the standard toString() method of the object.- Returns:
- A VRML string representation of the field
-
jsFunction_equals
Comparison of this object to another of the same type. Just calls the standard equals() method of the object.- Parameters:
val
- The value to compare to this object- Returns:
- true if the components of the object are the same
-
toString
-
equals
-
getRawData
public void getRawData(float[] value) Fetch the raw data held by this instance and copy it into the provided array as float values.- Parameters:
value
- The array to copy the data into
-
getRawData
public void getRawData(double[] value) Fetch the raw data held by this instance and copy it into the provided array.- Parameters:
value
- The array to copy the data into
-
setRawData
public void setRawData(float[] values) Convenience method to reset the values used by this instance. Typically used by the VrmlMatrix class, but others may use this too. It does not set the data changed flag when called.- Parameters:
values
- The new values to use
-
setRawData
public void setRawData(double[] values) Convenience method to reset the values used by this instance. Typically used by the VrmlMatrix class, but others may use this too. It does not set the data changed flag when called.- Parameters:
values
- The new values to use
-