本文整理汇总了C++中ofMatrix4x4::getPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ ofMatrix4x4::getPtr方法的具体用法?C++ ofMatrix4x4::getPtr怎么用?C++ ofMatrix4x4::getPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofMatrix4x4
的用法示例。
在下文中一共展示了ofMatrix4x4::getPtr方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setTransformFromOF
void collisionTester::setTransformFromOF(ofMatrix4x4& mat, ofVec3f& s, btCollisionObject& obj){
btTransform trans;
trans.setFromOpenGLMatrix(mat.getPtr());
obj.setWorldTransform(trans);
obj.getCollisionShape()->setLocalScaling(btVector3(s.x, s.y, s.z));
}
示例2: draw
void Model::draw(ofMatrix4x4 camMvpMatrix)
{
diffuseTex.bind();
shader.begin();
ofPushStyle();
GLuint matLoc = glGetUniformLocation(shader.getProgram(), "camMvpMatrix");
if (matLoc != -1)
{
glUniformMatrix4fv(matLoc, 1, GL_FALSE, camMvpMatrix.getPtr());
}
shader.setUniformTexture("modelTransTexture", modelTransTexture, 1);
for (auto p : pieces)
{
shader.setUniformTexture("animationTexture", p.instancedAnimTextre, 2);
shader.setUniformTexture("diffuseTex", diffuseTex, 3);
p.material.begin();
ofEnableBlendMode(p.blendmode);
p.vbo.drawElements(GL_TRIANGLES, p.vbo.getNumIndices());
p.material.end();
}
ofPopStyle();
shader.end();
diffuseTex.unbind();
}
示例3: getProjectionPoint
ofVec3f ofkUnProjectionHelper::getProjectionPoint(float ofScreenPosX, float ofScreenPosY, ofMatrix4x4 modelView, ofMatrix4x4 projection, float viewWidth, float viewHeight )
{
GLdouble modelMAT[16];
GLdouble projectionMAT[16];
GLint view[4];
for(int i = 0 ; i < 16 ; i++)
{
modelMAT[i] = modelView.getPtr()[i];
projectionMAT[i] = projection.getPtr()[i];
}
view[0] = 0;
view[1] = 0;
view[2] = viewWidth;
view[3] = viewHeight;
return getProjectionPoint(ofScreenPosX, ofScreenPosY, modelMAT, projectionMAT, view);
}
示例4: getProjectionPoint
ofVec3f ofkMatrixHelper::getProjectionPoint(ofVec3f pos, const ofMatrix4x4 modelView, ofMatrix4x4 projection, const int *_view)
{
GLdouble modelMAT[16];
GLdouble projectionMAT[16];
GLint view[4];
for(int i = 0 ; i < 16 ; i++)
{
modelMAT[i] = modelView.getPtr()[i];
projectionMAT[i] = projection.getPtr()[i];
}
view[0] = _view[0];
view[1] = _view[1];
view[2] = _view[2];
view[3] = _view[3];
return getProjectionPoint(pos,modelMAT, projectionMAT,view);
}
示例5: loadViewMatrix
//----------------------------------------------------------
void ofGLRenderer::loadViewMatrix(const ofMatrix4x4 & m){
int matrixMode;
glGetIntegerv(GL_MATRIX_MODE,&matrixMode);
matrixStack.loadViewMatrix(m);
glMatrixMode(GL_MODELVIEW);
glLoadMatrixf(m.getPtr());
glMatrixMode(matrixMode);
if(lightingEnabled){
for(size_t i=0;i<ofLightsData().size();i++){
shared_ptr<ofLight::Data> lightData = ofLightsData()[i].lock();
if(lightData && lightData->isEnabled){
glLightfv(GL_LIGHT0 + lightData->glIndex, GL_POSITION, &lightData->position.x);
}
}
}
}
示例6: multMatrix
//----------------------------------------------------------
void ofGLRenderer::multMatrix (const ofMatrix4x4 & m){
multMatrix( m.getPtr() );
}
示例7: loadMatrix
//----------------------------------------------------------
void ofGLRenderer::loadMatrix (const ofMatrix4x4 & m){
loadMatrix( m.getPtr() );
}
示例8: getUniformLocation
//--------------------------------------------------------------
void ofShader::setUniformMatrix4f(const string & name, const ofMatrix4x4 & m, int count) const{
if(bLoaded) {
int loc = getUniformLocation(name);
if (loc != -1) glUniformMatrix4fv(loc, count, GL_FALSE, m.getPtr());
}
}
示例9: applyMatrix
void applyMatrix(const ofMatrix4x4& matrix) {
glMultMatrixf((GLfloat*) matrix.getPtr());
}
示例10:
//--------------------------------------------------------------
void ofShader::setUniformMatrix4f(const char* name, const ofMatrix4x4 & m) {
if(bLoaded)
glUniformMatrix4fv(getUniformLocation(name), 1, GL_FALSE, m.getPtr());
}
示例11: setCurrentHMDMatrix
void ofxOpenVR::setCurrentHMDMatrix(ofMatrix4x4 & mat) {
_mat4HMDPose.set(mat.getPtr());
}
示例12: transform
void VDB::transform(ofMatrix4x4 & mat) {
tempTransform.postMult(mat);
math::Mat4d vMat(mat.getPtr());
grid->transform().postMult(vMat);
}
示例13: setUniform
void Shader::setUniform( const char* name, ofMatrix4x4& _value, bool transpose ){
if(uniforms.count( name )){
begin();
glUniformMatrix4fv(uniforms[name].loc,1, transpose, _value.getPtr() );
}
}