mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 18:59:57 +00:00
Merge branch 'bhk' into 'master'
Load bhkCapsuleShape and bhkSphereShape See merge request OpenMW/openmw!2377
This commit is contained in:
commit
1f2c473242
4 changed files with 27 additions and 1 deletions
|
@ -156,6 +156,8 @@ static std::map<std::string, CreateRecord> makeFactory()
|
||||||
{"hkPackedNiTriStripsData" , &construct <hkPackedNiTriStripsData , RC_hkPackedNiTriStripsData >},
|
{"hkPackedNiTriStripsData" , &construct <hkPackedNiTriStripsData , RC_hkPackedNiTriStripsData >},
|
||||||
{"bhkConvexVerticesShape" , &construct <bhkConvexVerticesShape , RC_bhkConvexVerticesShape >},
|
{"bhkConvexVerticesShape" , &construct <bhkConvexVerticesShape , RC_bhkConvexVerticesShape >},
|
||||||
{"bhkBoxShape" , &construct <bhkBoxShape , RC_bhkBoxShape >},
|
{"bhkBoxShape" , &construct <bhkBoxShape , RC_bhkBoxShape >},
|
||||||
|
{"bhkCapsuleShape" , &construct <bhkCapsuleShape , RC_bhkCapsuleShape >},
|
||||||
|
{"bhkSphereShape" , &construct <bhkSphereShape , RC_bhkSphereShape >},
|
||||||
{"bhkListShape" , &construct <bhkListShape , RC_bhkListShape >},
|
{"bhkListShape" , &construct <bhkListShape , RC_bhkListShape >},
|
||||||
{"bhkRigidBody" , &construct <bhkRigidBody , RC_bhkRigidBody >},
|
{"bhkRigidBody" , &construct <bhkRigidBody , RC_bhkRigidBody >},
|
||||||
{"bhkRigidBodyT" , &construct <bhkRigidBody , RC_bhkRigidBodyT >},
|
{"bhkRigidBodyT" , &construct <bhkRigidBody , RC_bhkRigidBodyT >},
|
||||||
|
|
|
@ -289,6 +289,16 @@ namespace Nif
|
||||||
nif->skip(4); // Unused
|
nif->skip(4); // Unused
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bhkCapsuleShape::read(NIFStream *nif)
|
||||||
|
{
|
||||||
|
bhkConvexShape::read(nif);
|
||||||
|
nif->skip(8); // Unused
|
||||||
|
mPoint1 = nif->getVector3();
|
||||||
|
mRadius1 = nif->getFloat();
|
||||||
|
mPoint2 = nif->getVector3();
|
||||||
|
mRadius2 = nif->getFloat();
|
||||||
|
}
|
||||||
|
|
||||||
void bhkListShape::read(NIFStream *nif)
|
void bhkListShape::read(NIFStream *nif)
|
||||||
{
|
{
|
||||||
mSubshapes.read(nif);
|
mSubshapes.read(nif);
|
||||||
|
|
|
@ -319,6 +319,18 @@ struct bhkBoxShape : public bhkConvexShape
|
||||||
void read(NIFStream *nif) override;
|
void read(NIFStream *nif) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// A capsule
|
||||||
|
struct bhkCapsuleShape : public bhkConvexShape
|
||||||
|
{
|
||||||
|
osg::Vec3f mPoint1, mPoint2;
|
||||||
|
float mRadius1, mRadius2;
|
||||||
|
|
||||||
|
void read(NIFStream *nif) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
// A sphere
|
||||||
|
using bhkSphereShape = bhkConvexShape;
|
||||||
|
|
||||||
// A list of shapes
|
// A list of shapes
|
||||||
struct bhkListShape : public bhkShapeCollection
|
struct bhkListShape : public bhkShapeCollection
|
||||||
{
|
{
|
||||||
|
@ -340,4 +352,4 @@ struct bhkRigidBody : public bhkEntity
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Namespace
|
} // Namespace
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -138,6 +138,8 @@ enum RecordType
|
||||||
RC_hkPackedNiTriStripsData,
|
RC_hkPackedNiTriStripsData,
|
||||||
RC_bhkConvexVerticesShape,
|
RC_bhkConvexVerticesShape,
|
||||||
RC_bhkBoxShape,
|
RC_bhkBoxShape,
|
||||||
|
RC_bhkCapsuleShape,
|
||||||
|
RC_bhkSphereShape,
|
||||||
RC_bhkListShape,
|
RC_bhkListShape,
|
||||||
RC_bhkRigidBody,
|
RC_bhkRigidBody,
|
||||||
RC_bhkRigidBodyT,
|
RC_bhkRigidBodyT,
|
||||||
|
|
Loading…
Reference in a new issue