Exemplo n.º 1
0
void ModelKey::skinChanged(const std::string& value)
{
	// Check if we have a skinnable model
	SkinnedModelPtr skinned = boost::dynamic_pointer_cast<SkinnedModel>(_modelNode);

	if (skinned)
	{
		skinned->skinChanged(value);
	}
}
Exemplo n.º 2
0
    bool pre(const scene::INodePtr& node) {
        // Check if we have a skinnable model
        SkinnedModelPtr skinned = boost::dynamic_pointer_cast<SkinnedModel>(node);

        if (skinned != NULL) {
            // Let the skinned model reload its current skin.
            skinned->skinChanged(skinned->getSkin());
        }

        return true; // traverse children
    }
Exemplo n.º 3
0
void ModelKey::refreshModel()
{
	if (!_modelNode) return;

	// Check if we have a skinnable model and remember the skin
	SkinnedModelPtr skinned = boost::dynamic_pointer_cast<SkinnedModel>(_modelNode);

	std::string skin = skinned ? skinned->getSkin() : "";
	
	attachModelNode();
	
	// Reset the skin to the previous value if we have a model
	skinned = boost::dynamic_pointer_cast<SkinnedModel>(_modelNode);

	if (skinned)
	{
		skinned->skinChanged(skin);
	}
}