本文整理汇总了C++中mat3::get方法的典型用法代码示例。如果您正苦于以下问题:C++ mat3::get方法的具体用法?C++ mat3::get怎么用?C++ mat3::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mat3
的用法示例。
在下文中一共展示了mat3::get方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
mat3 operator +(const mat3 &_lhs, const mat3 &_rhs)
{
mat3 m;
for(int i = 0; i < 9; ++i)
m.set( i, _lhs.get(i) + _rhs.get(i) );
return m;
}
示例2: determinant
float determinant(const mat3 &_m)
{
float a = _m.get(0,0);
float b = _m.get(1,0);
float c = _m.get(2,0);
float d = _m.get(0,1);
float e = _m.get(1,1);
float f = _m.get(2,1);
float g = _m.get(0,2);
float h = _m.get(1,2);
float i = _m.get(2,2);
return a * (e*i - f*h) -
b * (d*i - f*g) +
c * (d*h - e*g);
}
示例3: transpose
mat3 transpose(const mat3 &_m)
{
mat3 r;
for(int i = 0; i < 3; ++i)
for(int j = 0; j < 3; ++j)
r.set(j, i, _m.get(i, j));
return r;
}
示例4: l
mat3 operator *(const mat3 &_lhs, const mat3 &_rhs)
{
mat3 m;
for(int i = 0; i < 3; ++i)
for(int j = 0; j < 3; ++j)
{
vec3 l (
_lhs.get( 0, j ),
_lhs.get( 1, j ),
_lhs.get( 2, j )
);
vec3 r (
_rhs.get( i, 0 ),
_rhs.get( i, 1 ),
_rhs.get( i, 2 )
);
m.set(i, j, dot(l, r));
}
return m;
}
示例5: setMatrix
void Graphics::setMatrix(ConstantLocation location, const mat3& value) {
if (location.shaderType == -1) return;
float floats[12];
for (int y = 0; y < 3; ++y) {
for (int x = 0; x < 3; ++x) {
floats[y * 4 + x] = value.get(y, x);
}
}
if (location.shaderType == 0) device->SetVertexShaderConstantF(location.reg.regindex, floats, 3);
else device->SetPixelShaderConstantF(location.reg.regindex, floats, 3);
}
示例6: setMatrix
void Graphics::setMatrix(ConstantLocation location, const mat3& value) {
FRHICommandListImmediate& commandList = GRHICommandList.GetImmediateCommandList();
TShaderMapRef<FVertexShaderExample> VertexShader(GetGlobalShaderMap(ERHIFeatureLevel::SM5));
mat3 value2 = value.Transpose();
float floats[12];
for (int y = 0; y < 3; ++y) {
for (int x = 0; x < 3; ++x) {
floats[y * 4 + x] = value.get(y, x);
}
}
commandList.SetShaderParameter(VertexShader->GetVertexShader(), location.parameter.GetBufferIndex(), location.parameter.GetBaseIndex(), 4 * 12, floats);
}
示例7:
mat3 mat3::operator *(const mat3& rhs)
{
float a[VEC_DIM*VEC_DIM] = {0.0f};
for(int i = 0; i < VEC_DIM; i++) {
for(int j = 0; j < VEC_DIM; j++) {
for(int z = 0; z < VEC_DIM; z++) {
a[i * VEC_DIM + j] += v[i].v[z] * rhs.get(z , j);
}
}
}
return mat3(a);
}
示例8: parseTransformation
void XmlSceneLoader::parseTransformation(TiXmlElement* elem, vec3& tr, vec3& sc, mat3& rot, Collider* collider)
{
tr={0,0,0};
sc={1,1,1};
rot=mat3::IDENTITY();
elem = elem->FirstChildElement();
while(elem)
{
if(elem->ValueStr() == std::string("translate"))
tr = toVec<3>(StringUtils::str(elem->GetText()));
else if(elem->ValueStr() == std::string("scale"))
sc = toVec<3>(StringUtils::str(elem->GetText()));
else if(elem->ValueStr() == std::string("rotate"))
{
Vector<float, 9> r = toVec<9>(StringUtils::str(elem->GetText()));
for(int i=0 ; i<9 ; ++i)
rot.get(i) = r[i];
}
else if(elem->ValueStr() == std::string("collider") && collider)
{
int col = Collider::NONE;
elem->QueryIntAttribute("type", &col);
elem->QueryFloatAttribute("mass", &collider->mass);
elem->QueryFloatAttribute("restitution", &collider->restitution);
elem->QueryFloatAttribute("friction", &collider->friction);
elem->QueryFloatAttribute("rollingFriction", &collider->rollingFriction);
if(col < Collider::USER_DEFINED)
collider->type = col;
else
collider->type = Collider::NONE;
}
elem = elem->NextSiblingElement();
}
}