本文整理汇总了C++中MatrixTransform::GetTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ MatrixTransform::GetTransform方法的具体用法?C++ MatrixTransform::GetTransform怎么用?C++ MatrixTransform::GetTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MatrixTransform
的用法示例。
在下文中一共展示了MatrixTransform::GetTransform方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ApplyMatrixTransform
void CollisionVisitor::ApplyMatrixTransform(MatrixTransform &m)
{
matrix4x4f matrix = matrix4x4f::Identity();
if (!m_matrixStack.empty()) matrix = m_matrixStack.back();
m_matrixStack.push_back(matrix * m.GetTransform());
m.Traverse(*this);
m_matrixStack.pop_back();
}
示例2: shieldFinder
Shields::Shields(SceneGraph::Model *model)
: m_enabled(false)
{
assert(s_initialised);
using SceneGraph::Node;
using SceneGraph::MatrixTransform;
using SceneGraph::StaticGeometry;
using SceneGraph::CollisionGeometry;
//This will find all matrix transforms meant for shields.
SceneGraph::FindNodeVisitor shieldFinder(SceneGraph::FindNodeVisitor::MATCH_NAME_ENDSWITH, s_matrixTransformName);
model->GetRoot()->Accept(shieldFinder);
const std::vector<Node*> &results = shieldFinder.GetResults();
//Store pointer to the shields for later.
for (unsigned int i=0; i < results.size(); i++) {
MatrixTransform *mt = dynamic_cast<MatrixTransform*>(results.at(i));
assert(mt);
for(Uint32 iChild=0 ; iChild<mt->GetNumChildren() ; ++iChild) {
Node* node = mt->GetChildAt(iChild);
if (node)
{
RefCountedPtr<StaticGeometry> sg(dynamic_cast<StaticGeometry*>(node));
assert(sg.Valid());
sg->SetNodeMask(SceneGraph::NODE_TRANSPARENT);
Graphics::RenderStateDesc rsd;
rsd.blendMode = Graphics::BLEND_ALPHA;
rsd.depthWrite = false;
sg->SetRenderState(sg->GetRenderer()->CreateRenderState(rsd));
// set the material
for (Uint32 iMesh = 0; iMesh < sg->GetNumMeshes(); ++iMesh) {
StaticGeometry::Mesh &rMesh = sg->GetMeshAt(iMesh);
rMesh.material = GetGlobalShieldMaterial();
}
m_shields.push_back(Shield(Color3ub(255), mt->GetTransform(), sg.Get()));
}
}
}
}
示例3: ApplyMatrixTransform
void ApplyMatrixTransform(MatrixTransform &node) {
const matrix4x4f &m = node.GetTransform();
for (int i = 0; i < 16; i++)
wr->Float(m[i]);
}