mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-22 21:40:42 +00:00
Read bhkPlaneShape and bhkMultiSphereShape
This commit is contained in:
parent
7c11d9acbc
commit
6b28f07537
@ -421,9 +421,11 @@ namespace Nif
|
|||||||
{ "bhkConvexVerticesShape", &construct<bhkConvexVerticesShape, RC_bhkConvexVerticesShape> },
|
{ "bhkConvexVerticesShape", &construct<bhkConvexVerticesShape, RC_bhkConvexVerticesShape> },
|
||||||
{ "bhkListShape", &construct<bhkListShape, RC_bhkListShape> },
|
{ "bhkListShape", &construct<bhkListShape, RC_bhkListShape> },
|
||||||
{ "bhkMoppBvTreeShape", &construct<bhkMoppBvTreeShape, RC_bhkMoppBvTreeShape> },
|
{ "bhkMoppBvTreeShape", &construct<bhkMoppBvTreeShape, RC_bhkMoppBvTreeShape> },
|
||||||
|
{ "bhkMultiSphereShape", &construct<bhkMultiSphereShape, RC_bhkMultiSphereShape> },
|
||||||
{ "bhkNiTriStripsShape", &construct<bhkNiTriStripsShape, RC_bhkNiTriStripsShape> },
|
{ "bhkNiTriStripsShape", &construct<bhkNiTriStripsShape, RC_bhkNiTriStripsShape> },
|
||||||
{ "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> },
|
||||||
{ "bhkSimpleShapePhantom", &construct<bhkSimpleShapePhantom, RC_bhkSimpleShapePhantom> },
|
{ "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> },
|
||||||
|
@ -716,6 +716,29 @@ namespace Nif
|
|||||||
nif->skip(12); // Unused
|
nif->skip(12); // Unused
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bhkHeightfieldShape::read(NIFStream* nif)
|
||||||
|
{
|
||||||
|
mHavokMaterial.read(nif);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bhkPlaneShape::read(NIFStream* nif)
|
||||||
|
{
|
||||||
|
bhkHeightfieldShape::read(nif);
|
||||||
|
|
||||||
|
nif->skip(12); // Unused
|
||||||
|
mPlane = osg::Plane(nif->get<osg::Vec4f>());
|
||||||
|
nif->read(mExtents);
|
||||||
|
nif->read(mCenter);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bhkMultiSphereShape::read(NIFStream* nif)
|
||||||
|
{
|
||||||
|
bhkSphereRepShape::read(nif);
|
||||||
|
|
||||||
|
mShapeProperty.read(nif);
|
||||||
|
nif->readVector(mSpheres, nif->get<uint32_t>());
|
||||||
|
}
|
||||||
|
|
||||||
void bhkListShape::read(NIFStream* nif)
|
void bhkListShape::read(NIFStream* nif)
|
||||||
{
|
{
|
||||||
readRecordList(nif, mSubshapes);
|
readRecordList(nif, mSubshapes);
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "recordptr.hpp"
|
#include "recordptr.hpp"
|
||||||
|
|
||||||
#include <osg/Quat>
|
#include <osg/Quat>
|
||||||
|
#include <osg/Plane>
|
||||||
#include <osg/Vec3f>
|
#include <osg/Vec3f>
|
||||||
#include <osg/Vec4f>
|
#include <osg/Vec4f>
|
||||||
|
|
||||||
@ -676,9 +677,36 @@ namespace Nif
|
|||||||
void read(NIFStream* nif) override;
|
void read(NIFStream* nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Abstract shape that can collide with an array of spheres
|
||||||
|
struct bhkHeightfieldShape : bhkShape
|
||||||
|
{
|
||||||
|
HavokMaterial mHavokMaterial;
|
||||||
|
|
||||||
|
void read(NIFStream* nif) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
// A plane bounded by an AABB
|
||||||
|
struct bhkPlaneShape : bhkHeightfieldShape
|
||||||
|
{
|
||||||
|
osg::Plane mPlane;
|
||||||
|
osg::Vec4f mExtents;
|
||||||
|
osg::Vec4f mCenter;
|
||||||
|
|
||||||
|
void read(NIFStream* nif) override;
|
||||||
|
};
|
||||||
|
|
||||||
// A sphere
|
// A sphere
|
||||||
using bhkSphereShape = bhkConvexShape;
|
using bhkSphereShape = bhkConvexShape;
|
||||||
|
|
||||||
|
// Multiple spheres
|
||||||
|
struct bhkMultiSphereShape : bhkSphereRepShape
|
||||||
|
{
|
||||||
|
bhkWorldObjCInfoProperty mShapeProperty;
|
||||||
|
std::vector<osg::BoundingSpheref> mSpheres;
|
||||||
|
|
||||||
|
void read(NIFStream* nif) override;
|
||||||
|
};
|
||||||
|
|
||||||
// A list of shapes
|
// A list of shapes
|
||||||
struct bhkListShape : public bhkShapeCollection
|
struct bhkListShape : public bhkShapeCollection
|
||||||
{
|
{
|
||||||
|
@ -56,8 +56,10 @@ namespace Nif
|
|||||||
RC_bhkListShape,
|
RC_bhkListShape,
|
||||||
RC_bhkMalleableConstraint,
|
RC_bhkMalleableConstraint,
|
||||||
RC_bhkMoppBvTreeShape,
|
RC_bhkMoppBvTreeShape,
|
||||||
|
RC_bhkMultiSphereShape,
|
||||||
RC_bhkNiTriStripsShape,
|
RC_bhkNiTriStripsShape,
|
||||||
RC_bhkPackedNiTriStripsShape,
|
RC_bhkPackedNiTriStripsShape,
|
||||||
|
RC_bhkPlaneShape,
|
||||||
RC_bhkPhysicsSystem,
|
RC_bhkPhysicsSystem,
|
||||||
RC_bhkPrismaticConstraint,
|
RC_bhkPrismaticConstraint,
|
||||||
RC_bhkRagdollConstraint,
|
RC_bhkRagdollConstraint,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user