Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make util functions static #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions js/artoolkit.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@
}

visible.inCurrent = true;
this.transMatToGLMat(visible.matrix, this.transform_mat);
this.transformGL_RH = this.arglCameraViewRHf(this.transform_mat);
ARController.transMatToGLMat(visible.matrix, this.transform_mat);
this.transformGL_RH = ARController.arglCameraViewRHf(this.transform_mat);
this.dispatchEvent({
name: 'getMarker',
target: this,
Expand All @@ -218,8 +218,8 @@
visible = false;

artoolkit.getTransMatMultiSquareRobust(this.id, i);
this.transMatToGLMat(this.marker_transform_mat, this.transform_mat);
this.transformGL_RH = this.arglCameraViewRHf(this.transform_mat);
ARController.transMatToGLMat(this.marker_transform_mat, this.transform_mat);
this.transformGL_RH = ARController.arglCameraViewRHf(this.transform_mat);

for (j=0; j<subMarkerCount; j++) {
multiEachMarkerInfo = this.getMultiEachMarker(i, j);
Expand All @@ -241,8 +241,8 @@
if (visible) {
for (j=0; j<subMarkerCount; j++) {
multiEachMarkerInfo = this.getMultiEachMarker(i, j);
this.transMatToGLMat(this.marker_transform_mat, this.transform_mat);
this.transformGL_RH = this.arglCameraViewRHf(this.transform_mat);
ARController.transMatToGLMat(this.marker_transform_mat, this.transform_mat);
this.transformGL_RH = ARController.arglCameraViewRHf(this.transform_mat);

this.dispatchEvent({
name: 'getMultiMarkerSub',
Expand Down Expand Up @@ -506,6 +506,8 @@
};

/**
* T.B.: Make this function static as it is a util function and doesn't manipulate the ARController object (this)
*
Converts the given 3x4 marker transformation matrix in the 12-element transMat array
into a 4x4 WebGL matrix and writes the result into the 16-element glMat array.

Expand All @@ -515,7 +517,7 @@
@param {Float64Array} glMat The 4x4 GL transformation matrix.
@param {number} [scale] The scale for the transform.
*/
ARController.prototype.transMatToGLMat = function(transMat, glMat, scale) {
ARController.transMatToGLMat = function(transMat, glMat, scale) {
if(glMat == undefined){
glMat = new Float64Array(16);
}
Expand Down Expand Up @@ -544,6 +546,8 @@
};

/**
* T.B.: Make this function static as it is a util function and doesn't manipulate the ARController object (this)

Converts the given 4x4 openGL matrix in the 16-element transMat array
into a 4x4 OpenGL Right-Hand-View matrix and writes the result into the 16-element glMat array.

Expand All @@ -553,7 +557,7 @@
@param {Float64Array} [glRhMatrix] The 4x4 GL right hand transformation matrix.
@param {number} [scale] The scale for the transform.
*/
ARController.prototype.arglCameraViewRHf = function(glMatrix, glRhMatrix, scale)
ARController.arglCameraViewRHf = function(glMatrix, glRhMatrix, scale)
{
var m_modelview;
if(glRhMatrix == undefined)
Expand Down