void WGLWidget::setJavaScriptMatrix4(JavaScriptMatrix4x4 &jsm, const WGenericMatrix<double, 4, 4> &m) { if (jsm.id() == -1) throw WException("JavaScriptMatrix4x4: matrix not initialized"); if (jsm.hasOperations()) throw WException("JavaScriptMatrix4x4: matrix was allready operated on"); // set the server-side copy for (unsigned i = 0; i < jsMatrixList_.size(); i++) if (jsMatrixList_[i].id == jsm.id()) jsMatrixList_[i].serverSideCopy = m; pImpl_->setJavaScriptMatrix4(jsm, m); }
void WGLWidget::addJavaScriptMatrix4(JavaScriptMatrix4x4 &mat) { if (mat.hasContext()) throw WException("The given matrix is already associated with a WGLWidget!"); mat.assignToContext(jsValues_++, this); jsMatrixList_.push_back(jsMatrixMap(mat.id(), WMatrix4x4())); }
void WGLWidget::uniformMatrix4(const UniformLocation &location, const JavaScriptMatrix4x4 &jsm) { if (jsm.id() == -1) throw WException("JavaScriptMatrix4x4: matrix not initialized"); pImpl_->uniformMatrix4(location, jsm); }