mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 01:15:33 +00:00
Merge branch 'newNifNodeReads' into 'master'
Read a couple more Nif Nodes See merge request OpenMW/openmw!3218
This commit is contained in:
commit
3961403b79
9 changed files with 87 additions and 2 deletions
|
@ -637,4 +637,16 @@ namespace Nif
|
||||||
mScaleValue = 1.f;
|
mScaleValue = 1.f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BSEffectShaderPropertyFloatController::read(NIFStream* nif)
|
||||||
|
{
|
||||||
|
NiFloatInterpController::read(nif);
|
||||||
|
nif->read(mControlledVariable);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BSEffectShaderPropertyColorController::read(NIFStream* nif)
|
||||||
|
{
|
||||||
|
NiPoint3InterpController::read(nif);
|
||||||
|
nif->read(mControlledColor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -406,5 +406,18 @@ namespace Nif
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct BSEffectShaderPropertyFloatController : public NiFloatInterpController
|
||||||
|
{
|
||||||
|
unsigned int mControlledVariable;
|
||||||
|
|
||||||
|
void read(NIFStream* nif) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct BSEffectShaderPropertyColorController : public NiPoint3InterpController
|
||||||
|
{
|
||||||
|
unsigned int mControlledColor;
|
||||||
|
|
||||||
|
void read(NIFStream* nif) override;
|
||||||
|
};
|
||||||
} // Namespace
|
} // Namespace
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "effect.hpp"
|
#include "effect.hpp"
|
||||||
#include "exception.hpp"
|
#include "exception.hpp"
|
||||||
#include "extra.hpp"
|
#include "extra.hpp"
|
||||||
|
#include "node.hpp"
|
||||||
#include "physics.hpp"
|
#include "physics.hpp"
|
||||||
#include "property.hpp"
|
#include "property.hpp"
|
||||||
|
|
||||||
|
@ -139,6 +140,8 @@ namespace Nif
|
||||||
{ "BSFadeNode", &construct<NiNode, RC_NiNode> },
|
{ "BSFadeNode", &construct<NiNode, RC_NiNode> },
|
||||||
{ "BSLeafAnimNode", &construct<NiNode, RC_NiNode> },
|
{ "BSLeafAnimNode", &construct<NiNode, RC_NiNode> },
|
||||||
{ "BSTreeNode", &construct<BSTreeNode, RC_NiNode> },
|
{ "BSTreeNode", &construct<BSTreeNode, RC_NiNode> },
|
||||||
|
{ "BSValueNode", &construct<BSValueNode, RC_NiNode> },
|
||||||
|
{ "BSOrderedNode", &construct<BSOrderedNode, RC_NiNode> },
|
||||||
{ "BSMultiBoundNode", &construct<BSMultiBoundNode, RC_NiNode> },
|
{ "BSMultiBoundNode", &construct<BSMultiBoundNode, RC_NiNode> },
|
||||||
{ "bhkBlendController", &construct<bhkBlendController, RC_bhkBlendController> },
|
{ "bhkBlendController", &construct<bhkBlendController, RC_bhkBlendController> },
|
||||||
{ "NiFloatInterpolator", &construct<NiFloatInterpolator, RC_NiFloatInterpolator> },
|
{ "NiFloatInterpolator", &construct<NiFloatInterpolator, RC_NiFloatInterpolator> },
|
||||||
|
@ -158,6 +161,8 @@ namespace Nif
|
||||||
{ "BSFurnitureMarkerNode", &construct<BSFurnitureMarker, RC_BSFurnitureMarker> },
|
{ "BSFurnitureMarkerNode", &construct<BSFurnitureMarker, RC_BSFurnitureMarker> },
|
||||||
{ "NiCollisionObject", &construct<NiCollisionObject, RC_NiCollisionObject> },
|
{ "NiCollisionObject", &construct<NiCollisionObject, RC_NiCollisionObject> },
|
||||||
{ "bhkCollisionObject", &construct<bhkCollisionObject, RC_bhkCollisionObject> },
|
{ "bhkCollisionObject", &construct<bhkCollisionObject, RC_bhkCollisionObject> },
|
||||||
|
{ "bhkSPCollisionObject", &construct<bhkCollisionObject, RC_bhkCollisionObject> },
|
||||||
|
{ "bhkPCollisionObject", &construct<bhkCollisionObject, RC_bhkCollisionObject> },
|
||||||
{ "BSDismemberSkinInstance", &construct<BSDismemberSkinInstance, RC_BSDismemberSkinInstance> },
|
{ "BSDismemberSkinInstance", &construct<BSDismemberSkinInstance, RC_BSDismemberSkinInstance> },
|
||||||
{ "NiControllerManager", &construct<NiControllerManager, RC_NiControllerManager> },
|
{ "NiControllerManager", &construct<NiControllerManager, RC_NiControllerManager> },
|
||||||
{ "bhkMoppBvTreeShape", &construct<bhkMoppBvTreeShape, RC_bhkMoppBvTreeShape> },
|
{ "bhkMoppBvTreeShape", &construct<bhkMoppBvTreeShape, RC_bhkMoppBvTreeShape> },
|
||||||
|
@ -166,6 +171,8 @@ namespace Nif
|
||||||
{ "hkPackedNiTriStripsData", &construct<hkPackedNiTriStripsData, RC_hkPackedNiTriStripsData> },
|
{ "hkPackedNiTriStripsData", &construct<hkPackedNiTriStripsData, RC_hkPackedNiTriStripsData> },
|
||||||
{ "bhkConvexVerticesShape", &construct<bhkConvexVerticesShape, RC_bhkConvexVerticesShape> },
|
{ "bhkConvexVerticesShape", &construct<bhkConvexVerticesShape, RC_bhkConvexVerticesShape> },
|
||||||
{ "bhkConvexTransformShape", &construct<bhkConvexTransformShape, RC_bhkConvexTransformShape> },
|
{ "bhkConvexTransformShape", &construct<bhkConvexTransformShape, RC_bhkConvexTransformShape> },
|
||||||
|
{ "bhkTransformShape", &construct<bhkConvexTransformShape, RC_bhkConvexTransformShape> },
|
||||||
|
{ "bhkSimpleShapePhantom", &construct<bhkSimpleShapePhantom, RC_bhkSimpleShapePhantom> },
|
||||||
{ "bhkBoxShape", &construct<bhkBoxShape, RC_bhkBoxShape> },
|
{ "bhkBoxShape", &construct<bhkBoxShape, RC_bhkBoxShape> },
|
||||||
{ "bhkCapsuleShape", &construct<bhkCapsuleShape, RC_bhkCapsuleShape> },
|
{ "bhkCapsuleShape", &construct<bhkCapsuleShape, RC_bhkCapsuleShape> },
|
||||||
{ "bhkSphereShape", &construct<bhkSphereShape, RC_bhkSphereShape> },
|
{ "bhkSphereShape", &construct<bhkSphereShape, RC_bhkSphereShape> },
|
||||||
|
@ -192,6 +199,12 @@ namespace Nif
|
||||||
{ "BSMultiBoundSphere", &construct<BSMultiBoundSphere, RC_BSMultiBoundSphere> },
|
{ "BSMultiBoundSphere", &construct<BSMultiBoundSphere, RC_BSMultiBoundSphere> },
|
||||||
{ "BSInvMarker", &construct<BSInvMarker, RC_BSInvMarker> },
|
{ "BSInvMarker", &construct<BSInvMarker, RC_BSInvMarker> },
|
||||||
{ "BSTriShape", &construct<BSTriShape, RC_BSTriShape> },
|
{ "BSTriShape", &construct<BSTriShape, RC_BSTriShape> },
|
||||||
|
{ "BSEffectShaderPropertyFloatController",
|
||||||
|
&construct<BSEffectShaderPropertyFloatController, RC_BSEffectShaderPropertyFloatController> },
|
||||||
|
{ "BSLightingShaderPropertyFloatController",
|
||||||
|
&construct<BSEffectShaderPropertyFloatController, RC_BSLightingShaderPropertyFloatController> },
|
||||||
|
{ "BSEffectShaderPropertyColorController",
|
||||||
|
&construct<BSEffectShaderPropertyColorController, RC_BSEffectShaderPropertyColorController> },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,7 @@ namespace Nif
|
||||||
}
|
}
|
||||||
|
|
||||||
void read(osg::Vec3f& data) { readLittleEndianBufferOfType<3, float>(inp, data._v); }
|
void read(osg::Vec3f& data) { readLittleEndianBufferOfType<3, float>(inp, data._v); }
|
||||||
|
void read(osg::Vec4f& data) { readLittleEndianBufferOfType<4, float>(inp, data._v); }
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
T get()
|
T get()
|
||||||
|
|
|
@ -483,4 +483,18 @@ namespace Nif
|
||||||
nif->read(mEyeData);
|
nif->read(mEyeData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BSValueNode::read(NIFStream* nif)
|
||||||
|
{
|
||||||
|
NiNode::read(nif);
|
||||||
|
nif->read(mValue);
|
||||||
|
nif->read(mValueFlags);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BSOrderedNode::read(NIFStream* nif)
|
||||||
|
{
|
||||||
|
NiNode::read(nif);
|
||||||
|
nif->read(mAlphaSortBound);
|
||||||
|
nif->read(mStaticBound);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -377,5 +377,20 @@ namespace Nif
|
||||||
void post(Reader& nif) override;
|
void post(Reader& nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct BSValueNode : NiNode
|
||||||
|
{
|
||||||
|
unsigned int mValue;
|
||||||
|
char mValueFlags;
|
||||||
|
|
||||||
|
void read(NIFStream* nif) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct BSOrderedNode : NiNode
|
||||||
|
{
|
||||||
|
osg::Vec4f mAlphaSortBound;
|
||||||
|
char mStaticBound;
|
||||||
|
|
||||||
|
void read(NIFStream* nif) override;
|
||||||
|
};
|
||||||
} // Namespace
|
} // Namespace
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -327,8 +327,8 @@ namespace Nif
|
||||||
mHavokMaterial.read(nif);
|
mHavokMaterial.read(nif);
|
||||||
mRadius = nif->getFloat();
|
mRadius = nif->getFloat();
|
||||||
nif->skip(8); // Unused
|
nif->skip(8); // Unused
|
||||||
std::vector<float> mat;
|
std::array<float, 16> mat;
|
||||||
nif->getFloats(mat, 16);
|
nif->readArray(mat);
|
||||||
mTransform.set(mat.data());
|
mTransform.set(mat.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,4 +440,12 @@ namespace Nif
|
||||||
mBodyFlags = nif->getUShort();
|
mBodyFlags = nif->getUShort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bhkSimpleShapePhantom::read(NIFStream* nif)
|
||||||
|
{
|
||||||
|
bhkWorldObject::read(nif);
|
||||||
|
nif->skip(8); // Unused
|
||||||
|
std::array<float, 16> mat;
|
||||||
|
nif->readArray(mat);
|
||||||
|
mTransform.set(mat.data());
|
||||||
|
}
|
||||||
} // Namespace
|
} // Namespace
|
||||||
|
|
|
@ -426,5 +426,10 @@ namespace Nif
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct bhkSimpleShapePhantom : public bhkWorldObject
|
||||||
|
{
|
||||||
|
osg::Matrixf mTransform;
|
||||||
|
void read(NIFStream* nif) override;
|
||||||
|
};
|
||||||
} // Namespace
|
} // Namespace
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -138,6 +138,7 @@ namespace Nif
|
||||||
RC_hkPackedNiTriStripsData,
|
RC_hkPackedNiTriStripsData,
|
||||||
RC_bhkConvexVerticesShape,
|
RC_bhkConvexVerticesShape,
|
||||||
RC_bhkConvexTransformShape,
|
RC_bhkConvexTransformShape,
|
||||||
|
RC_bhkSimpleShapePhantom,
|
||||||
RC_bhkBoxShape,
|
RC_bhkBoxShape,
|
||||||
RC_bhkCapsuleShape,
|
RC_bhkCapsuleShape,
|
||||||
RC_bhkSphereShape,
|
RC_bhkSphereShape,
|
||||||
|
@ -164,6 +165,9 @@ namespace Nif
|
||||||
RC_BSMultiBoundSphere,
|
RC_BSMultiBoundSphere,
|
||||||
RC_BSInvMarker,
|
RC_BSInvMarker,
|
||||||
RC_BSTriShape,
|
RC_BSTriShape,
|
||||||
|
RC_BSEffectShaderPropertyFloatController,
|
||||||
|
RC_BSEffectShaderPropertyColorController,
|
||||||
|
RC_BSLightingShaderPropertyFloatController,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Base class for all records
|
/// Base class for all records
|
||||||
|
|
Loading…
Reference in a new issue