#ifndef OPENMW_COMPONENTS_NIFOSG_RIGGEOMETRY_H #define OPENMW_COMPONENTS_NIFOSG_RIGGEOMETRY_H #include #include namespace SceneUtil { class Skeleton; class Bone; /// @brief Mesh skinning implementation. /// @note A RigGeometry may be attached directly to a Skeleton, or somewhere below a Skeleton. /// Note though that the RigGeometry ignores any transforms below the Skeleton, so the attachment point is not that important. class RigGeometry : public osg::Geometry { public: RigGeometry(); RigGeometry(const RigGeometry& copy, const osg::CopyOp& copyop); META_Object(NifOsg, RigGeometry) struct BoneInfluence { osg::Matrixf mInvBindMatrix; // std::map mWeights; }; struct InfluenceMap : public osg::Referenced { std::map mMap; }; void setInfluenceMap(osg::ref_ptr influenceMap); void setSourceGeometry(osg::ref_ptr sourceGeom); // Called automatically by our CullCallback void update(osg::NodeVisitor* nv); private: osg::ref_ptr mSourceGeometry; osg::ref_ptr mSkeleton; osg::ref_ptr mInfluenceMap; typedef std::map ResolvedInfluenceMap; ResolvedInfluenceMap mResolvedInfluenceMap; bool initFromParentSkeleton(osg::NodeVisitor* nv); }; } #endif