1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 07:53:53 +00:00

Merge pull request #2710 from akortunov/collisionswitch

Take in account transformations of NiCollisionSwitch
This commit is contained in:
Alexei Dobrohotov 2020-02-25 11:55:38 +03:00 committed by GitHub
commit 4928aaf3f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,10 +168,10 @@ namespace
namespace NifOsg namespace NifOsg
{ {
class CollisionSwitch : public osg::Group class CollisionSwitch : public osg::MatrixTransform
{ {
public: public:
CollisionSwitch(bool enabled) : osg::Group() CollisionSwitch(const osg::Matrixf& transformations, bool enabled) : osg::MatrixTransform(transformations)
{ {
setEnabled(enabled); setEnabled(enabled);
} }
@ -477,7 +477,7 @@ namespace NifOsg
case Nif::RC_NiCollisionSwitch: case Nif::RC_NiCollisionSwitch:
{ {
bool enabled = nifNode->flags & Nif::NiNode::Flag_ActiveCollision; bool enabled = nifNode->flags & Nif::NiNode::Flag_ActiveCollision;
node = new CollisionSwitch(enabled); node = new CollisionSwitch(nifNode->trafo.toMatrix(), enabled);
dataVariance = osg::Object::STATIC; dataVariance = osg::Object::STATIC;
break; break;