Class WGLWidget.JavaScriptMatrix4x4
- Enclosing class:
- WGLWidget
A JavaScriptMatrix has methods that make it possible to do client-side calculations on matrices.
Using a WGLWidget.JavaScriptMatrix4x4
, GL parameters can be modified without communication
with the server. The value of the WGLWidget.JavaScriptMatrix4x4
is updated server-side whenever
an event is sent to the server.
Important: only the getJsRef()
of the
return value from a call to WGLWidget::createJavaScriptMatrix() is a variable name that can be
used in custom JavaScript to modify a matrix from external scripts. The getJsRef()
of return values of operations refer to
unnamed temporary objects - rvalues in C++-lingo.
The WGLWidget.JavaScriptMatrix4x4
is represented in JavaScript as an array of 16 elements.
This array represents the values of the matrix in column-major order. It is either a
Float32Array or a plain JavaScript array.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
int
getId()
getJsRef()
Returns the JavaScript reference to thisWGLWidget.JavaScriptMatrix4x4
.javax.vecmath.Matrix4f
getValue()
Returns the current server-side value.boolean
Returns whether thisWGLWidget.JavaScriptMatrix4x4
has been assigned to aWGLWidget
.inverted()
boolean
Returns whether thisWGLWidget.JavaScriptMatrix4x4
has been initialized.multiply
(javax.vecmath.Matrix4f m)
-
Constructor Details
-
JavaScriptMatrix4x4
public JavaScriptMatrix4x4()Creates a temporarily invalidWGLWidget.JavaScriptMatrix4x4
.Should be added to a WGLWidget with
WGLWidget#addJavaScriptMatrix4()
, and initialized withWGLWidget#initJavaScriptMatrix4()
.
-
-
Method Details
-
getId
public int getId() -
isInitialized
public boolean isInitialized()Returns whether thisWGLWidget.JavaScriptMatrix4x4
has been initialized. -
hasContext
public boolean hasContext()Returns whether thisWGLWidget.JavaScriptMatrix4x4
has been assigned to aWGLWidget
. -
getJsRef
Returns the JavaScript reference to thisWGLWidget.JavaScriptMatrix4x4
.In order to get a valid JavaScript reference, this matrix should have been added to a
WGLWidget
. -
getValue
public javax.vecmath.Matrix4f getValue()Returns the current server-side value.Client-side changes to the
WGLWidget.JavaScriptMatrix4x4
are automatically synchronized. -
inverted
-
transposed
-
multiply
-
clone
-