1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:23:51 +00:00

Fix bounds calculation for addLight to a transform node

This commit is contained in:
scrawl 2016-01-06 23:16:47 +01:00
parent 93cc08a09c
commit e1c7165bfb

View file

@ -55,7 +55,9 @@ namespace SceneUtil
{ {
osg::ComputeBoundsVisitor computeBound; osg::ComputeBoundsVisitor computeBound;
computeBound.setTraversalMask(~partsysMask); computeBound.setTraversalMask(~partsysMask);
node->accept(computeBound); // We want the bounds of all children of the node, ignoring the node's local transformation
// So do a traverse(), not accept()
computeBound.traverse(*node);
// PositionAttitudeTransform seems to be slightly faster than MatrixTransform // PositionAttitudeTransform seems to be slightly faster than MatrixTransform
osg::ref_ptr<SceneUtil::PositionAttitudeTransform> trans(new SceneUtil::PositionAttitudeTransform); osg::ref_ptr<SceneUtil::PositionAttitudeTransform> trans(new SceneUtil::PositionAttitudeTransform);