mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-21 07:11:33 +00:00
Finish bhkPhantom hierarchy, read bhkAabbPhantom
This commit is contained in:
parent
e22654baa7
commit
a18601d6e0
4 changed files with 35 additions and 3 deletions
|
@ -429,10 +429,13 @@ namespace Nif
|
||||||
{ "bhkPackedNiTriStripsShape", &construct<bhkPackedNiTriStripsShape, RC_bhkPackedNiTriStripsShape> },
|
{ "bhkPackedNiTriStripsShape", &construct<bhkPackedNiTriStripsShape, RC_bhkPackedNiTriStripsShape> },
|
||||||
{ "hkPackedNiTriStripsData", &construct<hkPackedNiTriStripsData, RC_hkPackedNiTriStripsData> },
|
{ "hkPackedNiTriStripsData", &construct<hkPackedNiTriStripsData, RC_hkPackedNiTriStripsData> },
|
||||||
{ "bhkPlaneShape", &construct<bhkPlaneShape, RC_bhkPlaneShape> },
|
{ "bhkPlaneShape", &construct<bhkPlaneShape, RC_bhkPlaneShape> },
|
||||||
{ "bhkSimpleShapePhantom", &construct<bhkSimpleShapePhantom, RC_bhkSimpleShapePhantom> },
|
|
||||||
{ "bhkSphereShape", &construct<bhkSphereShape, RC_bhkSphereShape> },
|
{ "bhkSphereShape", &construct<bhkSphereShape, RC_bhkSphereShape> },
|
||||||
{ "bhkTransformShape", &construct<bhkConvexTransformShape, RC_bhkConvexTransformShape> },
|
{ "bhkTransformShape", &construct<bhkConvexTransformShape, RC_bhkConvexTransformShape> },
|
||||||
|
|
||||||
|
// Phantom records, Bethesda
|
||||||
|
{ "bhkAabbPhantom", &construct<bhkAabbPhantom, RC_bhkAabbPhantom> },
|
||||||
|
{ "bhkSimpleShapePhantom", &construct<bhkSimpleShapePhantom, RC_bhkSimpleShapePhantom> },
|
||||||
|
|
||||||
// Physics system records, Bethesda
|
// Physics system records, Bethesda
|
||||||
{ "bhkPhysicsSystem", &construct<bhkPhysicsSystem, RC_bhkPhysicsSystem> },
|
{ "bhkPhysicsSystem", &construct<bhkPhysicsSystem, RC_bhkPhysicsSystem> },
|
||||||
{ "bhkRagdollSystem", &construct<bhkRagdollSystem, RC_bhkRagdollSystem> },
|
{ "bhkRagdollSystem", &construct<bhkRagdollSystem, RC_bhkRagdollSystem> },
|
||||||
|
|
|
@ -846,9 +846,18 @@ namespace Nif
|
||||||
mBodyFlags = nif->get<uint16_t>();
|
mBodyFlags = nif->get<uint16_t>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bhkAabbPhantom::read(NIFStream* nif)
|
||||||
|
{
|
||||||
|
bhkPhantom::read(nif);
|
||||||
|
|
||||||
|
nif->skip(8); // Unused
|
||||||
|
nif->read(mAabbMin);
|
||||||
|
nif->read(mAabbMax);
|
||||||
|
}
|
||||||
|
|
||||||
void bhkSimpleShapePhantom::read(NIFStream* nif)
|
void bhkSimpleShapePhantom::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
bhkWorldObject::read(nif);
|
bhkShapePhantom::read(nif);
|
||||||
|
|
||||||
nif->skip(8); // Unused
|
nif->skip(8); // Unused
|
||||||
std::array<float, 16> mat;
|
std::array<float, 16> mat;
|
||||||
|
|
|
@ -769,7 +769,26 @@ namespace Nif
|
||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct bhkSimpleShapePhantom : public bhkWorldObject
|
// Abstract non-physical object that receives collision events
|
||||||
|
struct bhkPhantom : bhkWorldObject
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
// A Phantom with an AABB
|
||||||
|
struct bhkAabbPhantom : bhkPhantom
|
||||||
|
{
|
||||||
|
osg::Vec4f mAabbMin, mAabbMax;
|
||||||
|
|
||||||
|
void read(NIFStream* nif) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Abstract Phantom with a collision shape
|
||||||
|
struct bhkShapePhantom : bhkPhantom
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
// A ShapePhantom with a transformation
|
||||||
|
struct bhkSimpleShapePhantom : bhkShapePhantom
|
||||||
{
|
{
|
||||||
osg::Matrixf mTransform;
|
osg::Matrixf mTransform;
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ namespace Nif
|
||||||
{
|
{
|
||||||
RC_MISSING = 0,
|
RC_MISSING = 0,
|
||||||
RC_AvoidNode,
|
RC_AvoidNode,
|
||||||
|
RC_bhkAabbPhantom,
|
||||||
RC_bhkBallAndSocketConstraint,
|
RC_bhkBallAndSocketConstraint,
|
||||||
RC_bhkBallSocketConstraintChain,
|
RC_bhkBallSocketConstraintChain,
|
||||||
RC_bhkBlendCollisionObject,
|
RC_bhkBlendCollisionObject,
|
||||||
|
|
Loading…
Reference in a new issue