2013-02-24 21:51:56 +00:00
|
|
|
#ifndef OPENMW_COMPONENTS_NIF_NODE_HPP
|
|
|
|
#define OPENMW_COMPONENTS_NIF_NODE_HPP
|
2010-01-06 11:28:37 +00:00
|
|
|
|
2023-07-09 10:14:27 +00:00
|
|
|
#include <array>
|
2023-02-08 11:34:10 +00:00
|
|
|
#include <unordered_map>
|
|
|
|
|
2022-06-17 11:35:33 +00:00
|
|
|
#include <osg/Plane>
|
|
|
|
|
2014-10-19 06:26:44 +00:00
|
|
|
#include "base.hpp"
|
2016-01-02 00:12:44 +00:00
|
|
|
|
2023-11-24 19:33:43 +00:00
|
|
|
class btCollisionShape;
|
|
|
|
|
2010-01-06 11:28:37 +00:00
|
|
|
namespace Nif
|
|
|
|
{
|
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
struct NiNode;
|
2012-07-03 05:49:44 +00:00
|
|
|
|
2023-09-14 11:03:50 +00:00
|
|
|
struct BoundingVolume
|
2020-11-14 00:42:15 +00:00
|
|
|
{
|
2023-09-10 06:20:06 +00:00
|
|
|
enum Type : uint32_t
|
2022-09-22 18:26:05 +00:00
|
|
|
{
|
|
|
|
BASE_BV = 0xFFFFFFFF,
|
|
|
|
SPHERE_BV = 0,
|
|
|
|
BOX_BV = 1,
|
|
|
|
CAPSULE_BV = 2,
|
|
|
|
LOZENGE_BV = 3,
|
|
|
|
UNION_BV = 4,
|
|
|
|
HALFSPACE_BV = 5
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NiBoxBV
|
|
|
|
{
|
2023-09-14 09:39:44 +00:00
|
|
|
osg::Vec3f mCenter;
|
|
|
|
Matrix3 mAxes;
|
|
|
|
osg::Vec3f mExtents;
|
2022-09-22 18:26:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct NiCapsuleBV
|
|
|
|
{
|
2023-09-14 09:06:52 +00:00
|
|
|
osg::Vec3f mCenter, mAxis;
|
|
|
|
float mExtent{ 0.f }, mRadius{ 0.f };
|
2022-09-22 18:26:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct NiLozengeBV
|
|
|
|
{
|
2023-09-14 09:06:52 +00:00
|
|
|
float mRadius{ 0.f }, mExtent0{ 0.f }, mExtent1{ 0.f };
|
|
|
|
osg::Vec3f mCenter, mAxis0, mAxis1;
|
2022-09-22 18:26:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct NiHalfSpaceBV
|
|
|
|
{
|
2023-09-14 09:06:52 +00:00
|
|
|
osg::Plane mPlane;
|
|
|
|
osg::Vec3f mOrigin;
|
2022-09-22 18:26:05 +00:00
|
|
|
};
|
|
|
|
|
2023-09-14 09:39:44 +00:00
|
|
|
uint32_t mType{ BASE_BV };
|
2023-09-14 09:06:52 +00:00
|
|
|
osg::BoundingSpheref mSphere;
|
2023-09-14 09:39:44 +00:00
|
|
|
NiBoxBV mBox;
|
2023-09-14 09:06:52 +00:00
|
|
|
NiCapsuleBV mCapsule;
|
|
|
|
NiLozengeBV mLozenge;
|
2023-09-14 11:03:50 +00:00
|
|
|
std::vector<BoundingVolume> mChildren;
|
2023-09-14 09:06:52 +00:00
|
|
|
NiHalfSpaceBV mHalfSpace;
|
2022-09-22 18:26:05 +00:00
|
|
|
|
|
|
|
void read(NIFStream* nif);
|
2020-11-14 00:42:15 +00:00
|
|
|
};
|
|
|
|
|
2023-09-09 18:32:42 +00:00
|
|
|
struct NiSequenceStreamHelper : NiObjectNET
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
2023-09-10 02:23:25 +00:00
|
|
|
// NiAVObject is an object that is a part of the main NIF tree. It has
|
|
|
|
// a parent node (unless it's the root) and transformation relative to its parent.
|
2023-09-14 09:06:52 +00:00
|
|
|
struct NiAVObject : NiObjectNET
|
2020-11-14 00:42:15 +00:00
|
|
|
{
|
2022-09-22 18:26:05 +00:00
|
|
|
enum Flags
|
|
|
|
{
|
|
|
|
Flag_Hidden = 0x0001,
|
|
|
|
Flag_MeshCollision = 0x0002,
|
|
|
|
Flag_BBoxCollision = 0x0004,
|
|
|
|
Flag_ActiveCollision = 0x0020
|
|
|
|
};
|
|
|
|
|
2023-09-10 02:23:25 +00:00
|
|
|
// Node flags. Interpretation depends on the record type.
|
|
|
|
uint32_t mFlags;
|
|
|
|
NiTransform mTransform;
|
|
|
|
osg::Vec3f mVelocity;
|
2023-09-17 19:49:04 +00:00
|
|
|
NiPropertyList mProperties;
|
2023-09-14 11:03:50 +00:00
|
|
|
BoundingVolume mBounds;
|
2023-09-10 02:23:25 +00:00
|
|
|
NiCollisionObjectPtr mCollision;
|
|
|
|
// Parent nodes for the node. Only types derived from NiNode can be parents.
|
|
|
|
std::vector<NiNode*> mParents;
|
|
|
|
bool mIsBone{ false };
|
2022-09-22 18:26:05 +00:00
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
2022-09-17 17:24:42 +00:00
|
|
|
void post(Reader& nif) override;
|
2022-09-22 18:26:05 +00:00
|
|
|
|
|
|
|
void setBone();
|
2023-09-10 02:23:25 +00:00
|
|
|
bool isHidden() const { return mFlags & Flag_Hidden; }
|
|
|
|
bool hasMeshCollision() const { return mFlags & Flag_MeshCollision; }
|
|
|
|
bool hasBBoxCollision() const { return mFlags & Flag_BBoxCollision; }
|
|
|
|
bool collisionActive() const { return mFlags & Flag_ActiveCollision; }
|
2020-11-14 00:42:15 +00:00
|
|
|
};
|
|
|
|
|
2023-09-10 02:23:25 +00:00
|
|
|
struct NiNode : NiAVObject
|
2020-11-14 00:42:15 +00:00
|
|
|
{
|
2022-09-22 18:26:05 +00:00
|
|
|
enum BSAnimFlags
|
|
|
|
{
|
|
|
|
AnimFlag_AutoPlay = 0x0020
|
|
|
|
};
|
2023-09-10 02:23:25 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
enum BSParticleFlags
|
|
|
|
{
|
|
|
|
ParticleFlag_AutoPlay = 0x0020,
|
|
|
|
ParticleFlag_LocalSpace = 0x0080
|
|
|
|
};
|
|
|
|
|
2023-09-10 02:23:25 +00:00
|
|
|
NiAVObjectList mChildren;
|
|
|
|
NiAVObjectList mEffects;
|
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
void read(NIFStream* nif) override;
|
2022-09-17 17:24:42 +00:00
|
|
|
void post(Reader& nif) override;
|
2020-11-14 00:42:15 +00:00
|
|
|
};
|
|
|
|
|
2023-09-27 10:36:29 +00:00
|
|
|
struct NiGeometry : NiAVObject
|
2020-11-14 00:42:15 +00:00
|
|
|
{
|
2022-09-22 18:26:05 +00:00
|
|
|
/* Possible flags:
|
|
|
|
0x40 - mesh has no vertex normals ?
|
|
|
|
|
|
|
|
Only flags included in 0x47 (ie. 0x01, 0x02, 0x04 and 0x40) have
|
|
|
|
been observed so far.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct MaterialData
|
|
|
|
{
|
2023-09-14 09:06:52 +00:00
|
|
|
std::vector<std::string> mNames;
|
|
|
|
std::vector<int> mExtra;
|
|
|
|
int32_t mActive{ -1 };
|
|
|
|
bool mNeedsUpdate{ false };
|
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
void read(NIFStream* nif);
|
|
|
|
};
|
|
|
|
|
2023-09-14 10:07:20 +00:00
|
|
|
NiGeometryDataPtr mData;
|
2023-09-27 10:36:29 +00:00
|
|
|
NiSkinInstancePtr mSkin;
|
2023-09-14 09:06:52 +00:00
|
|
|
MaterialData mMaterial;
|
2023-09-27 10:36:29 +00:00
|
|
|
BSShaderPropertyPtr mShaderProperty;
|
|
|
|
NiAlphaPropertyPtr mAlphaProperty;
|
2022-09-22 18:26:05 +00:00
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
2022-09-17 17:24:42 +00:00
|
|
|
void post(Reader& nif) override;
|
2023-11-24 19:33:43 +00:00
|
|
|
|
|
|
|
virtual std::unique_ptr<btCollisionShape> getCollisionShape() const
|
|
|
|
{
|
|
|
|
throw std::runtime_error("NiGeometry::getCollisionShape() called on base class");
|
|
|
|
}
|
2020-11-14 00:42:15 +00:00
|
|
|
};
|
|
|
|
|
2023-09-14 11:03:50 +00:00
|
|
|
// Abstract triangle-based geometry
|
|
|
|
struct NiTriBasedGeom : NiGeometry
|
2020-11-14 00:42:15 +00:00
|
|
|
{
|
|
|
|
};
|
2023-09-14 09:06:52 +00:00
|
|
|
|
2023-09-14 11:03:50 +00:00
|
|
|
struct NiTriShape : NiTriBasedGeom
|
2022-09-22 18:26:05 +00:00
|
|
|
{
|
2023-11-24 19:33:43 +00:00
|
|
|
std::unique_ptr<btCollisionShape> getCollisionShape() const override;
|
2022-09-22 18:26:05 +00:00
|
|
|
};
|
2023-09-14 09:06:52 +00:00
|
|
|
|
2023-09-25 11:47:37 +00:00
|
|
|
struct BSSegmentedTriShape : NiTriShape
|
|
|
|
{
|
|
|
|
struct SegmentData
|
|
|
|
{
|
|
|
|
uint8_t mFlags;
|
|
|
|
uint32_t mStartIndex;
|
|
|
|
uint32_t mNumTriangles;
|
2023-10-20 13:29:45 +00:00
|
|
|
|
|
|
|
void read(NIFStream* nif);
|
2023-09-25 11:47:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<SegmentData> mSegments;
|
|
|
|
|
|
|
|
void read(NIFStream* nif);
|
|
|
|
};
|
|
|
|
|
2023-09-14 11:03:50 +00:00
|
|
|
struct NiTriStrips : NiTriBasedGeom
|
|
|
|
{
|
2023-11-24 19:33:43 +00:00
|
|
|
std::unique_ptr<btCollisionShape> getCollisionShape() const override;
|
2023-09-14 11:03:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct NiLines : NiTriBasedGeom
|
2022-09-22 18:26:05 +00:00
|
|
|
{
|
2023-11-24 19:33:43 +00:00
|
|
|
std::unique_ptr<btCollisionShape> getCollisionShape() const override;
|
2022-09-22 18:26:05 +00:00
|
|
|
};
|
2023-09-14 09:06:52 +00:00
|
|
|
|
2023-08-03 19:55:06 +00:00
|
|
|
struct NiParticles : NiGeometry
|
|
|
|
{
|
2023-11-24 19:33:43 +00:00
|
|
|
std::unique_ptr<btCollisionShape> getCollisionShape() const override;
|
2023-08-03 19:55:06 +00:00
|
|
|
};
|
2022-06-21 21:43:16 +00:00
|
|
|
|
2023-11-24 19:33:43 +00:00
|
|
|
struct BSLODTriShape : NiTriShape
|
2022-09-22 18:26:05 +00:00
|
|
|
{
|
2023-09-14 09:06:52 +00:00
|
|
|
std::array<uint32_t, 3> mLOD;
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
};
|
2010-01-06 14:00:08 +00:00
|
|
|
|
2023-09-14 09:06:52 +00:00
|
|
|
struct NiCamera : NiAVObject
|
|
|
|
{
|
|
|
|
uint16_t mCameraFlags{ 0 };
|
|
|
|
// Camera frustum
|
|
|
|
float mLeft, mRight, mTop, mBottom, mNearDist, mFarDist;
|
|
|
|
bool mOrthographic{ false };
|
|
|
|
// Viewport
|
|
|
|
float mVLeft, mVRight, mVTop, mVBottom;
|
|
|
|
float mLODAdjust;
|
|
|
|
NiAVObjectPtr mScene;
|
2012-07-03 04:41:21 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
void read(NIFStream* nif) override;
|
2023-09-14 09:06:52 +00:00
|
|
|
void post(Reader& nif) override;
|
2013-04-16 08:20:32 +00:00
|
|
|
};
|
2020-12-13 00:16:05 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
// A node used as the base to switch between child nodes, such as for LOD levels.
|
2023-09-14 09:06:52 +00:00
|
|
|
struct NiSwitchNode : NiNode
|
2020-10-03 22:27:49 +00:00
|
|
|
{
|
2023-09-14 09:29:49 +00:00
|
|
|
uint16_t mSwitchFlags;
|
|
|
|
uint32_t mInitialIndex;
|
2019-08-08 10:11:24 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
};
|
2019-08-08 10:11:24 +00:00
|
|
|
|
2023-09-14 09:06:52 +00:00
|
|
|
struct NiLODNode : NiSwitchNode
|
2012-07-03 04:41:21 +00:00
|
|
|
{
|
2022-09-22 18:26:05 +00:00
|
|
|
struct LODRange
|
|
|
|
{
|
2023-09-14 09:29:49 +00:00
|
|
|
float mMinRange;
|
|
|
|
float mMaxRange;
|
2022-09-22 18:26:05 +00:00
|
|
|
};
|
2023-09-14 09:06:52 +00:00
|
|
|
|
2023-09-14 09:29:49 +00:00
|
|
|
osg::Vec3f mLODCenter;
|
|
|
|
std::vector<LODRange> mLODLevels;
|
2012-07-10 07:27:13 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
void read(NIFStream* nif) override;
|
2012-07-03 04:41:21 +00:00
|
|
|
};
|
2010-01-07 18:11:03 +00:00
|
|
|
|
2023-09-14 09:06:52 +00:00
|
|
|
struct NiFltAnimationNode : NiSwitchNode
|
2022-09-22 18:26:05 +00:00
|
|
|
{
|
|
|
|
enum Flags
|
|
|
|
{
|
|
|
|
Flag_Swing = 0x40
|
|
|
|
};
|
2019-06-08 22:58:02 +00:00
|
|
|
|
2023-09-14 09:06:52 +00:00
|
|
|
float mDuration;
|
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
void read(NIFStream* nif) override;
|
2015-11-12 18:40:31 +00:00
|
|
|
|
2023-09-10 02:23:25 +00:00
|
|
|
bool swing() const { return mFlags & Flag_Swing; }
|
2022-09-22 18:26:05 +00:00
|
|
|
};
|
2015-11-12 18:40:31 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
// Abstract
|
|
|
|
struct NiAccumulator : Record
|
2015-11-12 18:40:31 +00:00
|
|
|
{
|
2022-09-22 18:26:05 +00:00
|
|
|
void read(NIFStream* nif) override {}
|
2015-11-12 18:40:31 +00:00
|
|
|
};
|
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
// Node children sorters
|
|
|
|
struct NiClusterAccumulator : NiAccumulator
|
2022-03-30 07:27:00 +00:00
|
|
|
{
|
|
|
|
};
|
2023-09-14 09:06:52 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
struct NiAlphaAccumulator : NiClusterAccumulator
|
2021-11-13 20:36:33 +00:00
|
|
|
{
|
|
|
|
};
|
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
struct NiSortAdjustNode : NiNode
|
|
|
|
{
|
2023-09-14 09:06:52 +00:00
|
|
|
enum class SortingMode : uint32_t
|
2022-09-22 18:26:05 +00:00
|
|
|
{
|
2023-09-14 09:06:52 +00:00
|
|
|
Inherit,
|
|
|
|
Off,
|
|
|
|
Subsort,
|
2022-09-22 18:26:05 +00:00
|
|
|
};
|
|
|
|
|
2023-09-14 09:06:52 +00:00
|
|
|
SortingMode mMode;
|
2022-09-22 18:26:05 +00:00
|
|
|
NiAccumulatorPtr mSubSorter;
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
2022-09-17 17:24:42 +00:00
|
|
|
void post(Reader& nif) override;
|
2022-09-22 18:26:05 +00:00
|
|
|
};
|
2021-11-13 20:36:33 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
struct NiBillboardNode : NiNode
|
|
|
|
{
|
2023-09-14 09:06:52 +00:00
|
|
|
int mMode;
|
2022-08-31 19:12:13 +00:00
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
};
|
2022-08-31 19:12:13 +00:00
|
|
|
|
2023-02-08 11:34:10 +00:00
|
|
|
struct NiDefaultAVObjectPalette : Record
|
|
|
|
{
|
2023-09-10 02:23:25 +00:00
|
|
|
NiAVObjectPtr mScene;
|
|
|
|
std::unordered_map<std::string, NiAVObjectPtr> mObjects;
|
2023-02-08 11:34:10 +00:00
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
void post(Reader& nif) override;
|
|
|
|
};
|
|
|
|
|
2023-05-21 15:15:27 +00:00
|
|
|
struct BSTreeNode : NiNode
|
|
|
|
{
|
2023-09-10 02:23:25 +00:00
|
|
|
NiAVObjectList mBones1, mBones2;
|
2023-09-14 09:06:52 +00:00
|
|
|
|
2023-05-21 15:15:27 +00:00
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
void post(Reader& nif) override;
|
|
|
|
};
|
|
|
|
|
2023-05-22 19:28:05 +00:00
|
|
|
struct BSMultiBoundNode : NiNode
|
|
|
|
{
|
2023-09-14 11:03:50 +00:00
|
|
|
enum class BSCPCullingType : uint32_t
|
|
|
|
{
|
|
|
|
Normal,
|
|
|
|
AllPass,
|
|
|
|
AllFail,
|
|
|
|
IgnoreMultiBounds,
|
|
|
|
ForceMultiBoundsNoUpdate,
|
|
|
|
};
|
|
|
|
|
2023-05-22 19:28:05 +00:00
|
|
|
BSMultiBoundPtr mMultiBound;
|
2023-09-14 11:03:50 +00:00
|
|
|
BSCPCullingType mCullingType;
|
2023-05-22 19:28:05 +00:00
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
void post(Reader& nif) override;
|
|
|
|
};
|
|
|
|
|
2023-07-09 10:14:27 +00:00
|
|
|
struct BSVertexDesc
|
|
|
|
{
|
2023-09-14 09:06:52 +00:00
|
|
|
uint8_t mVertexDataSize;
|
|
|
|
uint8_t mDynamicVertexSize;
|
|
|
|
uint8_t mUV1Offset;
|
|
|
|
uint8_t mUV2Offset;
|
|
|
|
uint8_t mNormalOffset;
|
|
|
|
uint8_t mTangentOffset;
|
|
|
|
uint8_t mColorOffset;
|
|
|
|
uint8_t mSkinningDataOffset;
|
|
|
|
uint8_t mLandscapeDataOffset;
|
|
|
|
uint8_t mEyeDataOffset;
|
|
|
|
uint16_t mFlags;
|
2023-07-09 10:14:27 +00:00
|
|
|
|
|
|
|
enum VertexAttribute
|
|
|
|
{
|
|
|
|
Vertex = 0x0001,
|
|
|
|
UVs = 0x0002,
|
|
|
|
UVs_2 = 0x0004,
|
|
|
|
Normals = 0x0008,
|
|
|
|
Tangents = 0x0010,
|
|
|
|
Vertex_Colors = 0x0020,
|
|
|
|
Skinned = 0x0040,
|
|
|
|
Land_Data = 0x0080,
|
|
|
|
Eye_Data = 0x0100,
|
|
|
|
Instance = 0x0200,
|
|
|
|
Full_Precision = 0x0400,
|
|
|
|
};
|
|
|
|
|
|
|
|
void read(NIFStream* nif);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BSVertexData
|
|
|
|
{
|
2023-09-19 22:54:26 +00:00
|
|
|
osg::Vec4f mVertex; // Bitangent X is stored in the fourth component
|
|
|
|
std::array<Misc::float16_t, 4> mHalfVertex; // Ditto
|
2023-07-09 10:14:27 +00:00
|
|
|
std::array<Misc::float16_t, 2> mUV;
|
2023-09-19 22:54:26 +00:00
|
|
|
std::array<char, 4> mNormal; // Bitangent Y is stored in the fourth component
|
|
|
|
std::array<char, 4> mTangent; // Bitangent Z is stored in the fourth component
|
2023-09-17 17:04:51 +00:00
|
|
|
std::array<char, 4> mVertColor;
|
2023-07-09 10:14:27 +00:00
|
|
|
std::array<Misc::float16_t, 4> mBoneWeights;
|
|
|
|
std::array<char, 4> mBoneIndices;
|
|
|
|
float mEyeData;
|
|
|
|
|
|
|
|
void read(NIFStream* nif, uint16_t flags);
|
|
|
|
};
|
|
|
|
|
2023-09-27 10:36:29 +00:00
|
|
|
struct BSTriShape : NiAVObject
|
2023-07-09 10:14:27 +00:00
|
|
|
{
|
2023-09-05 20:30:37 +00:00
|
|
|
osg::BoundingSpheref mBoundingSphere;
|
2023-07-26 02:36:52 +00:00
|
|
|
std::array<float, 6> mBoundMinMax;
|
2023-09-27 10:36:29 +00:00
|
|
|
RecordPtrT<Record> mSkin;
|
|
|
|
BSShaderPropertyPtr mShaderProperty;
|
|
|
|
NiAlphaPropertyPtr mAlphaProperty;
|
2023-07-09 10:14:27 +00:00
|
|
|
BSVertexDesc mVertDesc;
|
2023-09-14 09:06:52 +00:00
|
|
|
uint32_t mDataSize;
|
2023-07-09 10:14:27 +00:00
|
|
|
std::vector<BSVertexData> mVertData;
|
|
|
|
std::vector<unsigned short> mTriangles;
|
2023-09-14 09:06:52 +00:00
|
|
|
uint32_t mParticleDataSize;
|
|
|
|
std::vector<Misc::float16_t> mParticleVerts;
|
|
|
|
std::vector<Misc::float16_t> mParticleNormals;
|
2023-07-09 10:14:27 +00:00
|
|
|
std::vector<unsigned short> mParticleTriangles;
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
void post(Reader& nif) override;
|
|
|
|
};
|
|
|
|
|
2023-09-19 22:54:26 +00:00
|
|
|
struct BSDynamicTriShape : BSTriShape
|
|
|
|
{
|
|
|
|
uint32_t mDynamicDataSize;
|
|
|
|
std::vector<osg::Vec4f> mDynamicData;
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BSMeshLODTriShape : BSTriShape
|
|
|
|
{
|
|
|
|
std::array<uint32_t, 3> mLOD;
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
};
|
|
|
|
|
2023-10-20 13:29:45 +00:00
|
|
|
struct BSSubIndexTriShape : BSTriShape
|
|
|
|
{
|
|
|
|
struct SubSegment
|
|
|
|
{
|
|
|
|
uint32_t mStartIndex;
|
|
|
|
uint32_t mNumPrimitives;
|
|
|
|
uint32_t mArrayIndex;
|
|
|
|
|
|
|
|
void read(NIFStream* nif);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Segment
|
|
|
|
{
|
|
|
|
uint32_t mStartIndex;
|
|
|
|
uint32_t mNumPrimitives;
|
|
|
|
uint32_t mParentArrayIndex;
|
|
|
|
std::vector<SubSegment> mSubSegments;
|
|
|
|
|
|
|
|
void read(NIFStream* nif);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SubSegmentDataRecord
|
|
|
|
{
|
|
|
|
uint32_t mUserSlotID;
|
|
|
|
uint32_t mMaterial;
|
|
|
|
std::vector<float> mExtraData;
|
|
|
|
|
|
|
|
void read(NIFStream* nif);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SubSegmentData
|
|
|
|
{
|
|
|
|
std::vector<uint32_t> mArrayIndices;
|
|
|
|
std::vector<SubSegmentDataRecord> mDataRecords;
|
|
|
|
std::string mSSFFile;
|
|
|
|
|
|
|
|
void read(NIFStream* nif);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Segmentation
|
|
|
|
{
|
|
|
|
uint32_t mNumPrimitives;
|
|
|
|
uint32_t mNumTotalSegments;
|
|
|
|
std::vector<Segment> mSegments;
|
|
|
|
SubSegmentData mSubSegmentData;
|
|
|
|
|
|
|
|
void read(NIFStream* nif);
|
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<BSSegmentedTriShape::SegmentData> mSegments; // SSE
|
|
|
|
Segmentation mSegmentation; // FO4
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
};
|
|
|
|
|
2023-07-10 22:27:05 +00:00
|
|
|
struct BSValueNode : NiNode
|
|
|
|
{
|
2023-09-14 09:06:52 +00:00
|
|
|
enum Flags
|
|
|
|
{
|
|
|
|
Flag_BillboardWorldZ = 0x1,
|
|
|
|
Flag_UsePlayerAdjust = 0x2,
|
|
|
|
};
|
|
|
|
|
|
|
|
uint32_t mValue;
|
|
|
|
uint8_t mValueFlags;
|
2023-07-10 22:27:05 +00:00
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BSOrderedNode : NiNode
|
|
|
|
{
|
|
|
|
osg::Vec4f mAlphaSortBound;
|
2023-09-14 09:06:52 +00:00
|
|
|
bool mStaticBound;
|
2023-07-10 22:27:05 +00:00
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
};
|
2023-07-20 01:04:49 +00:00
|
|
|
|
|
|
|
struct BSRangeNode : NiNode
|
|
|
|
{
|
|
|
|
uint8_t mMin, mMax;
|
|
|
|
uint8_t mCurrent;
|
|
|
|
|
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
};
|
2023-09-10 02:23:25 +00:00
|
|
|
|
|
|
|
}
|
2010-01-06 11:28:37 +00:00
|
|
|
#endif
|