Skip to content
Snippets Groups Projects
Commit 4921536d authored by Alecu100's avatar Alecu100
Browse files

started adding support for BSDismemberSkinInstance.h in the complex shape. so...

started adding support for BSDismemberSkinInstance.h in the complex shape. so far nothing is functional but at first glance it seems pretty straightforward enough
parent 2b762276
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ All rights reserved. Please see niflib.h for license. */
#include "Ref.h"
#include "nif_math.h"
#include "nif_basic_types.h"
#include "gen/BodyPartList.h"
#include <vector>
namespace Niflib {
......@@ -292,7 +293,20 @@ public:
*/
NIFLIB_API vector< Ref<NiNode> > GetSkinInfluences() const;
/*
* Gets the dismember groups from the ComplexShape. These groups split the mesh into submeshes and in games like Fallout3 are responsibile for how a body ca be "dismembered"
* \return The dismember groups
*/
NIFLIB_API vector<pair<BodyPartList, vector<int>>> GetDismemberGroups() const;
/*
* Sets the dismember groups from the ComplexShape. These groups split the mesh into submeshes and in games like Fallout3 are responsibile for how a body ca be "dismembered"
* \param[in] The new dismember groups
*/
NIFLIB_API void SetDismemberGroups( vector< pair< BodyPartList, vector<int> > > value );
private:
vector<pair<BodyPartList, vector<int>>> dismemberGroups;
vector<WeightedVertex> vertices;
vector<Color4> colors;
vector<Vector3> normals;
......
......@@ -60,11 +60,11 @@ public:
// Get list of dismemberment partitions
// \return The current value.
vector<BodyPartList > GetPartitions() const;
NIFLIB_API vector<BodyPartList > GetPartitions() const;
// Assign the dismemberment partition list
// \param[in] value The new value.
void SetPartitions( const vector<BodyPartList >& value );
NIFLIB_API void SetPartitions( const vector<BodyPartList >& value );
//--END CUSTOM CODE--//
protected:
......
......@@ -11,6 +11,7 @@ All rights reserved. Please see niflib.h for license. */
#define _NITRIBASEDGEOM_H_
//--BEGIN FILE HEAD CUSTOM CODE--//
#include "BodyPartList.h"
//--END CUSTOM CODE--//
#include "NiGeometry.h"
......@@ -61,6 +62,12 @@ public:
*/
NIFLIB_API void GenHardwareSkinInfo( int max_bones_per_partition = 4, int max_bones_per_vertex = 4, bool bStrippify = true, int* face2PartMap = NULL );
/*!
* This generates dismember skin data for hardware acceleration. Specifically, it creates a NiDismemberSkinPartition object based on the current skin weights. This splits up the mesh into smaller parts that are affected by fewer bones so that they can be processed by 3D accelerator hardware.
* \param[in] dismember_groups A collection of pairs of body part list - face indexes that splits the mesh into submeshes that corresponds to various body parts
*/
NIFLIB_API void GenHardwareDismemberSkinInfo( vector< pair <BodyPartList, vector < int> > > dismember_groups);
/*!
* This clears any hardware acceleration skin data that was previously created.
*/
......
......@@ -137,6 +137,13 @@ void ComplexShape::SetSkinInfluences( const vector< Ref<NiNode> > & n ) {
skinInfluences = n;
}
vector<pair<BodyPartList, vector<int>>> ComplexShape::GetDismemberGroups() const {
return dismemberGroups;
}
void ComplexShape::SetDismemberGroups( vector< pair< BodyPartList, vector<int> > > value ) {
dismemberGroups = value;
}
string ComplexShape::GetName() const {
return name;
......
......@@ -131,6 +131,10 @@ void NiTriBasedGeom::GenHardwareSkinInfo( int max_bones_per_partition /*= 4*/, i
}
}
void NiTriBasedGeom::GenHardwareDismemberSkinInfo( vector< pair <BodyPartList, vector < int> > > dismember_groups ) {
}
void NiTriBasedGeom::UpdateTangentSpace(int method) {
NiTriBasedGeomDataRef niTriGeomData = DynamicCast<NiTriBasedGeomData>(this->data);
......@@ -332,3 +336,5 @@ void NiTriBasedGeom::UpdateTangentSpace(int method) {
}
//--END CUSTOM CODE--//
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment