mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 22:45:34 +00:00
Merge pull request #2629 from akortunov/shapes
Handle NiKeyframeController for NiTriShape
This commit is contained in:
commit
150a1e735f
2 changed files with 12 additions and 2 deletions
|
@ -231,6 +231,7 @@
|
|||
Feature #5147: Show spell magicka cost in spell buying window
|
||||
Feature #5170: Editor: Land shape editing, land selection
|
||||
Feature #5193: Weapon sheathing
|
||||
Feature #5224: Handle NiKeyframeController for NiTriShape
|
||||
Task #4686: Upgrade media decoder to a more current FFmpeg API
|
||||
Task #4695: Optimize Distant Terrain memory consumption
|
||||
Task #4789: Optimize cell transitions
|
||||
|
|
|
@ -614,8 +614,6 @@ namespace NifOsg
|
|||
if (composite->getNumControllers() > 0)
|
||||
node->addUpdateCallback(composite);
|
||||
|
||||
// Note: NiTriShapes are not allowed to have KeyframeControllers (the vanilla engine just crashes when there is one).
|
||||
// We can take advantage of this constraint for optimizations later.
|
||||
if (nifNode->recType != Nif::RC_NiTriShape && nifNode->recType != Nif::RC_NiTriStrips
|
||||
&& !nifNode->controller.empty() && node->getDataVariance() == osg::Object::DYNAMIC)
|
||||
handleNodeControllers(nifNode, static_cast<osg::MatrixTransform*>(node.get()), animflags);
|
||||
|
@ -676,6 +674,17 @@ namespace NifOsg
|
|||
setupController(niuvctrl, uvctrl, animflags);
|
||||
composite->addController(uvctrl);
|
||||
}
|
||||
else if (ctrl->recType == Nif::RC_NiKeyframeController)
|
||||
{
|
||||
const Nif::NiKeyframeController *key = static_cast<const Nif::NiKeyframeController*>(ctrl.getPtr());
|
||||
if(!key->data.empty())
|
||||
{
|
||||
osg::ref_ptr<KeyframeController> callback(new KeyframeController(key->data.getPtr()));
|
||||
|
||||
setupController(key, callback, animflags);
|
||||
node->addUpdateCallback(callback);
|
||||
}
|
||||
}
|
||||
else if (ctrl->recType == Nif::RC_NiVisController)
|
||||
{
|
||||
handleVisController(static_cast<const Nif::NiVisController*>(ctrl.getPtr()), node, animflags);
|
||||
|
|
Loading…
Reference in a new issue