本文整理汇总了C++中mat4::get方法的典型用法代码示例。如果您正苦于以下问题:C++ mat4::get方法的具体用法?C++ mat4::get怎么用?C++ mat4::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mat4
的用法示例。
在下文中一共展示了mat4::get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setMatrix
void Graphics::setMatrix(ConstantLocation location, const mat4& value) {
if (location.shaderType == -1) return;
float floats[16];
for (int y = 0; y < 4; ++y) {
for (int x = 0; x < 4; ++x) {
floats[y * 4 + x] = value.get(y, x);
}
}
if (location.shaderType == 0) device->SetVertexShaderConstantF(location.reg.regindex, floats, 4);
else device->SetPixelShaderConstantF(location.reg.regindex, floats, 4);
}
示例2: VTMP
mat4 mat4::operator*( const mat4& o ) const
{
mat4 res;
#ifdef SLMATH_SIMD
#define VTMP(i,j) SLMATH_MUL_PS( m_m128[i], SLMATH_LOAD_PS1(&o[j][i]) )
m128_t* const o128 = res.m128();
o128[0] = SLMATH_ADD_PS( SLMATH_ADD_PS(VTMP(0,0),VTMP(1,0)), SLMATH_ADD_PS(VTMP(2,0),VTMP(3,0)) );
o128[1] = SLMATH_ADD_PS( SLMATH_ADD_PS(VTMP(0,1),VTMP(1,1)), SLMATH_ADD_PS(VTMP(2,1),VTMP(3,1)) );
o128[2] = SLMATH_ADD_PS( SLMATH_ADD_PS(VTMP(0,2),VTMP(1,2)), SLMATH_ADD_PS(VTMP(2,2),VTMP(3,2)) );
o128[3] = SLMATH_ADD_PS( SLMATH_ADD_PS(VTMP(0,3),VTMP(1,3)), SLMATH_ADD_PS(VTMP(2,3),VTMP(3,3)) );
#undef VTMP
#else
// note: above SIMD-macro version works also on non-SIMD platforms, this is much faster if there is no SIMD support
const vec4* const mp = &get(0);
const vec4* const op = &o.get(0);
vec4* const resp = res.v4();
MAT4_MUL_MAT4( resp, mp, op );
#endif
SLMATH_VEC_ASSERT( check(res) );
return res;
}
示例3: setModelMatrix
void RendererOpenGL::setModelMatrix(const mat4& model)
{
GraphicsDevice::setModelMatrix(model);
if(m_activeShader) m_activeShader->setUniformMatrix("model", model.get());
}
示例4: setViewMatrix
void RendererOpenGL::setViewMatrix(const mat4& view)
{
GraphicsDevice::setViewMatrix(view);
if(m_activeShader) m_activeShader->setUniformMatrix("view", view.get());
}
示例5: setProjectionMatrix
void RendererOpenGL::setProjectionMatrix(const mat4& projection)
{
GraphicsDevice::setProjectionMatrix(projection);
if(m_activeShader) m_activeShader->setUniformMatrix("projection", projection.get());
}