本文整理汇总了C++中ogre::Node::setScale方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::setScale方法的具体用法?C++ Node::setScale怎么用?C++ Node::setScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Node
的用法示例。
在下文中一共展示了Node::setScale方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnAttributeUpdated
void EC_Mesh::OnAttributeUpdated(IAttribute *attribute)
{
if (attribute == &drawDistance)
{
if(entity_)
entity_->setRenderingDistance(drawDistance.Get());
}
else if (attribute == &castShadows)
{
if(entity_)
{
if (entity_)
entity_->setCastShadows(castShadows.Get());
//! \todo might want to disable shadows for some attachments
for (uint i = 0; i < attachment_entities_.size(); ++i)
{
if (attachment_entities_[i])
attachment_entities_[i]->setCastShadows(castShadows.Get());
}
}
}
else if (attribute == &nodeTransformation)
{
Ogre::Node* adjustmentTarget = adjustment_node_;
if (bone_tagpoint_)
adjustmentTarget = bone_tagpoint_;
if (adjustmentTarget)
{
Transform newTransform = nodeTransformation.Get();
adjustmentTarget->setPosition(newTransform.position.x, newTransform.position.y, newTransform.position.z);
Quaternion adjust(DEGTORAD * newTransform.rotation.x,
DEGTORAD * newTransform.rotation.y,
DEGTORAD * newTransform.rotation.z);
// Let's not assume the needed haxor adjustment here, but let user specify it as necessary
//adjust = Quaternion(PI/2, 0, PI) * adjust;
adjustmentTarget->setOrientation(Ogre::Quaternion(adjust.w, adjust.x, adjust.y, adjust.z));
// Prevent Ogre exception from zero scale
if (newTransform.scale.x < 0.0000001f)
newTransform.scale.x = 0.0000001f;
if (newTransform.scale.y < 0.0000001f)
newTransform.scale.y = 0.0000001f;
if (newTransform.scale.z < 0.0000001f)
newTransform.scale.z = 0.0000001f;
adjustmentTarget->setScale(newTransform.scale.x, newTransform.scale.y, newTransform.scale.z);
}
}
else if (attribute == &meshRef)
{
if (!ViewEnabled())
return;
//Ensure that mesh is requested only when it's has actually changed.
// if(entity_)
// if(QString::fromStdString(entity_->getMesh()->getName()) == meshRef.Get().ref/*meshResourceId.Get()*/)
// return;
/*
AssetTransferPtr transfer = GetFramework()->Asset()->RequestAsset(meshRef.Get());
if (transfer)
{
connect(transfer.get(), SIGNAL(Loaded(AssetPtr)), SLOT(OnMeshAssetLoaded()), Qt::UniqueConnection);
}
else
{
RemoveMesh();
}
*/
if (meshRef.Get().ref.trimmed().isEmpty())
LogDebug("Warning: Mesh \"" + this->parent_entity_->GetName().toStdString() + "\" mesh ref was set to an empty reference!");
meshAsset->HandleAssetRefChange(&meshRef);
}
else if (attribute == &meshMaterial)
{
if (!ViewEnabled())
return;
// We won't request materials until we are sure that mesh has been loaded and it's safe to apply materials into it.
// This logic shouldn't be necessary anymore. -jj.
// if(!HasMaterialsChanged())
// return;
AssetReferenceList materials = meshMaterial.Get();
// Reallocate the number of material asset reflisteners.
while(materialAssets.size() > materials.Size())
materialAssets.pop_back();
while(materialAssets.size() < materials.Size())
materialAssets.push_back(boost::shared_ptr<AssetRefListener>(new AssetRefListener));
for(int i = 0; i < materials.Size(); ++i)
{
connect(materialAssets[i].get(), SIGNAL(Loaded(AssetPtr)), this, SLOT(OnMaterialAssetLoaded(AssetPtr)), Qt::UniqueConnection);
materialAssets[i]->HandleAssetRefChange(framework_->Asset(), materials[i].ref);
}
}
else if((attribute == &skeletonRef) && (!skeletonRef.Get().ref.isEmpty()))
{
if (!ViewEnabled())
//.........这里部分代码省略.........