diff --git a/MaxNifPlugins_Readme.txt b/MaxNifPlugins_Readme.txt index 7503c0ef8d5570f2aa27b030cb2099b5077712a1..07980bce622a1641ced854e0edc60ff9e526379a 100644 --- a/MaxNifPlugins_Readme.txt +++ b/MaxNifPlugins_Readme.txt @@ -1,4 +1,4 @@ - MaxPlugins 0.2.12 + MaxPlugins 0.2.13 ================ @@ -33,6 +33,12 @@ Change log ---------- + 0.2.13 + ----- + o Importer/Exporter + - Improved Bridge Commander support. + + 0.2.12 ----- o Installer diff --git a/MaxNifTools.ini b/MaxNifTools.ini index 9d4d4597a36ec4e25f7041c2e83deaa041ea44ff..ff4a2a64ae1d24e40136bcd755ad1169a85d7724 100644 --- a/MaxNifTools.ini +++ b/MaxNifTools.ini @@ -185,6 +185,7 @@ bhkScaleFactor=7.0 ; TextureUseFullPath - Whether to use fully qualified names when exporting. Default: 0 ; SupportPrnStrings - Whether this application supports Prn Extra Strings as a substitute mechanism for bones parenting ; Rotate90Degrees - Semicolon separated list of nodes that need to be rotated 90 degrees in Y Axis when importing through Prn lists +; DoNotReuseExistingBones - Whether existing bones can be reused when attaching skeletons. Default: 0 [Oblivion] NiVersion=20.0.0.5 @@ -276,7 +277,9 @@ ExtractFolder= RootPaths=${InstallPath};${ExtractFolder} TextureRootPaths=$(ExtractFolder) TextureExtensions=.tga -TextureSearchPaths= +TextureSearchPaths=${RootPath}\Textures +DoNotReuseExistingBones=1 +TextureUseFullPath=-1 [User] NiVersion=20.0.0.5 diff --git a/MaxNifTools.iss b/MaxNifTools.iss index bb8af584882a8e11483e8a9d54f4cee50bc4367c..784b89218b9f0b75be6e29daf9948c5d59289794 100644 --- a/MaxNifTools.iss +++ b/MaxNifTools.iss @@ -6,7 +6,7 @@ AppName=NIF Utilities for 3ds Max AppVerName=NIF Utilities {code:CurVer} for 3ds Max AppPublisher=NIF File Format Library and Tools AppCopyright=Copyright © 2007, NIF File Format Library and Tools -OutputBaseFilename=niftools-max-plugins-0.2.12.0 +OutputBaseFilename=niftools-max-plugins-0.2.13.0 DisableProgramGroupPage=yes Compression=lzma SolidCompression=yes @@ -18,7 +18,7 @@ UninstallFilesDir={win}{\}Installer\NifTools Uninstallable=yes DisableDirPage=yes ArchitecturesInstallIn64BitMode=x64 -VersionInfoVersion=0.2.12.0 +VersionInfoVersion=0.2.13.0 SourceDir=. ;UninstallDisplayIcon={app}{\}..\Oblivion.exe @@ -102,7 +102,7 @@ var sVersion: String; function InitializeSetup(): Boolean; begin - sVersion := '0.2.12'; + sVersion := '0.2.13'; Result := True; end; diff --git a/NifCommon/AppSettings.cpp b/NifCommon/AppSettings.cpp index 2e632817d20ba69952e87c9734bff113cf411fbd..2d06e9173ac6e07445947fdffec0a866f3cf16e5 100644 --- a/NifCommon/AppSettings.cpp +++ b/NifCommon/AppSettings.cpp @@ -61,11 +61,12 @@ void AppSettings::ReadSettings(string iniFile) goToSkeletonBindPosition = GetSetting<bool>("GoToSkeletonBindPosition", goToSkeletonBindPosition); disableCreateNubsForBones = GetSetting<bool>("DisableCreateNubsForBones", disableCreateNubsForBones); applyOverallTransformToSkinAndBones = GetSetting<int>("ApplyOverallTransformToSkinAndBones", -1); - textureUseFullPath = GetSetting<bool>("TextureUseFullPath", textureUseFullPath); + textureUseFullPath = GetSetting<int>("TextureUseFullPath", textureUseFullPath); dummyNodeMatches = TokenizeString(GetSetting<string>("DummyNodeMatches").c_str(), ";"); rotate90Degrees = TokenizeString(GetSetting<string>("Rotate90Degrees").c_str(), ";"); supportPrnStrings = GetSetting<bool>("SupportPrnStrings", supportPrnStrings); + doNotReuseExistingBones = GetSetting<bool>("DoNotReuseExistingBones", doNotReuseExistingBones); } void AppSettings::WriteSettings(Interface *gi) @@ -145,11 +146,15 @@ bool AppSettings::IsFileInRootPaths(const std::string& fname) std::string AppSettings::GetRelativeTexPath(const std::string& fname, const std::string& prefix) { TCHAR buffer[MAX_PATH]; - if (textureUseFullPath) + if (textureUseFullPath == 1) // full path name { GetFullPathName(fname.c_str(), _countof(buffer), buffer, NULL); return string(buffer); } + else if (textureUseFullPath == -1) // only filename + { + return string(PathFindFileName(fname.c_str())); + } if (!PathIsRelative(fname.c_str())) { TCHAR root[MAX_PATH]; diff --git a/NifCommon/AppSettings.h b/NifCommon/AppSettings.h index 7a0dd224af6ff83777eaa2cf28732bf7092738e5..d1a615cd3ee820538480a27d67d24561659753ac 100644 --- a/NifCommon/AppSettings.h +++ b/NifCommon/AppSettings.h @@ -25,8 +25,9 @@ public: , useSkeleton(false) , goToSkeletonBindPosition(true) , disableCreateNubsForBones(false) - , textureUseFullPath(false) + , textureUseFullPath(0) , supportPrnStrings(false) + , doNotReuseExistingBones(false) {} std::string Name; @@ -40,7 +41,7 @@ public: bool useSkeleton; bool goToSkeletonBindPosition; bool disableCreateNubsForBones; - bool textureUseFullPath; + int textureUseFullPath; NameValueCollection Environment; NameValueCollection imgTable; stringlist dummyNodeMatches; @@ -49,6 +50,7 @@ public: int NiUserVersion; stringlist rotate90Degrees; bool supportPrnStrings; + bool doNotReuseExistingBones; static void Initialize(Interface *gi); void ReadSettings(std::string iniFile); diff --git a/NifCommon/NifQHull.cpp b/NifCommon/NifQHull.cpp index 6860e923022a8bcff82e456660d9a7f02e14aba2..354fe195a58863de5ea07ed60caadc67d80a9b21 100644 --- a/NifCommon/NifQHull.cpp +++ b/NifCommon/NifQHull.cpp @@ -1,4 +1,13 @@ #include "Max.h" +#include "MeshDelta.h" + +//#undef Float +//#undef PI +//#define WYKOBI_SINGLE_PRECISION +// +//#include "wykobi/wykobi.hpp" +//#include "wykobi/wykobi_instantiate.hpp" +//#include "wykobi/wykobi_algorithm.hpp" #include <qhull/qhull.h> #include <qhull/mem.h> @@ -65,3 +74,89 @@ vector<Triangle> compute_convex_hull(const vector<Vector3>& verts) delete[] points; return tris; }; + +void compute_convex_hull(Mesh& mesh, Mesh& outmesh) +{ + MNMesh mn; + map<int, int> ptmap; + + vector<Triangle> tris; + + int dim=3; /* dimension of points */ + int numpoints=0; /* number of points */ + coordT *points=0; /* array of coordinates for each point */ + boolT ismalloc=0; /* True if qhull should free points in qh_freeqhull() or reallocation */ + char flags[]= "qhull i Qt"; /* option flags for qhull, see qh_opt.htm */ + FILE *outfile= stdout; /* output from qh_produce_output() + use NULL to skip qh_produce_output() */ + FILE *errfile= stderr; /* error messages from qhull code */ + int exitcode; /* 0 if no error from qhull */ + facetT *facet; /* set by FORALLfacets */ + int curlong, totlong; /* memory remaining after qh_memfreeshort */ + setT *vertices; + + setT *pts; + pointT *point; + + numpoints = mesh.getNumVerts(); + points = new coordT[3 * numpoints]; + for (int i=0; i<numpoints; ++i) { + Point3& pt = mesh.getVert(i); + points[i*3 + 0] = pt.x; + points[i*3 + 1] = pt.y; + points[i*3 + 2] = pt.z; + } + + /* initialize dim, numpoints, points[], ismalloc here */ + exitcode= qh_new_qhull (dim, numpoints, points, ismalloc, + flags, outfile, errfile); + if (!exitcode) { /* if no error */ + vertexT *vertex, **vertexp; + int id; + int numpoints=0, point_i, point_n; + int allpoints= qh num_points + qh_setsize (qh other_points); + pts = qh_settemp (allpoints); + qh_setzero (pts, 0, allpoints); + vertices= qh_facetvertices (qh facet_list, NULL, !qh_ALL); + FOREACHvertex_(vertices) { + id= qh_pointid (vertex->point); + if (id >= 0) { + SETelem_(pts, id)= vertex->point; + numpoints++; + } + } + qh_settempfree (&vertices); + + int i=0; + FOREACHpoint_i_(pts) { + if (point) { + int id = qh_pointid(point); + ptmap[id] = mn.NewVert(Point3(point[0], point[1], point[2])); + i++; + } + } + qh_settempfree (&pts); + + FORALLfacets { + vertices = qh_facet3vertex (facet); + if (qh_setsize (vertices) == 3) { + Triangle tri; + int i = 0; + FOREACHvertex_(vertices) { + int id = qh_pointid(vertex->point); + tri[i++] = ptmap[id]; + } + mn.NewTri(tri.v1, tri.v2, tri.v3); + } + qh_settempfree(&vertices); + } + } + qh_freeqhull(!qh_ALL); + qh_memfreeshort (&curlong, &totlong); + delete[] points; + + mn.MakeConvex(); + mn.EliminateBadVerts(0); + mn.Triangulate(); + mn.OutToTri(outmesh); +} diff --git a/NifCommon/NifVersion.h b/NifCommon/NifVersion.h index 960849f59a8950c0ff01b1b60993bf0dd2392b67..72947907976864ffa5b51c79daa1583d3ef6d873 100644 --- a/NifCommon/NifVersion.h +++ b/NifCommon/NifVersion.h @@ -18,10 +18,10 @@ HISTORY: */ #define VERSION_MAJOR_INT 0 #define VERSION_MINOR_INT 2 -#define VERSION_BUILD_INT 12 +#define VERSION_BUILD_INT 13 #define VERSION_PATCH_INT 0 -#define VERSION_STRING "0, 2, 12, 0" +#define VERSION_STRING "0, 2, 13, 0" //#define DEF_VERSION_STRING(a,b,c,d) #a ", " #b ", " #c ", " #d //#define VERSION_STRING DEF_VERSION_STRING(a,b,c,d) diff --git a/NifCommon/niutils.cpp b/NifCommon/niutils.cpp index 9de013614f49638420093b12d9b835bd44338e19..5a9d6824079c7543e3b8528bcea6dc2e241e194c 100644 --- a/NifCommon/niutils.cpp +++ b/NifCommon/niutils.cpp @@ -1072,29 +1072,6 @@ void CallMaxscript(const TCHAR *s) pop_alloc_frame(); } -Modifier *GetbhkCollisionModifier(INode *node) -{ - const Class_ID BHKRIGIDBODYMODIFIER_CLASS_ID(0x398fd801, 0x303e44e5); - Object* pObj = node->GetObjectRef(); - if (!pObj) return NULL; - while (pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID) - { - IDerivedObject* pDerObj = (IDerivedObject *)(pObj); - int Idx = 0; - while (Idx < pDerObj->NumModifiers()) - { - // Get the modifier. - Modifier* mod = pDerObj->GetModifier(Idx); - if (mod->ClassID() == BHKRIGIDBODYMODIFIER_CLASS_ID) { - return mod; - } - Idx++; - } - pObj = pDerObj->GetObjRef(); - } - return NULL; -} - void GetIniFileName(char *iniName) { #if VERSION_3DSMAX >= ((5000<<16)+(15<<8)+0) // Version 5+ @@ -1135,4 +1112,55 @@ void GetIniFileName(char *iniName) MessageBox(NULL, "MaxNifTools could not find a valid INI. The plugin may not work correctly.\nPlease check for proper installation.", "MaxNifTools", MB_OK|MB_ICONWARNING); } +} + + +Modifier *GetbhkCollisionModifier(INode* node) +{ + extern Class_ID BHKRIGIDBODYMODIFIER_CLASS_ID; + + Object* pObj = node->GetObjectRef(); + if (!pObj) return NULL; + while (pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID) + { + IDerivedObject* pDerObj = (IDerivedObject *)(pObj); + int Idx = 0; + while (Idx < pDerObj->NumModifiers()) + { + // Get the modifier. + Modifier* mod = pDerObj->GetModifier(Idx); + if (mod->ClassID() == BHKRIGIDBODYMODIFIER_CLASS_ID) + { + return mod; + } + Idx++; + } + pObj = pDerObj->GetObjRef(); + } + return NULL; +} + +Modifier *CreatebhkCollisionModifier(INode* node, int type, HavokMaterial material) +{ + enum { havok_params }; + enum { PB_BOUND_TYPE, PB_MATERIAL, }; + extern Class_ID BHKRIGIDBODYMODIFIER_CLASS_ID; + + Modifier *rbMod = GetbhkCollisionModifier(node); + if (rbMod == NULL) + { + IDerivedObject *dobj = CreateDerivedObject(node->GetObjectRef()); + rbMod = (Modifier*) CreateInstance(OSM_CLASS_ID, BHKRIGIDBODYMODIFIER_CLASS_ID); + dobj->SetAFlag(A_LOCK_TARGET); + dobj->AddModifier(rbMod); + dobj->ClearAFlag(A_LOCK_TARGET); + node->SetObjectRef(dobj); + } + + if (IParamBlock2* pblock2 = rbMod->GetParamBlockByID(havok_params)) + { + pblock2->SetValue(PB_BOUND_TYPE, 0, type, 0); + pblock2->SetValue(PB_MATERIAL, 0, material, 0); + } + return rbMod; } \ No newline at end of file diff --git a/NifCommon/niutils.h b/NifCommon/niutils.h index bd1cda711caa094b0e94250ea13864aa687a5672..3c4611795c040f05026c152800234a947c2551cd 100644 --- a/NifCommon/niutils.h +++ b/NifCommon/niutils.h @@ -403,7 +403,8 @@ void CollapseGeomTransform(Niflib::NiTriBasedGeomRef shape); void CollapseGeomTransforms(std::vector<Niflib::NiTriBasedGeomRef>& shapes); void FixNormals(std::vector<Niflib::Triangle>& tris, std::vector<Niflib::Vector3>& verts, std::vector<Niflib::Vector3>& norms); -Modifier *GetbhkCollisionModifier(INode *node); +Modifier *GetbhkCollisionModifier(INode* node); +Modifier *CreatebhkCollisionModifier(INode* node, int type, Niflib::HavokMaterial material); void GetIniFileName(char *iniName); diff --git a/NifExport/Animation.cpp b/NifExport/Animation.cpp index f19e6eb09365210b951de88acf9c56a82cc118ff..c6a07f1fd1ad8ea8b3b6a1cc8df944603e5d41f7 100644 --- a/NifExport/Animation.cpp +++ b/NifExport/Animation.cpp @@ -651,7 +651,7 @@ NiTimeControllerRef Exporter::CreateController(INode *node, Interval range) AnimationExport ae(*this); if ( NiTimeControllerRef tc = ae.exportController(node, range, false) ) { if (Exporter::mExportType == Exporter::NIF_WO_KF && isNodeTracked(node)) { - NiNodeRef ninode = getNode(node->GetName()); + NiNodeRef ninode = getNode(node); vector<StringKey> textKeys; if (GetTextKeys(node, textKeys, range)) { NiTextKeyExtraDataRef textKeyData = new NiTextKeyExtraData(); @@ -711,7 +711,7 @@ NiTimeControllerRef AnimationExport::exportController(INode *node, Interval rang Vector3 trans = TOVECTOR3(tm.GetTrans()); Quaternion rot = TOQUAT( Quat(tm), true ); - NiNodeRef ninode = ne.getNode( node->GetName() ); + NiNodeRef ninode = ne.getNode(node); if (setTM) { trans = TOVECTOR3(tm.GetTrans()); rot = TOQUAT( Quat(tm), true ); diff --git a/NifExport/Coll.cpp b/NifExport/Coll.cpp index 83b33f943d58a7270f6d52c046bf4a1e97214ba5..7c655853c2918e6ffa8180268e27d5765eaf21b0 100755 --- a/NifExport/Coll.cpp +++ b/NifExport/Coll.cpp @@ -1,6 +1,10 @@ #include "pch.h" #include "../NifProps/bhkRigidBodyInterface.h" #include "obj/bhkListShape.h" +#include "obj/bhkConvexVerticesShape.h" +#include "..\NifProps\bhkHelperFuncs.h" +#include "..\NifProps\bhkHelperInterface.h" + #ifdef _DEBUG #include <assert.h> #include <crtdbg.h> @@ -10,8 +14,12 @@ #endif static Class_ID SCUBA_CLASS_ID(0x6d3d77ac, 0x79c939a9); -static Class_ID BHKRIGIDBODYMODIFIER_CLASS_ID(0x398fd801, 0x303e44e5); +extern Class_ID BHKRIGIDBODYMODIFIER_CLASS_ID; extern Class_ID BHKLISTOBJECT_CLASS_ID; +extern Class_ID bhkBoxObject_CLASS_ID; +extern Class_ID BHKCAPSULEOBJECT_CLASS_ID; +extern Class_ID bhkSphereObject_CLASS_ID; +extern Class_ID BHKPROXYOBJECT_CLASS_ID; enum { @@ -135,120 +143,6 @@ void Exporter::addFace(Triangles &tris, vector<Vector3> &verts, vector<Vector3> } tris.push_back(tri); } -/* -bool Exporter::makeCollisionHierarchy(NiNodeRef &parent, INode *node, TimeValue t) -{ - Matrix3 tm = node->GetObjTMAfterWSM(t); - - // Order of the vertices. Get 'em counter clockwise if the objects is - // negatively scaled. - int vi[3]; - if (TMNegParity(tm)) - { - vi[0] = 2; - vi[1] = 1; - vi[2] = 0; - } else - { - vi[0] = 0; - vi[1] = 1; - vi[2] = 2; - } - - ObjectState os = node->EvalWorldState(t); - if (!os.obj || os.obj->SuperClassID()!=GEOMOBJECT_CLASS_ID) - return Error; - - Object *obj = os.obj; - if (!obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0))) - return Error; - - TriObject *tri = (TriObject *)obj->ConvertToType(t, Class_ID(TRIOBJ_CLASS_ID, 0)); - if (!tri) - return false; - - Mesh *mesh = &tri->GetMesh(); - mesh->buildNormals(); - - // setup shape data - vector<Vector3> verts; - vector<Vector3> vnorms; - Triangles tris; - - for (int i=0; i<mesh->getNumFaces(); i++) - addFace(tris, verts, vnorms, i, vi, mesh); - - TriStrips strips; - strippify(strips, verts, vnorms, tris); - NiTriStripsDataRef data = makeTriStripsData(strips); - data->SetVertices(verts); - data->SetNormals(vnorms); - - // setup shape - bhkNiTriStripsShapeRef shape = DynamicCast<bhkNiTriStripsShape>(CreateBlock("bhkNiTriStripsShape")); - shape->SetNumStripsData(1); - shape->SetStripsData(0, data); - shape->SetMaterial(mtl); - - //array<float, 2> unknownFloats1; - //uint i1 = 0x3DCCCCCD; - //uint i2 = 0x004ABE60; - //unknownFloats1[0] = *((float*)&i1); - //unknownFloats1[1] = *((float*)&i2); - //shape->SetUnknownFloats1(unknownFloats1); - - //array<float, 3> unknownFloats2; - //unknownFloats2[0] = 1; - //unknownFloats2[1] = 1; - //unknownFloats2[2] = 1; - //shape->SetUnknownFloats2(unknownFloats2); - - //array<uint, 5> unknownInts1; - //unknownInts1[4] = 1; - //shape->SetUnknownInts1(unknownInts1); - - //vector<uint> unknownInts3; - //unknownInts3.resize(1); - //shape->SetUnknownInts3(unknownInts3); - - // setup collision object - bhkCollisionObjectRef co = DynamicCast<bhkCollisionObject>(CreateBlock("bhkCollisionObject")); - - // setup body - bhkRigidBodyTRef body = DynamicCast<bhkRigidBodyT>(CreateBlock("bhkRigidBodyT")); - - Vector3 trans; - QuaternionXYZW q; - nodeTransform(q, trans, node, t, false); - body->SetRotation(q); - body->SetTranslation(Vector3(trans.x/7, trans.y/7, trans.z/7)); - - body->SetLayer(lyr); - body->SetLayerCopy(lyr); - body->SetMotionSystem(msys); - body->SetQualityType(qtype); - body->SetMass(mass); - body->SetLinearDamping(lindamp); - body->SetAngularDamping(angdamp); - body->SetFriction(frict); - body->SetRestitution(resti); - body->SetMaxLinearVelocity(maxlinvel); - body->SetMaxAngularVelocity(maxangvel); - body->SetPenetrationDepth(pendepth); - body->SetCenter(center); - - // link - parent->SetCollisionObject(DynamicCast<NiCollisionObject>(co)); - co->SetParent(parent); - co->SetBody(DynamicCast<NiObject>(body)); - body->SetShape(DynamicCast<bhkShape>(shape)); - - if (obj != tri) - tri->DeleteMe(); - - return true; -} -*/ Exporter::Result Exporter::exportCollision(NiNodeRef &parent, INode *node) { @@ -275,11 +169,8 @@ Exporter::Result Exporter::exportCollision(NiNodeRef &parent, INode *node) Matrix3 tm = getTransform(node, t, local); bhkRigidBodyRef body = makeCollisionBody(node); - bhkShapeRef shape = makeCollisionShape(node, tm, body); - if (shape) + if (body) { - body->SetShape(DynamicCast<bhkShape>(shape)); - Matrix44 rm4 = TOMATRIX4(tm, false); Vector3 trans; Matrix33 rm; float scale; rm4.Decompose(trans, rm, scale); @@ -288,13 +179,19 @@ Exporter::Result Exporter::exportCollision(NiNodeRef &parent, INode *node) body->SetRotation(q); body->SetTranslation(trans / Exporter::bhkScaleFactor); - bhkCollisionObjectRef co = new bhkCollisionObject(); - co->SetBody(DynamicCast<NiObject>(body)); + bhkShapeRef shape = makeCollisionShape(node, tm, body); + if (shape) + { + body->SetShape(DynamicCast<bhkShape>(shape)); + + bhkCollisionObjectRef co = new bhkCollisionObject(); + co->SetBody(DynamicCast<NiObject>(body)); - //co->SetTarget(newParent); + //co->SetTarget(newParent); - // link - newParent->SetCollisionObject(DynamicCast<NiCollisionObject>(co)); + // link + newParent->SetCollisionObject(DynamicCast<NiCollisionObject>(co)); + } } } else if (isCollisionGroup(node) && !mFlattenHierarchy) { newParent = makeNode(nodeParent, node); @@ -405,6 +302,75 @@ bhkRigidBodyRef Exporter::makeCollisionBody(INode *node) return body; } +bhkNiTriStripsShapeRef Exporter::makeTriStripsShape(Mesh& mesh, Matrix3& sm) +{ + typedef vector<Triangle> Triangles; + + // setup shape data + vector<Vector3> verts; + vector<Vector3> vnorms; + Triangles tris; + + int vi[3]; + if (TMNegParity(sm)) { + vi[0] = 2; vi[1] = 1; vi[2] = 0; + } else { + vi[0] = 0; vi[1] = 1; vi[2] = 2; + } + + for (int i=0; i<mesh.getNumFaces(); i++) + addFace(tris, verts, vnorms, i, vi, &mesh, sm); + + NiTriStripsDataRef data = new NiTriStripsData(tris, Exporter::mUseAlternateStripper); + data->SetVertices(verts); + data->SetNormals(vnorms); + + //int lyr = OL_STATIC; + //npGetProp(node, NP_HVK_LAYER, lyr, NP_DEFAULT_HVK_LAYER); + + //int mtl; + //npGetProp(node, NP_HVK_MATERIAL, mtl, NP_DEFAULT_HVK_MATERIAL); + //shape->SetMaterial(HavokMaterial(mtl)); + + // setup shape + bhkNiTriStripsShapeRef shape = StaticCast<bhkNiTriStripsShape>(bhkNiTriStripsShape::Create()); + shape->SetNumStripsData(1); + shape->SetStripsData(0, data); + shape->SetNumDataLayers(1); + shape->SetOblivionLayer(0, OL_STATIC); + + //if (tri != os.obj) + // tri->DeleteMe(); + return shape; +} + +bhkConvexVerticesShapeRef Exporter::makeConvexShape(Mesh& mesh, Matrix3& tm) +{ + bhkConvexVerticesShapeRef shape = StaticCast<bhkConvexVerticesShape>(bhkConvexVerticesShape::Create()); + Point3 center(0.0f, 0.0f, 0.0f); + float radius = 0.0f; + CalcAxisAlignedSphere(mesh, center, radius); + shape->SetRadius(radius); + vector<Vector3> verts, norms; + vector<float> dist; + int nvert = mesh.getNumVerts(); + verts.resize(nvert); + norms.resize(nvert); + dist.resize(nvert); + for (int i=0; i<nvert; ++i) + { + Point3& vert = mesh.getVert(i); + verts[i] = TOVECTOR3(vert) / Exporter::bhkScaleFactor; + norms[i] = TOVECTOR3(mesh.getNormal(i)); + dist[i] = vert.Length(); + } + shape->SetVertices(verts); + shape->SetNormals(norms); + shape->SetDistToCenter(dist); + return shape; +} + + bhkShapeRef Exporter::makeCollisionShape(INode *node, Matrix3& tm, bhkRigidBodyRef body) { bhkShapeRef shape; @@ -417,10 +383,27 @@ bhkShapeRef Exporter::makeCollisionShape(INode *node, Matrix3& tm, bhkRigidBodyR shape = makeBoxShape(node, os.obj, tm); else if (os.obj->ClassID() == Class_ID(SPHERE_CLASS_ID, 0)) shape = makeSphereShape(node, os.obj, tm); - else if (os.obj->SuperClassID() == GEOMOBJECT_CLASS_ID) - shape = makeTriStripsShape(node, tm); + else if (os.obj->ClassID() == bhkBoxObject_CLASS_ID) + shape = makebhkBoxShape(node, os.obj, tm); + else if (os.obj->ClassID() == bhkSphereObject_CLASS_ID) + shape = makebhkSphereShape(node, os.obj, tm); + else if (os.obj->ClassID() == BHKCAPSULEOBJECT_CLASS_ID) + shape = makebhkCapsuleShape(node, os.obj, tm); else if (os.obj->ClassID() == BHKLISTOBJECT_CLASS_ID) shape = makeListShape(node, tm, body); + else if (os.obj->ClassID() == BHKPROXYOBJECT_CLASS_ID) + shape = makeProxyShape(node, os.obj, tm); + else if (os.obj->SuperClassID() == GEOMOBJECT_CLASS_ID) + { + if (Modifier* mod = GetbhkCollisionModifier(node)) + { + shape = makeModifierShape(node, os.obj, mod, tm); + } + else + { + shape = makeTriStripsShape(node, tm); + } + } return shape; } @@ -494,6 +477,55 @@ bhkShapeRef Exporter::makeCapsuleShape(INode *node, Object *obj, Matrix3& tm) return bhkShapeRef(DynamicCast<bhkSphereRepShape>(capsule)); } +bhkShapeRef Exporter::makebhkBoxShape(INode *node, Object *obj, Matrix3& tm) +{ + enum { box_params, }; + enum { PB_MATERIAL, PB_LENGTH, PB_WIDTH, PB_HEIGHT, }; + + bhkShapeRef retval; + if (IParamBlock2* pblock2 = obj->GetParamBlockByID(box_params)) + { + Point3 scale = GetScale(tm); + float s = (scale[0] + scale[1] + scale[2]) / 3.0; + + int mtl = 0, length = 0, width = 0, height = 0; + pblock2->GetValue(PB_MATERIAL, 0, mtl, FOREVER, 0); + pblock2->GetValue(PB_LENGTH, 0, length, FOREVER, 0); + pblock2->GetValue(PB_WIDTH, 0, width, FOREVER, 0); + pblock2->GetValue(PB_HEIGHT, 0, height, FOREVER, 0); + + + bhkBoxShapeRef box = new bhkBoxShape(); + Vector3 dim(width * scale[0], length * scale[1], height * scale[2]); + + // Adjust translation for center of z axis in box + tm.Translate(Point3(0.0, 0.0, dim.z / 2.0)); + + dim /= (Exporter::bhkScaleFactor * 2); + box->SetDimensions(dim); + + box->SetMaterial(HavokMaterial(mtl)); + retval = StaticCast<bhkShape>(box); + } + + return retval; +} + +bhkShapeRef Exporter::makebhkSphereShape(INode *node, Object *obj, Matrix3& tm) +{ + bhkShapeRef retval; + + return retval; +} + +bhkShapeRef Exporter::makebhkCapsuleShape(INode *node, Object *obj, Matrix3& tm) +{ + bhkShapeRef retval; + + return retval; +} + + bhkShapeRef Exporter::makeTriStripsShape(INode *node, Matrix3& tm) { TimeValue t = 0; @@ -503,50 +535,19 @@ bhkShapeRef Exporter::makeTriStripsShape(INode *node, Matrix3& tm) // Order of the vertices. Get 'em counter clockwise if the objects is // negatively scaled. - int vi[3]; - if (TMNegParity(tm)) - { - vi[0] = 2; - vi[1] = 1; - vi[2] = 0; - } else - { - vi[0] = 0; - vi[1] = 1; - vi[2] = 2; - } - ObjectState os = node->EvalWorldState(t); TriObject *tri = (TriObject *)os.obj->ConvertToType(t, Class_ID(TRIOBJ_CLASS_ID, 0)); if (!tri) return false; - Mesh *mesh = &tri->GetMesh(); - mesh->buildNormals(); - - // setup shape data - vector<Vector3> verts; - vector<Vector3> vnorms; - Triangles tris; + Mesh &mesh = tri->GetMesh(); + mesh.buildNormals(); - for (int i=0; i<mesh->getNumFaces(); i++) - addFace(tris, verts, vnorms, i, vi, mesh, sm); - - //TriStrips strips; - //strippify(strips, verts, vnorms, tris); - //NiTriStripsDataRef data = makeTriStripsData(strips); - NiTriStripsDataRef data = new NiTriStripsData(tris, Exporter::mUseAlternateStripper); - data->SetVertices(verts); - data->SetNormals(vnorms); + bhkNiTriStripsShapeRef shape = makeTriStripsShape(mesh, sm); int lyr = OL_STATIC; npGetProp(node, NP_HVK_LAYER, lyr, NP_DEFAULT_HVK_LAYER); - - // setup shape - bhkNiTriStripsShapeRef shape = StaticCast<bhkNiTriStripsShape>(bhkNiTriStripsShape::Create()); - shape->SetNumStripsData(1); - shape->SetStripsData(0, data); shape->SetNumDataLayers(1); shape->SetOblivionLayer(0, OblivionLayer(lyr)); @@ -554,11 +555,16 @@ bhkShapeRef Exporter::makeTriStripsShape(INode *node, Matrix3& tm) npGetProp(node, NP_HVK_MATERIAL, mtl, NP_DEFAULT_HVK_MATERIAL); shape->SetMaterial(HavokMaterial(mtl)); - //if (tri != os.obj) - // tri->DeleteMe(); return StaticCast<bhkShape>(shape); } +bhkShapeRef Exporter::makeConvexShape(INode *node, Object* obj, Matrix3& tm) +{ + bhkShapeRef shape; + + return shape; +} + Exporter::Result Exporter::scanForCollision(INode *node) { if (NULL == node) @@ -603,6 +609,14 @@ Exporter::Result Exporter::scanForCollision(INode *node) { mCollisionNodes.insert(node); } + else + { + Modifier* mod = GetbhkCollisionModifier(node); + if (mod != NULL) + { + mCollisionNodes.insert(node); + } + } } if (npIsCollision(node)) { @@ -633,6 +647,11 @@ bool Exporter::isCollision(INode *node) bhkShapeRef Exporter::makeListShape(INode *node, Matrix3& tm, bhkRigidBodyRef body) { + // reset transform + body->SetCenter(Vector3(0,0,0)); + body->SetTranslation(Vector3(0.0f,0.0f,0.0f)); + body->SetRotation(TOQUATXYZW(Quat(0.0f,0.0f,0.0f,1.0f))); + const int PB_MATERIAL = 0; const int PB_MESHLIST = 1; IParamBlock2* pblock2 = node->GetObjectRef()->GetParamBlockByID(0); @@ -696,4 +715,112 @@ bhkShapeRef Exporter::makeListShape(INode *node, Matrix3& tm, bhkRigidBodyRef bo } } return bhkShapeRef(); +} + +bhkShapeRef Exporter::makeProxyShape(INode *node, Object *obj, Matrix3& tm) +{ + enum { list_params, bv_mesh, }; // pblock2 ID + enum { PB_MATERIAL, PB_MESHLIST, PB_BOUND_TYPE, PB_CENTER, }; + enum { bv_type_none, bv_type_box, bv_type_shapes, bv_type_packed, bv_type_convex, }; // pblock ID + + bhkShapeRef shape; + if (IParamBlock2* pblock2 = obj->GetParamBlockByID(list_params)) + { + int bvType = bv_type_none; + pblock2->GetValue(PB_BOUND_TYPE, 0, bvType, FOREVER, 0); + if (bvType != bv_type_none) + { + if (TriObject *triObj = (TriObject *)obj->ConvertToType(0, triObjectClassID)) + { + Mesh& mesh = triObj->GetMesh(); + mesh.buildNormals(); + + switch (bvType) + { + case bv_type_box: + break; + + case bv_type_shapes: + case bv_type_packed: + break; + + case bv_type_convex: + Matrix3 tm(true); + if (bhkConvexVerticesShapeRef convShape = makeConvexShape(mesh, tm)) + { + int mtl = pblock2->GetInt(PB_MATERIAL, 0, 0); + convShape->SetMaterial(HavokMaterial(mtl)); + shape = StaticCast<bhkShape>(convShape); + } + break; + } + } + } + } + return shape; +} + +bhkShapeRef Exporter::makeModifierShape(INode *node, Object* obj, Modifier* mod, Matrix3& tm) +{ + enum { havok_params }; + enum { PB_BOUND_TYPE, PB_MATERIAL, }; + enum { bv_type_none, bv_type_box, bv_type_sphere, bv_type_capsule, bv_type_shapes, bv_type_convex, }; // pblock ID + + bhkShapeRef shape; + + const Mesh* mesh = NULL; + int material = NP_DEFAULT_HVK_MATERIAL; + int type = bv_type_none; + + if (bhkHelperInterface* bhkHelp = (bhkHelperInterface*)mod->GetInterface(BHKHELPERINTERFACE_DESC)) + { + mesh = bhkHelp->GetMesh(); + } + else + { + if (TriObject *tri = (TriObject *)obj->ConvertToType(0, Class_ID(TRIOBJ_CLASS_ID, 0))) + { + mesh = &tri->GetMesh(); + } + } + if (IParamBlock2* pblock2 = mod->GetParamBlockByID(havok_params)) + { + pblock2->GetValue(PB_BOUND_TYPE, 0, type, FOREVER, 0); + pblock2->GetValue(PB_MATERIAL, 0, material, FOREVER, 0); + } + switch (type) + { + default: + case bv_type_none: + break; + + case bv_type_box: + shape = makeBoxShape(node, obj, tm); + break; + + case bv_type_sphere: + shape = makeSphereShape(node, obj, tm); + break; + + case bv_type_capsule: + shape = makeCapsuleShape(node, obj, tm); + break; + + case bv_type_shapes: + if (bhkNiTriStripsShapeRef trishape = makeTriStripsShape(const_cast<Mesh&>(*mesh), tm)) + { + trishape->SetMaterial(HavokMaterial(material)); + shape = StaticCast<bhkShape>(trishape); + } + break; + + case bv_type_convex: + if (bhkConvexVerticesShapeRef convShape = makeConvexShape(const_cast<Mesh&>(*mesh), tm)) + { + convShape->SetMaterial(HavokMaterial(material)); + shape = StaticCast<bhkShape>(convShape); + } + break; + } + return shape; } \ No newline at end of file diff --git a/NifExport/Exporter.cpp b/NifExport/Exporter.cpp index 6ad3be81f5359ff72c92cf42edc4937b02def108..6580fb87fbc86c9dab3e42c6fb62a46e8f93efa2 100755 --- a/NifExport/Exporter.cpp +++ b/NifExport/Exporter.cpp @@ -154,7 +154,7 @@ Exporter::Result Exporter::doExport(NiNodeRef &root, INode *node) } // Fix Used Nodes that where never properly initialized. Happens normally during select export - for (NodeMap::iterator itr = mNodeMap.begin(); itr != mNodeMap.end(); ++itr) { + for (NodeMap::iterator itr = mNameMap.begin(); itr != mNameMap.end(); ++itr) { NiNodeRef bone = (*itr).second; if (bone->GetParent() == NULL) { if (INode* boneNode = mI->GetINodeByName((*itr).first.c_str())) { @@ -190,7 +190,7 @@ Exporter::Result Exporter::doExport(NiNodeRef &root, INode *node) return result; // Fix Used Nodes that where never properly initialized. Happens normally during select export - for (NodeMap::iterator itr = mNodeMap.begin(); itr != mNodeMap.end(); ++itr) { + for (NodeMap::iterator itr = mNameMap.begin(); itr != mNameMap.end(); ++itr) { NiNodeRef bone = (*itr).second; if (bone->GetParent() == NULL) { if (INode* boneNode = mI->GetINodeByName((*itr).first.c_str())) { diff --git a/NifExport/Exporter.h b/NifExport/Exporter.h index 12534e988fea357d750419724b5b9fbff4ed47b9..ccc0f99aafebfbf622de14b4687004f904b995f5 100755 --- a/NifExport/Exporter.h +++ b/NifExport/Exporter.h @@ -6,6 +6,10 @@ namespace Niflib class NiTimeController; class NiControllerManager; class NiControllerSequence; + + class bhkConvexVerticesShape; + class bhkNiTriStripsShape; + } using namespace Niflib; @@ -142,13 +146,15 @@ public: typedef std::map<int, FaceGroup> FaceGroups; typedef std::set<INode*> INodeMap; typedef std::map<string, NiNodeRef> NodeMap; + typedef std::map<INode*, NiNodeRef> NodeToNodeMap; typedef std::list<NiCallback*> CallbackList; typedef std::list<Ref<NiNode> > NodeList; Interface *mI; NiNodeRef mNiRoot; AppSettings *mAppSettings; - NodeMap mNodeMap; + NodeMap mNameMap; + NodeToNodeMap mNodeMap; INodeMap mCollisionNodes; INodeMap mHandledNodes; INode* mSceneCollisionNode; @@ -178,6 +184,7 @@ public: void getTextureMatrix(Matrix3 &mat, Mtl *mtl); NiNodeRef makeNode(NiNodeRef &parent, INode *maxNode, bool local=true); NiNodeRef getNode(const string& name); + NiNodeRef getNode(INode* maxNode); // returns true if the node contains collision objects bool isCollisionGroup(INode *maxNode, bool root=true); // returns true if the node contains meshes @@ -227,6 +234,15 @@ public: bhkShapeRef makeSphereShape(INode *node, Object *obj, Matrix3& tm); bhkShapeRef makeCapsuleShape(INode *node, Object *obj, Matrix3& tm); bhkShapeRef makeListShape(INode *node, Matrix3& tm, bhkRigidBodyRef body); + bhkShapeRef makebhkBoxShape(INode *node, Object *obj, Matrix3& tm); + bhkShapeRef makebhkSphereShape(INode *node, Object *obj, Matrix3& tm); + bhkShapeRef makebhkCapsuleShape(INode *node, Object *obj, Matrix3& tm); + bhkShapeRef makeProxyShape(INode *node, Object *obj, Matrix3& tm); + bhkShapeRef makeConvexShape(INode *node, Object* obj, Matrix3& tm); + bhkShapeRef makeModifierShape(INode *node, Object* obj, Modifier* mod, Matrix3& tm); + + Ref<bhkConvexVerticesShape> makeConvexShape(Mesh& mesh, Matrix3& tm); + Ref<bhkNiTriStripsShape> makeTriStripsShape(Mesh& mesh, Matrix3& sm); /* skin export */ bool makeSkin(NiTriBasedGeomRef shape, INode *node, FaceGroup &grp, TimeValue t); diff --git a/NifExport/Mesh.cpp b/NifExport/Mesh.cpp index ddeac52119fda00a1fa536840c8c5f6c78d6e5ff..f36fcf72feb874e0920d2cf2186416c0294c63b4 100755 --- a/NifExport/Mesh.cpp +++ b/NifExport/Mesh.cpp @@ -379,8 +379,7 @@ bool Exporter::makeSkin(NiTriBasedGeomRef shape, INode *node, FaceGroup &grp, Ti si->boneWeights.resize(totalBones); si->boneList.resize(totalBones); for (int i=0; i<totalBones; ++i) { - string name = skin->GetBone(i)->GetName(); - si->boneList[i] = getNode(name); + si->boneList[i] = getNode(skin->GetBone(i)); } vector<int>& vidx = grp.vidx; @@ -464,7 +463,7 @@ static void FillBoneController(Exporter* exporter, NiBSBoneLODControllerRef bone int group = 0; std::stringstream str (*token); str >> group; - boneCtrl->AddNodeToGroup(group, exporter->getNode(child->GetName())); + boneCtrl->AddNodeToGroup(group, exporter->getNode(child)); } } } diff --git a/NifExport/MtlTex.cpp b/NifExport/MtlTex.cpp index 587ab656ee6ec70849e4302753d674cdb331480f..c6d66b83b98002902f03e695f1a05f58c9a774f9 100755 --- a/NifExport/MtlTex.cpp +++ b/NifExport/MtlTex.cpp @@ -9,6 +9,8 @@ #include "obj/NiVertexColorProperty.h" #include "obj/NiDitherProperty.h" #include "obj/NiSpecularProperty.h" +#include "obj/NiTextureProperty.h" +#include "obj/NiImage.h" void Exporter::makeTexture(NiAVObjectRef &parent, Mtl *mtl) { @@ -16,16 +18,42 @@ void Exporter::makeTexture(NiAVObjectRef &parent, Mtl *mtl) if (!bmTex) return; - NiTexturingPropertyRef texProp = CreateNiObject<NiTexturingProperty>(); - texProp->SetApplyMode(APPLY_MODULATE); - texProp->SetTextureCount(7); - - TexDesc td; - if (makeTextureDesc(bmTex, td)) - texProp->SetTexture(BASE_MAP, td); - - NiPropertyRef prop = DynamicCast<NiProperty>(texProp); - parent->AddProperty(prop); + if (Exporter::mNifVersionInt <= VER_4_0_0_0) + { + NiTexturingPropertyRef texProp = CreateNiObject<NiTexturingProperty>(); + texProp->SetApplyMode(APPLY_MODULATE); + texProp->SetTextureCount(7); + + TexDesc td; + if (makeTextureDesc(bmTex, td)) + texProp->SetTexture(BASE_MAP, td); + + NiPropertyRef prop = DynamicCast<NiProperty>(texProp); + parent->AddProperty(prop); + } + else + { + NiTexturePropertyRef texProp = CreateNiObject<NiTextureProperty>(); + NiImageRef imgProp = CreateNiObject<NiImage>(); + texProp->SetImage(imgProp); + + // Get file name and check if it matches the "app" settings in the ini file + TSTR mapPath = bmTex->GetMapName(); + if (mAppSettings) + { + string newPath = mAppSettings->GetRelativeTexPath(string(mapPath), mTexPrefix); + imgProp->SetExternalTexture(newPath); + } + else + { + TSTR p, f; + SplitPathFile(mapPath, &p, &f); + TSTR newPath = (mTexPrefix == "") ? f : (TSTR(mTexPrefix.c_str()) + _T("\\") + f); + imgProp->SetExternalTexture(newPath.data()); + } + NiPropertyRef prop = DynamicCast<NiProperty>(texProp); + parent->AddProperty(prop); + } } bool Exporter::makeTextureDesc(BitmapTex *bmTex, TexDesc& td) diff --git a/NifExport/Util.cpp b/NifExport/Util.cpp index a41ef3a87b0401d79c7d3c6fcf0d756c119ec9ab..196da242655d5e3d602ec5054f2bcd6c487169a7 100755 --- a/NifExport/Util.cpp +++ b/NifExport/Util.cpp @@ -103,21 +103,34 @@ bool Exporter::equal(const Vector3 &a, const Point3 &b, float thresh) (fabsf(a.z-b.z) <= thresh); } +NiNodeRef Exporter::getNode(INode* maxNode) +{ + string name = maxNode->GetName(); + + NodeToNodeMap::iterator itr = mNodeMap.find(maxNode); + if (itr != mNodeMap.end()) + return (*itr).second; + NiNodeRef node = CreateNiObject<NiNode>(); + node->SetName(name); + mNodeMap[maxNode] = node; + mNameMap[name] = node; + return node; +} NiNodeRef Exporter::getNode(const string& name) { - NodeMap::iterator itr = mNodeMap.find(name); - if (itr != mNodeMap.end()) + NodeMap::iterator itr = mNameMap.find(name); + if (itr != mNameMap.end()) return (*itr).second; NiNodeRef node = CreateNiObject<NiNode>(); node->SetName(name); - mNodeMap[name] = node; + mNameMap[name] = node; return node; } NiNodeRef Exporter::makeNode(NiNodeRef &parent, INode *maxNode, bool local) { string name = (char*)maxNode->GetName(); - NiNodeRef node = getNode(name); + NiNodeRef node = getNode(maxNode); Matrix33 rot; Vector3 trans; diff --git a/NifImport/ImportCollision.cpp b/NifImport/ImportCollision.cpp index f5f66046370b1dc45a567367b5bb2b7205a07f5c..719467ab1ad4c2b54541ff25beab890a90a39cbe 100644 --- a/NifImport/ImportCollision.cpp +++ b/NifImport/ImportCollision.cpp @@ -29,6 +29,8 @@ HISTORY: using namespace Niflib; extern Class_ID BHKLISTOBJECT_CLASS_ID; +extern Class_ID BHKRIGIDBODYMODIFIER_CLASS_ID; + static Class_ID SCUBA_CLASS_ID(0x6d3d77ac, 0x79c939a9); enum { @@ -65,6 +67,8 @@ struct CollisionImport const vector<Vector3>& norms, INode *parent ); + + enum { bv_type_none, bv_type_box, bv_type_sphere, bv_type_capsule, bv_type_shapes, bv_type_convex, }; // pblock ID }; bool NifImporter::ImportCollision(NiNodeRef node) @@ -87,7 +91,7 @@ bool NifImporter::ImportCollision(NiNodeRef node) if (ignoreRootNode || strmatch(target->GetName(), "Scene Root")) node = gi->GetRootNode(); else - node = FindINode(gi, target); + node = FindNode(target); CollisionImport ci(*this); INode *body = ci.CreateRigidBody(rbody); @@ -179,7 +183,7 @@ INode* CollisionImport::CreateRigidBody(bhkRigidBodyRef body) body->SetPenetrationDepth(pendepth); body->SetCenter(center); } - + RefTargetHandle t = listObj->GetReference(0); if (INode *n = ni.gi->CreateObjectNode(listObj)) { Point3 startPos(0.0,0.0,0.0); Quat q; q.Identity(); @@ -331,6 +335,8 @@ bool CollisionImport::ImportSphere(INode *rbody, bhkRigidBodyRef body, bhkSphere // Need to "Affect Pivot Only" and "Center to Object" first n->CenterPivot(0, FALSE); #endif + CreatebhkCollisionModifier(n, bv_type_sphere, shape->GetMaterial()); + ImportBase(body, shape, parent, n); AddShape(rbody, n); return true; @@ -341,6 +347,7 @@ bool CollisionImport::ImportSphere(INode *rbody, bhkRigidBodyRef body, bhkSphere bool CollisionImport::ImportBox(INode *rbody, bhkRigidBodyRef body, bhkBoxShapeRef shape, INode *parent) { + //CreatebhkCollisionModifier(inode, bv_type_box, shape->GetMaterial()); return false; } @@ -361,16 +368,17 @@ bool CollisionImport::ImportCapsule(INode *rbody, bhkRigidBodyRef body, bhkCapsu params->SetValue(ob->GetParamBlockIndex(CAPSULE_HEIGHT), 0, height); params->SetValue(ob->GetParamBlockIndex(CAPSULE_CENTERS), 0, heighttype); - if (INode *n = ni.gi->CreateObjectNode(ob)) { - // Need to "Affect Pivot Only" and "Center to Object" first - //n->CenterPivot(0, FALSE); + if (INode *n = ni.gi->CreateObjectNode(ob)) { + // Need to "Affect Pivot Only" and "Center to Object" first + //n->CenterPivot(0, FALSE); - // Need to reposition the Capsule so that caps are rotated correctly for pts given + // Need to reposition the Capsule so that caps are rotated correctly for pts given + CreatebhkCollisionModifier(n, bv_type_capsule, shape->GetMaterial()); ImportBase(body, shape, parent, n); AddShape(rbody, n); - return true; - } + return true; + } } return true; } @@ -386,6 +394,7 @@ bool CollisionImport::ImportConvexVertices(INode *rbody, bhkRigidBodyRef body, b vector<Triangle> tris = compute_convex_hull(verts); returnNode = ImportCollisionMesh(verts, tris, norms, parent); + CreatebhkCollisionModifier(returnNode, bv_type_convex, shape->GetMaterial()); ImportBase(body, shape, parent, returnNode); AddShape(rbody, returnNode); return true; @@ -426,6 +435,7 @@ bool CollisionImport::ImportTriStripsShape(INode *rbody, bhkRigidBodyRef body, b vector<Triangle> tris = triShapeData->GetTriangles(); ni.ImportMesh(node, triObject, triShape, triShapeData, tris); + CreatebhkCollisionModifier(inode, bv_type_shapes, shape->GetMaterial()); ImportBase(body, shape, parent, inode); AddShape(rbody, inode); return true; @@ -454,6 +464,7 @@ bool CollisionImport::ImportPackedNiTriStripsShape(INode *rbody, bhkRigidBodyRef vector<Vector3> norms = data->GetNormals(); INode *inode = ImportCollisionMesh(verts, tris, norms, parent); + CreatebhkCollisionModifier(inode, bv_type_shapes, HavokMaterial(NP_DEFAULT_HVK_MATERIAL)); ImportBase(body, shape, parent, inode); AddShape(rbody, inode); return true; diff --git a/NifImport/ImportLights.cpp b/NifImport/ImportLights.cpp index ed67650a86f94d7ef238d12ee1468c2b32782561..c9c546dcd955198e8449a3dc63def73935b17250 100644 --- a/NifImport/ImportLights.cpp +++ b/NifImport/ImportLights.cpp @@ -109,6 +109,8 @@ bool NifImporter::ImportLights(vector<NiLightRef> lights) PosRotScaleNode(n, p, q, scale, prsDefault); n->Hide(light->GetVisibility() ? FALSE : TRUE ); + + RegisterNode(light, n); } ok = true; } diff --git a/NifImport/ImportMeshAndSkin.cpp b/NifImport/ImportMeshAndSkin.cpp index 321c323cb4f07964532fa4eb8f175ac1f7dc269f..6d674d300b7594ab7859b1a5b377a4f78845154c 100644 --- a/NifImport/ImportMeshAndSkin.cpp +++ b/NifImport/ImportMeshAndSkin.cpp @@ -131,6 +131,7 @@ bool NifImporter::ImportMesh(ImpNode *node, TriObject *o, NiTriBasedGeomRef triG mesh.AutoSmooth(TORAD(autoSmoothAngle), FALSE, FALSE); } + RegisterNode(triGeom, inode); return true; } @@ -628,9 +629,7 @@ bool NifImporter::ImportSkin(ImpNode *node, NiTriBasedGeomRef triGeom, int v_sta Tab<INode*> bones; for (size_t i=0; i<nifBones.size(); ++i){ NiNodeRef bone = nifBones[i]; - - string name = bone->GetName(); - if (INode *boneRef = gi->GetINodeByName(name.c_str())) { + if (INode *boneRef = FindNode(bone)) { bones.Append(1, &boneRef); iskinImport->AddBoneEx(boneRef, TRUE); diff --git a/NifImport/ImportMtlAndTex.cpp b/NifImport/ImportMtlAndTex.cpp index 7664618449e377588d3b7d907336987e03d69fb6..2106e04ae38ba77266c21dfac3ed0859da1f01d8 100644 --- a/NifImport/ImportMtlAndTex.cpp +++ b/NifImport/ImportMtlAndTex.cpp @@ -20,6 +20,8 @@ HISTORY: #include "obj/NiVertexColorProperty.h" #include "obj/NiDitherProperty.h" #include "obj/NiSpecularProperty.h" +#include "obj/NiTextureProperty.h" +#include "obj/NiImage.h" #include "objectParams.h" using namespace Niflib; @@ -80,12 +82,44 @@ Texmap* NifImporter::CreateTexture(TexDesc& desc) return NULL; } +Texmap* NifImporter::CreateTexture(NiTexturePropertyRef texSrc) +{ + BitmapManager *bmpMgr = TheManager; + if (NiImageRef imgRef = texSrc->GetImage()) { + string filename = imgRef->GetTextureFileName(); + if (bmpMgr->CanImport(filename.c_str())){ + BitmapTex *bmpTex = NewDefaultBitmapTex(); + string name = texSrc->GetName(); + if (name.empty()) { + TCHAR buffer[MAX_PATH]; + _tcscpy(buffer, PathFindFileName(filename.c_str())); + PathRemoveExtension(buffer); + name = buffer; + } + bmpTex->SetName(name.c_str()); + bmpTex->SetMapName(const_cast<TCHAR*>(FindImage(filename).c_str())); + bmpTex->SetAlphaAsMono(TRUE); + bmpTex->SetAlphaSource(ALPHA_DEFAULT); + + bmpTex->SetFilterType(FILTER_PYR); + + if (UVGen *uvGen = bmpTex->GetTheUVGen()){ + uvGen->SetTextureTiling(0); + } + + return bmpTex; + } + } + return NULL; +} + StdMat2 *NifImporter::ImportMaterialAndTextures(ImpNode *node, NiAVObjectRef avObject) { // Texture NiMaterialPropertyRef matRef = avObject->GetPropertyByType(NiMaterialProperty::TYPE); if (matRef != NULL){ NiTexturingPropertyRef texRef = avObject->GetPropertyByType(NiTexturingProperty::TYPE); + NiTexturePropertyRef tex2Ref = avObject->GetPropertyByType(NiTextureProperty::TYPE); NiWireframePropertyRef wireRef = avObject->GetPropertyByType(NiWireframeProperty::TYPE); NiAlphaPropertyRef alphaRef = avObject->GetPropertyByType(NiAlphaProperty::TYPE); NiStencilPropertyRef stencilRef = avObject->GetPropertyByType(NiStencilProperty::TYPE); @@ -162,6 +196,13 @@ StdMat2 *NifImporter::ImportMaterialAndTextures(ImpNode *node, NiAVObjectRef avO m->SetSubTexmap(ID_SI, tex); } } + if (NULL != tex2Ref) + { + // Handle Base/Detail ??? + if (Texmap* tex = CreateTexture(tex2Ref)) { + m->SetSubTexmap(ID_DI, tex); + } + } return m; } return NULL; diff --git a/NifImport/ImportSkeleton.cpp b/NifImport/ImportSkeleton.cpp index 960529025b3eeafcc3d03fb239c5abf81221c7df..8d6448e0cce9a80e616a5420e61ba74b574ce6dd 100644 --- a/NifImport/ImportSkeleton.cpp +++ b/NifImport/ImportSkeleton.cpp @@ -401,7 +401,7 @@ void NifImporter::AlignBiped(IBipMaster* master, NiNodeRef node) TSTR s1 = FormatText("Processing %s:", name.c_str()); TSTR s2 = FormatText("Processing %s:", name.c_str()); - INode *bone = gi->GetINodeByName(name.c_str()); + INode *bone = GetNode(node); if (bone != NULL) { if (uncontrolledDummies) @@ -425,7 +425,7 @@ void NifImporter::AlignBiped(IBipMaster* master, NiNodeRef node) { // Reparent if necessary if (!strmatch(parent->GetName(), pnode->GetName())) { - if (pnode = gi->GetINodeByName(parent->GetName().c_str())) { + if (pnode = FindNode(parent)) { bone->Detach(0); pnode->AttachChild(bone); } @@ -640,7 +640,14 @@ void NifImporter::ImportBones(NiNodeRef node, bool recurse) } Point3 pp(ppos.x, ppos.y, ppos.z); - INode *bone = gi->GetINodeByName(name.c_str()); + + INode *bone = NULL; + if (!doNotReuseExistingBones) // Games like BC3 reuse the same bone names + { + bone = FindNode(node); + if (bone == NULL) + bone = gi->GetINodeByName(name.c_str()); + } if (bone) { // Is there a better way of "Affect Pivot Only" behaviors? @@ -681,6 +688,7 @@ void NifImporter::ImportBones(NiNodeRef node, bool recurse) if (INode *pn = gi->GetINodeByName(parentname.c_str())) pn->AttachChild(bone, 1); } + RegisterNode(node, bone); } } // Import UPB diff --git a/NifImport/KFMImporter.cpp b/NifImport/KFMImporter.cpp index dd02b8259f9878b63ac1b6f236394053d1776ace..2d5eedf12b67d6acf7a2fd0e24783f5c4d14578d 100644 --- a/NifImport/KFMImporter.cpp +++ b/NifImport/KFMImporter.cpp @@ -83,7 +83,7 @@ bool KFMImporter::DoImport() int n = nodes.size(); int m = 0; for (vector<NiNodeRef>::iterator itr = nodes.begin(), end = nodes.end(); itr != end; ++itr) { - if (INode *p = gi->GetINodeByName((*itr)->GetName().c_str())) + if (INode *p = FindNode(*itr)) m++; } if (m != n) { diff --git a/NifImport/MaxNifImport.h b/NifImport/MaxNifImport.h index 303e3d7e2b9ee2d5f52efa636a21c0c3959fe577..83fff4b18ff6d436ab41605acea6abdf43e31a52 100644 --- a/NifImport/MaxNifImport.h +++ b/NifImport/MaxNifImport.h @@ -55,6 +55,7 @@ #include "obj\NiSkinInstance.h" #include "obj\NiSkinPartition.h" #include "obj\NiLight.h" +#include "obj\NiTextureProperty.h" #include "niutils.h" #include "AppSettings.h" diff --git a/NifImport/NIFImport.cpp b/NifImport/NIFImport.cpp index e56b2ea4c069d07401c214411aba37bd48adfce9..b6de40945d7e8e81285a4f2379e17fed22eb1ec4 100644 --- a/NifImport/NIFImport.cpp +++ b/NifImport/NIFImport.cpp @@ -205,6 +205,8 @@ void NifImporter::ApplyAppSettings() if (!appSettings->rotate90Degrees.empty()) rotate90Degrees = appSettings->rotate90Degrees; supportPrnStrings = appSettings->supportPrnStrings; + + doNotReuseExistingBones = appSettings->doNotReuseExistingBones; } } @@ -238,11 +240,26 @@ void NifImporter::SaveIniSettings() SetIniValue<string>(NifImportSection, "CurrentApp", autoDetect ? "AUTO" : appSettings->Name ); } +void NifImporter::RegisterNode(Niflib::NiObjectNETRef node, INode* inode) +{ + nodeMap[node] = inode; +} + +INode* NifImporter::FindNode(Niflib::NiObjectNETRef node) +{ + // may want to make this a map if its hit a lot + if (NULL == node) return NULL; + + NodeToNodeMap::iterator itr = nodeMap.find(node); + if (itr != nodeMap.end()) + return (*itr).second; + + return gi->GetINodeByName(node->GetName().c_str()); +} + INode *NifImporter::GetNode(Niflib::NiNodeRef node) { - // may want to make this a map if its hit a lot - if (NULL == node) return NULL; - return gi->GetINodeByName(node->GetName().c_str()); + return FindNode(node); } bool NifImporter::DoImport() @@ -285,13 +302,15 @@ bool NifImporter::DoImport() if (root->IsDerivedType(NiNode::TYPE)) { NiNodeRef rootNode = root; - - if (importBones) { - if (ignoreRootNode || strmatch(rootNode->GetName(), "Scene Root")) - ImportBones(DynamicCast<NiNode>(rootNode->GetChildren())); - else - ImportBones(rootNode); - } + RegisterNode(root, gi->GetRootNode()); + + if (importBones) { + if (ignoreRootNode || strmatch(rootNode->GetName(), "Scene Root")) { + ImportBones(DynamicCast<NiNode>(rootNode->GetChildren())); + } else { + ImportBones(rootNode); + } + } if (enableLights){ diff --git a/NifImport/NIFImporter.h b/NifImport/NIFImporter.h index 6931ab65dd82766d7f8fbd125ee4edfc12e580a0..6a601f8151b4bdcff0af2b05a2d3d81e5cad8d43 100644 --- a/NifImport/NIFImporter.h +++ b/NifImport/NIFImporter.h @@ -42,6 +42,7 @@ public: bool enableLights; bool enableCameras; bool importUPB; + bool doNotReuseExistingBones; // Biped/Bones related settings bool importBones; @@ -87,6 +88,9 @@ public: vector<Niflib::NiNodeRef> nodes; map<string,int> ctrlCount; // counter for number of controllers referencing a node + typedef map<Niflib::NiObjectNETRef, INode*> NodeToNodeMap; + NodeToNodeMap nodeMap; + NifImporter(const TCHAR *Name,ImpInterface *I,Interface *GI, BOOL SuppressPrompts); virtual void Initialize(); virtual void ReadBlocks(); @@ -123,6 +127,7 @@ public: bool ImportVertexColor(INode *tnode, TriObject *o, vector<Niflib::Triangle>& tris, vector<Niflib::Color4> cv, int cv_offset=0); bool ImportSkin(ImpNode *node, Niflib::NiTriBasedGeomRef triGeom, int v_start=0); Texmap* CreateTexture(Niflib::TexDesc& desc); + Texmap* CreateTexture(Niflib::NiTexturePropertyRef desc); INode *CreateBone(const string& name, Point3 startPos, Point3 endPos, Point3 zAxis); INode *CreateHelper(const string& name, Point3 startPos); INode *CreateCamera(const string& name); @@ -133,6 +138,9 @@ public: // Primary Collision entry point. Tests for bhk objects bool ImportCollision(Niflib::NiNodeRef node); + void RegisterNode(Niflib::NiObjectNETRef node, INode* inode); + INode *FindNode(Niflib::NiObjectNETRef node); + INode *GetNode(Niflib::NiNodeRef node); string GetSkeleton(AppSettings *appSettings); diff --git a/NifPlugins/DllEntry.cpp b/NifPlugins/DllEntry.cpp index ebec13ffd1843783db7933f4da91c696a290bbfc..732cf6b80880b12b9c4e61857995d2945fc0660a 100644 --- a/NifPlugins/DllEntry.cpp +++ b/NifPlugins/DllEntry.cpp @@ -22,6 +22,7 @@ extern ClassDesc2* GetbhkRigidBodyModifierDesc(); extern ClassDesc2* GetbhkBoxDesc(); extern ClassDesc* GetDDSLibClassDesc(); extern ClassDesc2* GetbhkListObjDesc(); +extern ClassDesc2* GetbhkProxyObjDesc(); enum ClassDescType @@ -88,6 +89,7 @@ void InitializeLibSettings() classDescEnabled[CD_Props] = true; classDescriptions[nClasses++] = GetNifPropsDesc(); classDescriptions[nClasses++] = GetbhkListObjDesc(); + classDescriptions[nClasses++] = GetbhkProxyObjDesc(); #ifdef USE_UNSUPPORTED_CODE classDescriptions[nClasses++] = GetbhkRigidBodyModifierDesc(); classDescriptions[nClasses++] = GetbhkSphereDesc(); diff --git a/NifPlugins_VC80.vcproj b/NifPlugins_VC80.vcproj index 1ae10baefee2e46e2b537edd1a650f8b440d0e97..d1272593e63e6adfcfbad44f0a0534568c339ea1 100644 --- a/NifPlugins_VC80.vcproj +++ b/NifPlugins_VC80.vcproj @@ -81,7 +81,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax6\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -124,8 +124,8 @@ </Configuration> <Configuration Name="Release - Max 6|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -185,7 +185,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax6\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -291,7 +291,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax6\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -331,8 +331,8 @@ </Configuration> <Configuration Name="Debug - Max 6|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -392,7 +392,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax6\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -495,7 +495,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax7\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -538,8 +538,8 @@ </Configuration> <Configuration Name="Release - Max 7|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -599,7 +599,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax7\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -705,7 +705,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax7\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -745,8 +745,8 @@ </Configuration> <Configuration Name="Debug - Max 7|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -806,7 +806,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax7\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -909,7 +909,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax8\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -952,8 +952,8 @@ </Configuration> <Configuration Name="Release - Max 8|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -1013,7 +1013,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax8\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -1119,7 +1119,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax8\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -1159,8 +1159,8 @@ </Configuration> <Configuration Name="Debug - Max 8|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -1220,7 +1220,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax8\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -1324,7 +1324,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax5\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -1364,8 +1364,8 @@ </Configuration> <Configuration Name="Debug - Max 5|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -1426,7 +1426,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax5\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -1529,7 +1529,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax5\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -1572,8 +1572,8 @@ </Configuration> <Configuration Name="Release - Max 5|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -1633,7 +1633,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax5\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -1740,7 +1740,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax9\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -1780,8 +1780,8 @@ </Configuration> <Configuration Name="Debug - Max 9|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -1842,7 +1842,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax9\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -1945,7 +1945,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax9\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -1988,8 +1988,8 @@ </Configuration> <Configuration Name="Release - Max 9|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -2049,7 +2049,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax9\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -2155,7 +2155,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax4\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -2198,8 +2198,8 @@ </Configuration> <Configuration Name="Release - Max 4|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -2259,7 +2259,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax4\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -2366,7 +2366,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax4\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -2406,8 +2406,8 @@ </Configuration> <Configuration Name="Debug - Max 4|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -2468,7 +2468,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax4\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -2572,7 +2572,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\gmax12\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -2612,8 +2612,8 @@ </Configuration> <Configuration Name="Debug - gmax|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -2674,7 +2674,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\gmax12\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -2777,7 +2777,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\gmax12\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -2820,8 +2820,8 @@ </Configuration> <Configuration Name="Release - gmax|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -2881,7 +2881,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\gmax12\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -2988,7 +2988,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax42\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -3028,8 +3028,8 @@ </Configuration> <Configuration Name="Debug - Max 4.2|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -3090,7 +3090,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax42\plugins\NifPlugins.dlu" LinkIncremental="2" SuppressStartupBanner="true" @@ -3193,7 +3193,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax42\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -3236,8 +3236,8 @@ </Configuration> <Configuration Name="Release - Max 4.2|x64" - OutputDirectory="$(SolutionDir)Staging\$(PlatformName)\$(ConfigurationName)\" - IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(PlatformName)\$(ConfigurationName)\" + OutputDirectory="$(SolutionDir)Staging\$(ConfigurationName) $(PlatformName)\" + IntermediateDirectory="$(SolutionDir)Temp\$(ProjectName)\$(ConfigurationName) $(PlatformName)\" ConfigurationType="2" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" UseOfMFC="0" @@ -3297,7 +3297,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib shlwapi.lib core.lib geom.lib gfx.lib mesh.lib maxutil.lib maxscrpt.lib paramblk2.lib bmm.lib mnmath.lib" OutputFile="C:\3dsmax42\plugins\NifPlugins.dlu" LinkIncremental="1" SuppressStartupBanner="true" @@ -3349,6 +3349,10 @@ <Filter Name="Header Files" > + <File + RelativePath=".\NifProps\bhkHelperInterface.h" + > + </File> <File RelativePath=".\NifProps\bhkRigidBodyInterface.h" > @@ -3377,10 +3381,26 @@ RelativePath=".\NifProps\bhkCapsuleObj.cpp" > </File> + <File + RelativePath=".\NifProps\bhkHelperFuncs.cpp" + > + </File> + <File + RelativePath=".\NifProps\bhkHelperFuncs.h" + > + </File> + <File + RelativePath=".\NifProps\bhkHelperInterface.cpp" + > + </File> <File RelativePath=".\NifProps\bhkListObj.cpp" > </File> + <File + RelativePath=".\NifProps\bhkProxyObj.cpp" + > + </File> <File RelativePath=".\NifProps\bhkRigidBodyInterface.cpp" > @@ -4930,26 +4950,6 @@ <Filter Name="NifExport" > - <Filter - Name="Header Files" - > - <File - RelativePath=".\NifExport\Exporter.h" - > - </File> - <File - RelativePath=".\NifExport\NifExport.h" - > - </File> - <File - RelativePath=".\NifExport\pch.h" - > - </File> - <File - RelativePath=".\NifExport\resource.h" - > - </File> - </Filter> <Filter Name="Source Files" > @@ -5133,1189 +5133,2606 @@ > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 6|Win32" + Name="Release - Max 6|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 7|Win32" + Name="Debug - Max 6|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 7|Win32" + Name="Debug - Max 6|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 8|Win32" + Name="Release - Max 7|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 8|Win32" + Name="Release - Max 7|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 5|Win32" + Name="Debug - Max 7|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 5|Win32" + Name="Debug - Max 7|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 9|Win32" + Name="Release - Max 8|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 9|Win32" + Name="Release - Max 8|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4|Win32" + Name="Debug - Max 8|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4|Win32" + Name="Debug - Max 8|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - gmax|Win32" + Name="Debug - Max 5|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - gmax|Win32" + Name="Debug - Max 5|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4.2|Win32" + Name="Release - Max 5|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4.2|Win32" + Name="Release - Max 5|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> - </File> - <File - RelativePath=".\NifCommon\qhull\geom.h" - > - </File> - <File - RelativePath=".\NifCommon\qhull\geom2.c" - > <FileConfiguration - Name="Release - Max 6|Win32" + Name="Debug - Max 9|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 6|Win32" + Name="Debug - Max 9|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 7|Win32" + Name="Release - Max 9|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 7|Win32" + Name="Release - Max 9|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 8|Win32" + Name="Release - Max 4|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 8|Win32" + Name="Release - Max 4|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 5|Win32" + Name="Debug - Max 4|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 5|Win32" + Name="Debug - Max 4|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 9|Win32" + Name="Debug - gmax|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 9|Win32" + Name="Debug - gmax|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4|Win32" + Name="Release - gmax|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4|Win32" + Name="Release - gmax|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - gmax|Win32" + Name="Debug - Max 4.2|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - gmax|Win32" + Name="Debug - Max 4.2|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4.2|Win32" + Name="Release - Max 4.2|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4.2|Win32" + Name="Release - Max 4.2|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> </File> <File - RelativePath=".\NifCommon\qhull\global.c" + RelativePath=".\NifCommon\qhull\geom.h" + > + </File> + <File + RelativePath=".\NifCommon\qhull\geom2.c" > <FileConfiguration Name="Release - Max 6|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 6|Win32" + Name="Release - Max 6|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 7|Win32" + Name="Debug - Max 6|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 7|Win32" + Name="Debug - Max 6|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 8|Win32" + Name="Release - Max 7|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 8|Win32" + Name="Release - Max 7|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 5|Win32" + Name="Debug - Max 7|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 5|Win32" + Name="Debug - Max 7|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 9|Win32" + Name="Release - Max 8|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 9|Win32" + Name="Release - Max 8|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4|Win32" + Name="Debug - Max 8|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4|Win32" + Name="Debug - Max 8|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - gmax|Win32" + Name="Debug - Max 5|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - gmax|Win32" + Name="Debug - Max 5|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4.2|Win32" + Name="Release - Max 5|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4.2|Win32" + Name="Release - Max 5|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> - </File> - <File - RelativePath=".\NifCommon\qhull\io.c" - > <FileConfiguration - Name="Release - Max 6|Win32" + Name="Debug - Max 9|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 6|Win32" + Name="Debug - Max 9|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 7|Win32" + Name="Release - Max 9|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 7|Win32" + Name="Release - Max 9|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 8|Win32" + Name="Release - Max 4|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 8|Win32" + Name="Release - Max 4|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 5|Win32" + Name="Debug - Max 4|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 5|Win32" + Name="Debug - Max 4|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 9|Win32" + Name="Debug - gmax|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 9|Win32" + Name="Debug - gmax|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4|Win32" + Name="Release - gmax|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4|Win32" + Name="Release - gmax|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - gmax|Win32" + Name="Debug - Max 4.2|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - gmax|Win32" + Name="Debug - Max 4.2|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4.2|Win32" + Name="Release - Max 4.2|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4.2|Win32" + Name="Release - Max 4.2|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> </File> <File - RelativePath=".\NifCommon\qhull\io.h" - > - </File> - <File - RelativePath=".\NifCommon\qhull\mem.c" + RelativePath=".\NifCommon\qhull\global.c" > <FileConfiguration Name="Release - Max 6|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 6|Win32" + Name="Release - Max 6|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 7|Win32" + Name="Debug - Max 6|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 7|Win32" + Name="Debug - Max 6|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 8|Win32" + Name="Release - Max 7|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 8|Win32" + Name="Release - Max 7|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 5|Win32" + Name="Debug - Max 7|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 5|Win32" + Name="Debug - Max 7|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 9|Win32" + Name="Release - Max 8|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 9|Win32" + Name="Release - Max 8|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4|Win32" + Name="Debug - Max 8|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4|Win32" + Name="Debug - Max 8|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - gmax|Win32" + Name="Debug - Max 5|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - gmax|Win32" + Name="Debug - Max 5|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4.2|Win32" + Name="Release - Max 5|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4.2|Win32" + Name="Release - Max 5|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> - </File> - <File - RelativePath=".\NifCommon\qhull\mem.h" - > - </File> - <File - RelativePath=".\NifCommon\qhull\merge.c" - > <FileConfiguration - Name="Release - Max 6|Win32" + Name="Debug - Max 9|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 6|Win32" + Name="Debug - Max 9|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 7|Win32" + Name="Release - Max 9|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 7|Win32" + Name="Release - Max 9|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 8|Win32" + Name="Release - Max 4|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 8|Win32" + Name="Release - Max 4|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 5|Win32" + Name="Debug - Max 4|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 5|Win32" + Name="Debug - Max 4|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 9|Win32" + Name="Debug - gmax|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 9|Win32" + Name="Debug - gmax|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4|Win32" + Name="Release - gmax|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4|Win32" + Name="Release - gmax|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - gmax|Win32" + Name="Debug - Max 4.2|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - gmax|Win32" + Name="Debug - Max 4.2|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4.2|Win32" + Name="Release - Max 4.2|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4.2|Win32" + Name="Release - Max 4.2|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> </File> <File - RelativePath=".\NifCommon\qhull\merge.h" - > - </File> - <File - RelativePath=".\NifCommon\qhull\poly.c" + RelativePath=".\NifCommon\qhull\io.c" > <FileConfiguration Name="Release - Max 6|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 6|Win32" + Name="Release - Max 6|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 6|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 6|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 7|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 7|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 7|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 7|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 8|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 8|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 8|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 8|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 5|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 5|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 5|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 5|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 9|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 9|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 9|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 9|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - gmax|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - gmax|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - gmax|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - gmax|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4.2|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4.2|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4.2|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4.2|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + </File> + <File + RelativePath=".\NifCommon\qhull\io.h" + > + </File> + <File + RelativePath=".\NifCommon\qhull\mem.c" + > + <FileConfiguration + Name="Release - Max 6|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 6|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 6|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 6|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 7|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 7|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 7|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 7|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 8|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 8|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 8|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 8|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 5|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 5|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 5|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 5|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 9|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 9|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 9|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 9|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - gmax|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - gmax|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - gmax|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - gmax|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4.2|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4.2|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4.2|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4.2|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + </File> + <File + RelativePath=".\NifCommon\qhull\mem.h" + > + </File> + <File + RelativePath=".\NifCommon\qhull\merge.c" + > + <FileConfiguration + Name="Release - Max 6|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 6|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 6|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 6|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 7|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 7|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 7|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 7|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 8|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 8|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 8|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 8|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 5|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 5|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 5|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 5|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 9|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 9|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 9|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 9|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - gmax|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - gmax|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - gmax|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - gmax|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4.2|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4.2|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4.2|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4.2|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + </File> + <File + RelativePath=".\NifCommon\qhull\merge.h" + > + </File> + <File + RelativePath=".\NifCommon\qhull\poly.c" + > + <FileConfiguration + Name="Release - Max 6|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 6|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 6|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 6|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 7|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 7|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 7|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 7|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 8|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 8|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 8|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 8|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 5|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 5|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 5|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 5|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 9|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 9|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 9|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 9|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - gmax|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - gmax|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - gmax|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - gmax|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4.2|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4.2|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4.2|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4.2|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + </File> + <File + RelativePath=".\NifCommon\qhull\poly.h" + > + </File> + <File + RelativePath=".\NifCommon\qhull\poly2.c" + > + <FileConfiguration + Name="Release - Max 6|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 6|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 6|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 6|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 7|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 7|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 7|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 7|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 8|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 8|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 8|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 8|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 5|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 5|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 5|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 5|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 9|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 9|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 9|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 9|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - gmax|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - gmax|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - gmax|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - gmax|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4.2|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4.2|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4.2|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4.2|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + </File> + <File + RelativePath=".\NifCommon\qhull\qhull.c" + > + <FileConfiguration + Name="Release - Max 6|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 6|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 6|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 6|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 7|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 7|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 7|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 7|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 8|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 8|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 8|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 8|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 5|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 5|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 5|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 5|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 9|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 9|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 9|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 9|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - gmax|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - gmax|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - gmax|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - gmax|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4.2|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug - Max 4.2|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4.2|Win32" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4.2|x64" + > + <Tool + Name="VCCLCompilerTool" + CompileAs="2" + /> + </FileConfiguration> + </File> + <File + RelativePath=".\NifCommon\qhull\qhull.h" + > + </File> + <File + RelativePath=".\NifCommon\qhull\qhull_a.h" + > + </File> + <File + RelativePath=".\NifCommon\qhull\qset.c" + > + <FileConfiguration + Name="Release - Max 6|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 7|Win32" + Name="Release - Max 6|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 7|Win32" + Name="Debug - Max 6|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 8|Win32" + Name="Debug - Max 6|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 8|Win32" + Name="Release - Max 7|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 5|Win32" + Name="Release - Max 7|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 5|Win32" + Name="Debug - Max 7|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 9|Win32" + Name="Debug - Max 7|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 9|Win32" + Name="Release - Max 8|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4|Win32" + Name="Release - Max 8|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4|Win32" + Name="Debug - Max 8|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - gmax|Win32" + Name="Debug - Max 8|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - gmax|Win32" + Name="Debug - Max 5|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4.2|Win32" + Name="Debug - Max 5|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4.2|Win32" + Name="Release - Max 5|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> - </File> - <File - RelativePath=".\NifCommon\qhull\poly.h" - > - </File> - <File - RelativePath=".\NifCommon\qhull\poly2.c" - > <FileConfiguration - Name="Release - Max 6|Win32" + Name="Release - Max 5|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 6|Win32" + Name="Debug - Max 9|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 7|Win32" + Name="Debug - Max 9|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 7|Win32" + Name="Release - Max 9|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 8|Win32" + Name="Release - Max 9|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 8|Win32" + Name="Release - Max 4|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 5|Win32" + Name="Release - Max 4|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 5|Win32" + Name="Debug - Max 4|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 9|Win32" + Name="Debug - Max 4|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 9|Win32" + Name="Debug - gmax|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4|Win32" + Name="Debug - gmax|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4|Win32" + Name="Release - gmax|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - gmax|Win32" + Name="Release - gmax|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - gmax|Win32" + Name="Debug - Max 4.2|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4.2|Win32" + Name="Debug - Max 4.2|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> @@ -6324,615 +7741,542 @@ > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" + CompileAs="2" + /> + </FileConfiguration> + <FileConfiguration + Name="Release - Max 4.2|x64" + > + <Tool + Name="VCCLCompilerTool" CompileAs="2" /> </FileConfiguration> </File> <File - RelativePath=".\NifCommon\qhull\qhull.c" + RelativePath=".\NifCommon\qhull\qset.h" + > + </File> + <File + RelativePath=".\NifCommon\qhull\stat.c" > <FileConfiguration Name="Release - Max 6|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 6|Win32" + Name="Release - Max 6|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 7|Win32" + Name="Debug - Max 6|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 7|Win32" + Name="Debug - Max 6|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 8|Win32" + Name="Release - Max 7|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 8|Win32" + Name="Release - Max 7|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 5|Win32" + Name="Debug - Max 7|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 5|Win32" + Name="Debug - Max 7|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 9|Win32" + Name="Release - Max 8|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 9|Win32" + Name="Release - Max 8|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4|Win32" + Name="Debug - Max 8|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4|Win32" + Name="Debug - Max 8|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - gmax|Win32" + Name="Debug - Max 5|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - gmax|Win32" + Name="Debug - Max 5|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4.2|Win32" + Name="Release - Max 5|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4.2|Win32" + Name="Release - Max 5|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> - </File> - <File - RelativePath=".\NifCommon\qhull\qhull.h" - > - </File> - <File - RelativePath=".\NifCommon\qhull\qhull_a.h" - > - </File> - <File - RelativePath=".\NifCommon\qhull\qset.c" - > <FileConfiguration - Name="Release - Max 6|Win32" + Name="Debug - Max 9|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 6|Win32" + Name="Debug - Max 9|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 7|Win32" + Name="Release - Max 9|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 7|Win32" + Name="Release - Max 9|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 8|Win32" + Name="Release - Max 4|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 8|Win32" + Name="Release - Max 4|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 5|Win32" + Name="Debug - Max 4|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 5|Win32" + Name="Debug - Max 4|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 9|Win32" + Name="Debug - gmax|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 9|Win32" + Name="Debug - gmax|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4|Win32" + Name="Release - gmax|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4|Win32" + Name="Release - gmax|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - gmax|Win32" + Name="Debug - Max 4.2|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - gmax|Win32" + Name="Debug - Max 4.2|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4.2|Win32" + Name="Release - Max 4.2|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4.2|Win32" + Name="Release - Max 4.2|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> </File> <File - RelativePath=".\NifCommon\qhull\qset.h" + RelativePath=".\NifCommon\qhull\stat.h" > </File> <File - RelativePath=".\NifCommon\qhull\stat.c" + RelativePath=".\NifCommon\qhull\user.c" > <FileConfiguration Name="Release - Max 6|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 6|Win32" + Name="Release - Max 6|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 7|Win32" + Name="Debug - Max 6|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 7|Win32" + Name="Debug - Max 6|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 8|Win32" + Name="Release - Max 7|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 8|Win32" + Name="Release - Max 7|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 5|Win32" + Name="Debug - Max 7|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 5|Win32" + Name="Debug - Max 7|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 9|Win32" + Name="Release - Max 8|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 9|Win32" + Name="Release - Max 8|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4|Win32" + Name="Debug - Max 8|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4|Win32" + Name="Debug - Max 8|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - gmax|Win32" + Name="Debug - Max 5|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - gmax|Win32" + Name="Debug - Max 5|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4.2|Win32" + Name="Release - Max 5|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4.2|Win32" + Name="Release - Max 5|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> - </File> - <File - RelativePath=".\NifCommon\qhull\stat.h" - > - </File> - <File - RelativePath=".\NifCommon\qhull\user.c" - > <FileConfiguration - Name="Release - Max 6|Win32" + Name="Debug - Max 9|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 6|Win32" + Name="Debug - Max 9|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 7|Win32" + Name="Release - Max 9|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 7|Win32" + Name="Release - Max 9|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 8|Win32" + Name="Release - Max 4|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 8|Win32" + Name="Release - Max 4|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 5|Win32" + Name="Debug - Max 4|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 5|Win32" + Name="Debug - Max 4|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 9|Win32" + Name="Debug - gmax|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 9|Win32" + Name="Debug - gmax|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4|Win32" + Name="Release - gmax|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4|Win32" + Name="Release - gmax|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - gmax|Win32" + Name="Debug - Max 4.2|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - gmax|Win32" + Name="Debug - Max 4.2|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Debug - Max 4.2|Win32" + Name="Release - Max 4.2|Win32" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> <FileConfiguration - Name="Release - Max 4.2|Win32" + Name="Release - Max 4.2|x64" > <Tool Name="VCCLCompilerTool" - UsePrecompiledHeader="0" CompileAs="2" /> </FileConfiguration> @@ -7603,6 +8947,26 @@ </File> </Filter> </Filter> + <Filter + Name="Header Files" + > + <File + RelativePath=".\NifExport\Exporter.h" + > + </File> + <File + RelativePath=".\NifExport\NifExport.h" + > + </File> + <File + RelativePath=".\NifExport\pch.h" + > + </File> + <File + RelativePath=".\NifExport\resource.h" + > + </File> + </Filter> <File RelativePath=".\NifPlugins\resource.h" > diff --git a/NifProps/NifProps.rc b/NifProps/NifProps.rc index fe76e9155eda02a04a85bd32b5991fccf96298b3..270745a862eaf99f5227c7980a2dd52b3daff65d 100755 --- a/NifProps/NifProps.rc +++ b/NifProps/NifProps.rc @@ -206,16 +206,19 @@ BEGIN CONTROL "Material",IDC_LBL_MATERIAL,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,12,4,83,8 END -IDD_RB_MOD_PANEL DIALOGEX 0, 0, 107, 76 +IDD_RB_MOD_PANEL DIALOGEX 0, 0, 107, 117 STYLE DS_SETFONT | DS_3DLOOK | WS_CHILD | WS_VISIBLE FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - CONTROL "No Collision",IDC_RDO_NO_COLL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,9,10,82,10 - CONTROL "Axis Aligned Box",IDC_RDO_AXIS_ALIGNED_BOX,"Button",BS_AUTORADIOBUTTON,9,22,82,10 - CONTROL "Sphere",IDC_RDO_SPHERE,"Button",BS_AUTORADIOBUTTON,9,34,80,10 - GROUPBOX "Bounding Volume",IDC_STATIC,5,0,97,73 - CONTROL "Capsule",IDC_RDO_CAPSULE,"Button",BS_AUTORADIOBUTTON,9,46,80,10 - CONTROL "Proxy Mesh",IDC_RDO_PROXY_MESH,"Button",BS_AUTORADIOBUTTON,9,58,80,10 + CONTROL "No Collision",IDC_RDO_NO_COLL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,9,39,82,10 + CONTROL "Axis Aligned Box",IDC_RDO_AXIS_ALIGNED_BOX,"Button",BS_AUTORADIOBUTTON,9,51,82,10 + CONTROL "Sphere",IDC_RDO_SPHERE,"Button",BS_AUTORADIOBUTTON,9,63,80,10 + GROUPBOX "Bounding Volume",IDC_STATIC,5,29,97,84 + CONTROL "Capsule",IDC_RDO_CAPSULE,"Button",BS_AUTORADIOBUTTON,9,75,80,10 + CONTROL "Strips Shape",IDC_RDO_PROXY_MESH,"Button",BS_AUTORADIOBUTTON,9,87,80,10 + CONTROL "Convex Shape",IDC_RDO_CONVEX,"Button",BS_AUTORADIOBUTTON,9,99,80,10 + CONTROL "Material",IDC_LBL_MATERIAL,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,12,4,83,8 + COMBOBOX IDC_CB_MATERIAL,12,13,83,157,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END IDD_BOXPARAM1 DIALOGEX 0, 0, 107, 69 @@ -278,6 +281,24 @@ BEGIN LTEXT "Collision Meshes:",IDC_STATIC,9,28,77,8 END +IDD_PROXYPARAM1 DIALOGEX 0, 0, 107, 217 +STYLE DS_SETFONT | WS_CHILD | WS_VISIBLE +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + CONTROL "Material",IDC_LBL_MATERIAL,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_GROUP,12,4,83,8 + COMBOBOX IDC_CB_MATERIAL,12,13,83,157,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Bounding Volume",IDC_STATIC,4,31,97,74 + CONTROL "No Collision",IDC_RDO_NO_COLL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,8,41,82,10 + CONTROL "Axis Aligned Box",IDC_RDO_AXIS_ALIGNED_BOX,"Button",BS_AUTORADIOBUTTON,8,52,82,10 + CONTROL "Strips Shape",IDC_RDO_STRIPS_SHAPE,"Button",BS_AUTORADIOBUTTON,8,64,82,10 + CONTROL "Packed Strips Shape",IDC_RDO_PACKED_STRIPS,"Button",BS_AUTORADIOBUTTON | WS_DISABLED,8,76,80,10 + CONTROL "Convex Shape",IDC_RDO_CONVEX,"Button",BS_AUTORADIOBUTTON,8,88,80,10 + LTEXT "Proxied Collision Meshes:",IDC_STATIC,8,107,92,8 + LISTBOX IDC_LIST1,6,118,94,71,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + CONTROL "Add",IDC_ADD,"CustButton",WS_TABSTOP,4,192,47,12 + CONTROL "Remove",IDC_REMOVE,"CustButton",WS_TABSTOP,56,192,46,12 +END + ///////////////////////////////////////////////////////////////////////////// // @@ -328,6 +349,12 @@ BEGIN RIGHTMARGIN, 106 BOTTOMMARGIN, 131 END + + IDD_PROXYPARAM1, DIALOG + BEGIN + RIGHTMARGIN, 106 + BOTTOMMARGIN, 215 + END END #endif // APSTUDIO_INVOKED @@ -920,6 +947,146 @@ BEGIN 0 END +IDD_PROXYPARAM1 DLGINIT +BEGIN + IDC_CB_MATERIAL, 0x403, 6, 0 +0x7453, 0x6e6f, 0x0065, + IDC_CB_MATERIAL, 0x403, 6, 0 +0x6c43, 0x746f, 0x0068, + IDC_CB_MATERIAL, 0x403, 5, 0 +0x6944, 0x7472, "\000" + IDC_CB_MATERIAL, 0x403, 6, 0 +0x6c47, 0x7361, 0x0073, + IDC_CB_MATERIAL, 0x403, 6, 0 +0x7247, 0x7361, 0x0073, + IDC_CB_MATERIAL, 0x403, 6, 0 +0x654d, 0x6174, 0x006c, + IDC_CB_MATERIAL, 0x403, 8, 0 +0x724f, 0x6167, 0x696e, 0x0063, + IDC_CB_MATERIAL, 0x403, 5, 0 +0x6b53, 0x6e69, "\000" + IDC_CB_MATERIAL, 0x403, 6, 0 +0x6157, 0x6574, 0x0072, + IDC_CB_MATERIAL, 0x403, 5, 0 +0x6f57, 0x646f, "\000" + IDC_CB_MATERIAL, 0x403, 12, 0 +0x6548, 0x7661, 0x2079, 0x7453, 0x6e6f, 0x0065, + IDC_CB_MATERIAL, 0x403, 12, 0 +0x6548, 0x7661, 0x2079, 0x654d, 0x6174, 0x006c, + IDC_CB_MATERIAL, 0x403, 11, 0 +0x6548, 0x7661, 0x2079, 0x6f57, 0x646f, "\000" + IDC_CB_MATERIAL, 0x403, 6, 0 +0x6843, 0x6961, 0x006e, + IDC_CB_MATERIAL, 0x403, 5, 0 +0x6e53, 0x776f, "\000" + IDC_CB_MATERIAL, 0x403, 13, 0 +0x7453, 0x6e6f, 0x2065, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 13, 0 +0x6c43, 0x746f, 0x2068, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 12, 0 +0x6944, 0x7472, 0x5320, 0x6174, 0x7269, 0x0073, + IDC_CB_MATERIAL, 0x403, 13, 0 +0x6c47, 0x7361, 0x2073, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 13, 0 +0x7247, 0x7361, 0x2073, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 13, 0 +0x654d, 0x6174, 0x206c, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 15, 0 +0x724f, 0x6167, 0x696e, 0x2063, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 12, 0 +0x6b53, 0x6e69, 0x5320, 0x6174, 0x7269, 0x0073, + IDC_CB_MATERIAL, 0x403, 13, 0 +0x6157, 0x6574, 0x2072, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 12, 0 +0x6f57, 0x646f, 0x5320, 0x6174, 0x7269, 0x0073, + IDC_CB_MATERIAL, 0x403, 19, 0 +0x6548, 0x7661, 0x2079, 0x7453, 0x6e6f, 0x2065, 0x7453, 0x6961, 0x7372, +"\000" + IDC_CB_MATERIAL, 0x403, 19, 0 +0x6548, 0x7661, 0x2079, 0x654d, 0x6174, 0x206c, 0x7453, 0x6961, 0x7372, +"\000" + IDC_CB_MATERIAL, 0x403, 18, 0 +0x6548, 0x7661, 0x2079, 0x6f57, 0x646f, 0x5320, 0x6174, 0x7269, 0x0073, + + IDC_CB_MATERIAL, 0x403, 13, 0 +0x6843, 0x6961, 0x206e, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 12, 0 +0x6e53, 0x776f, 0x5320, 0x6174, 0x7269, 0x0073, + IDC_CB_MATERIAL, 0x403, 9, 0 +0x6c45, 0x7665, 0x7461, 0x726f, "\000" + 0 +END + +IDD_RB_MOD_PANEL DLGINIT +BEGIN + IDC_CB_MATERIAL, 0x403, 6, 0 +0x7453, 0x6e6f, 0x0065, + IDC_CB_MATERIAL, 0x403, 6, 0 +0x6c43, 0x746f, 0x0068, + IDC_CB_MATERIAL, 0x403, 5, 0 +0x6944, 0x7472, "\000" + IDC_CB_MATERIAL, 0x403, 6, 0 +0x6c47, 0x7361, 0x0073, + IDC_CB_MATERIAL, 0x403, 6, 0 +0x7247, 0x7361, 0x0073, + IDC_CB_MATERIAL, 0x403, 6, 0 +0x654d, 0x6174, 0x006c, + IDC_CB_MATERIAL, 0x403, 8, 0 +0x724f, 0x6167, 0x696e, 0x0063, + IDC_CB_MATERIAL, 0x403, 5, 0 +0x6b53, 0x6e69, "\000" + IDC_CB_MATERIAL, 0x403, 6, 0 +0x6157, 0x6574, 0x0072, + IDC_CB_MATERIAL, 0x403, 5, 0 +0x6f57, 0x646f, "\000" + IDC_CB_MATERIAL, 0x403, 12, 0 +0x6548, 0x7661, 0x2079, 0x7453, 0x6e6f, 0x0065, + IDC_CB_MATERIAL, 0x403, 12, 0 +0x6548, 0x7661, 0x2079, 0x654d, 0x6174, 0x006c, + IDC_CB_MATERIAL, 0x403, 11, 0 +0x6548, 0x7661, 0x2079, 0x6f57, 0x646f, "\000" + IDC_CB_MATERIAL, 0x403, 6, 0 +0x6843, 0x6961, 0x006e, + IDC_CB_MATERIAL, 0x403, 5, 0 +0x6e53, 0x776f, "\000" + IDC_CB_MATERIAL, 0x403, 13, 0 +0x7453, 0x6e6f, 0x2065, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 13, 0 +0x6c43, 0x746f, 0x2068, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 12, 0 +0x6944, 0x7472, 0x5320, 0x6174, 0x7269, 0x0073, + IDC_CB_MATERIAL, 0x403, 13, 0 +0x6c47, 0x7361, 0x2073, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 13, 0 +0x7247, 0x7361, 0x2073, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 13, 0 +0x654d, 0x6174, 0x206c, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 15, 0 +0x724f, 0x6167, 0x696e, 0x2063, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 12, 0 +0x6b53, 0x6e69, 0x5320, 0x6174, 0x7269, 0x0073, + IDC_CB_MATERIAL, 0x403, 13, 0 +0x6157, 0x6574, 0x2072, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 12, 0 +0x6f57, 0x646f, 0x5320, 0x6174, 0x7269, 0x0073, + IDC_CB_MATERIAL, 0x403, 19, 0 +0x6548, 0x7661, 0x2079, 0x7453, 0x6e6f, 0x2065, 0x7453, 0x6961, 0x7372, +"\000" + IDC_CB_MATERIAL, 0x403, 19, 0 +0x6548, 0x7661, 0x2079, 0x654d, 0x6174, 0x206c, 0x7453, 0x6961, 0x7372, +"\000" + IDC_CB_MATERIAL, 0x403, 18, 0 +0x6548, 0x7661, 0x2079, 0x6f57, 0x646f, 0x5320, 0x6174, 0x7269, 0x0073, + + IDC_CB_MATERIAL, 0x403, 13, 0 +0x6843, 0x6961, 0x206e, 0x7453, 0x6961, 0x7372, "\000" + IDC_CB_MATERIAL, 0x403, 12, 0 +0x6e53, 0x776f, 0x5320, 0x6174, 0x7269, 0x0073, + IDC_CB_MATERIAL, 0x403, 9, 0 +0x6c45, 0x7665, 0x7461, 0x726f, "\000" + 0 +END + ///////////////////////////////////////////////////////////////////////////// // @@ -993,6 +1160,13 @@ BEGIN IDS_RB_MOD_PANEL4 "Proxy Mesh" IDS_RB_LIST "bhkListShape" IDS_RB_LIST_CLASS "bhkListShape" + IDS_RB_PROXY "bhkCollisionProxy" + IDS_RB_PROXY_CLASS "bhkCollisionProxy" +END + +STRINGTABLE +BEGIN + IDS_CENTER "Center" END #endif // English (U.S.) resources diff --git a/NifProps/bhkBoxObj.cpp b/NifProps/bhkBoxObj.cpp index fe8bb863c15fa2a41155b541d2160749b5c380ac..d7aff148374c4782eb7e25c957544a8893e6e8cc 100644 --- a/NifProps/bhkBoxObj.cpp +++ b/NifProps/bhkBoxObj.cpp @@ -29,7 +29,7 @@ HISTORY: #define _countof(x) (sizeof(x)/sizeof((x)[0])) #endif -const Class_ID bhkBoxObject_CLASS_ID = Class_ID(0x86e19816, BHKRIGIDBODYCLASS_DESC.PartB()); +Class_ID bhkBoxObject_CLASS_ID = Class_ID(0x86e19816, BHKRIGIDBODYCLASS_DESC.PartB()); static ParamBlockDesc2* GetbhkBoxParamBlockDesc(); @@ -285,28 +285,6 @@ void bhkBoxObject::UpdateUI() dlg->Update(ip->GetTime()); } -enum -{ - POSX = 0, // right - POSY = 1, // back - POSZ = 2, // top - NEGX = 3, // left - NEGY = 4, // front - NEGZ = 5, // bottom -}; - -int direction(Point3 *v) { - Point3 a = v[0]-v[2]; - Point3 b = v[1]-v[0]; - Point3 n = CrossProd(a,b); - switch(MaxComponent(n)) { - case 0: return (n.x<0)?NEGX:POSX; - case 1: return (n.y<0)?NEGY:POSY; - case 2: return (n.z<0)?NEGZ:POSZ; - } - return 0; -} - void bhkBoxObject::BuildMesh(TimeValue t) { extern void BuildBox(Mesh&mesh, float l, float w, float h); @@ -319,322 +297,6 @@ void bhkBoxObject::BuildMesh(TimeValue t) BuildBox(mesh, l, w, h); } -// Remap the sub-object material numbers so that the top face is the first one -// The order now is: -// Top / Bottom / Left/ Right / Front / Back -static int mapDir[6] ={ 3, 5, 0, 2, 4, 1 }; - -// vertices ( a b c d ) are in counter clockwise order when viewd from -// outside the surface unless bias!=0 in which case they are clockwise -static void MakeQuad(int nverts, Face *f, int a, int b , int c , int d, int sg, int bias) { - int sm = 1<<sg; - assert(a<nverts); - assert(b<nverts); - assert(c<nverts); - assert(d<nverts); - if (bias) { - f[0].setVerts( b, a, c); - f[0].setSmGroup(sm); - f[0].setEdgeVisFlags(1,0,1); - f[1].setVerts( d, c, a); - f[1].setSmGroup(sm); - f[1].setEdgeVisFlags(1,0,1); - } else { - f[0].setVerts( a, b, c); - f[0].setSmGroup(sm); - f[0].setEdgeVisFlags(1,1,0); - f[1].setVerts( c, d, a); - f[1].setSmGroup(sm); - f[1].setEdgeVisFlags(1,1,0); - } -} -#define MAKE_QUAD(na,nb,nc,nd,sm,b) {MakeQuad(nverts,&(mesh.faces[nf]),na, nb, nc, nd, sm, b);nf+=2;} - -void BuildBox(Mesh&mesh, float l, float w, float h) -{ - int ix,iy,iz,nf,kv,mv,nlayer,topStart,midStart; - int nverts,nv,nextk,nextm,wsp1; - int nfaces; - Point3 va,vb,p; - BOOL bias = 0; - const int lsegs = 1, wsegs = 1, hsegs = 1; - - // Start the validity interval at forever and whittle it down. - if (h<0.0f) bias = 1; - - // Number of verts - // bottom : (lsegs+1)*(wsegs+1) - // top : (lsegs+1)*(wsegs+1) - // sides : (2*lsegs+2*wsegs)*(hsegs-1) - - // Number of rectangular faces. - // bottom : (lsegs)*(wsegs) - // top : (lsegs)*(wsegs) - // sides : 2*(hsegs*lsegs)+2*(wsegs*lsegs) - - wsp1 = wsegs + 1; - nlayer = 2*(lsegs+wsegs); - topStart = (lsegs+1)*(wsegs+1); - midStart = 2*topStart; - - nverts = midStart+nlayer*(hsegs-1); - nfaces = 4*(lsegs*wsegs + hsegs*lsegs + wsegs*hsegs); - - mesh.setNumVerts(nverts); - mesh.setNumFaces(nfaces); - mesh.InvalidateTopologyCache(); - - nv = 0; - - vb = Point3(w,l,h)/float(2); - va = -vb; - - float dx = w/wsegs; - float dy = l/lsegs; - float dz = h/hsegs; - - // do bottom vertices. - p.z = va.z; - p.y = va.y; - for(iy=0; iy<=lsegs; iy++) { - p.x = va.x; - for (ix=0; ix<=wsegs; ix++) { - mesh.setVert(nv++, p); - p.x += dx; - } - p.y += dy; - } - - nf = 0; - - // do bottom faces. - for(iy=0; iy<lsegs; iy++) { - kv = iy*(wsegs+1); - for (ix=0; ix<wsegs; ix++) { - MAKE_QUAD(kv, kv+wsegs+1, kv+wsegs+2, kv+1, 1, bias); - kv++; - } - } - assert(nf==lsegs*wsegs*2); - - // do top vertices. - p.z = vb.z; - p.y = va.y; - for(iy=0; iy<=lsegs; iy++) { - p.x = va.x; - for (ix=0; ix<=wsegs; ix++) { - mesh.setVert(nv++, p); - p.x += dx; - } - p.y += dy; - } - - // do top faces (lsegs*wsegs); - for(iy=0; iy<lsegs; iy++) { - kv = iy*(wsegs+1)+topStart; - for (ix=0; ix<wsegs; ix++) { - MAKE_QUAD(kv, kv+1, kv+wsegs+2,kv+wsegs+1, 2, bias); - kv++; - } - } - assert(nf==lsegs*wsegs*4); - - // do middle vertices - for(iz=1; iz<hsegs; iz++) { - - p.z = va.z + dz * iz; - - // front edge - p.x = va.x; p.y = va.y; - for (ix=0; ix<wsegs; ix++) { mesh.setVert(nv++, p); p.x += dx; } - - // right edge - p.x = vb.x; p.y = va.y; - for (iy=0; iy<lsegs; iy++) { mesh.setVert(nv++, p); p.y += dy; } - - // back edge - p.x = vb.x; p.y = vb.y; - for (ix=0; ix<wsegs; ix++) { mesh.setVert(nv++, p); p.x -= dx; } - - // left edge - p.x = va.x; p.y = vb.y; - for (iy=0; iy<lsegs; iy++) { mesh.setVert(nv++, p); p.y -= dy; } - } - - if (hsegs==1) { - // do FRONT faces ----------------------- - kv = 0; - mv = topStart; - for (ix=0; ix<wsegs; ix++) { - MAKE_QUAD(kv, kv+1, mv+1, mv, 3, bias); - kv++; - mv++; - } - - // do RIGHT faces.----------------------- - kv = wsegs; - mv = topStart + kv; - for (iy=0; iy<lsegs; iy++) { - MAKE_QUAD(kv, kv+wsp1, mv+wsp1, mv, 4, bias); - kv += wsp1; - mv += wsp1; - } - - // do BACK faces.----------------------- - kv = topStart - 1; - mv = midStart - 1; - for (ix=0; ix<wsegs; ix++) { - MAKE_QUAD(kv, kv-1, mv-1, mv, 5, bias); - kv --; - mv --; - } - - // do LEFT faces.---------------------- - kv = lsegs*(wsegs+1); // index into bottom - mv = topStart + kv; - for (iy=0; iy<lsegs; iy++) { - MAKE_QUAD(kv, kv-wsp1, mv-wsp1, mv, 6, bias); - kv -= wsp1; - mv -= wsp1; - } - } - - else { - // do front faces. - kv = 0; - mv = midStart; - for(iz=0; iz<hsegs; iz++) { - if (iz==hsegs-1) mv = topStart; - for (ix=0; ix<wsegs; ix++) - MAKE_QUAD(kv+ix, kv+ix+1, mv+ix+1, mv+ix, 3, bias); - kv = mv; - mv += nlayer; - } - - assert(nf==lsegs*wsegs*4 + wsegs*hsegs*2); - - // do RIGHT faces.------------------------- - // RIGHT bottom row: - kv = wsegs; // into bottom layer. - mv = midStart + wsegs; // first layer of mid verts - - - for (iy=0; iy<lsegs; iy++) { - MAKE_QUAD(kv, kv+wsp1, mv+1, mv, 4, bias); - kv += wsp1; - mv ++; - } - - // RIGHT middle part: - kv = midStart + wsegs; - for(iz=0; iz<hsegs-2; iz++) { - mv = kv + nlayer; - for (iy=0; iy<lsegs; iy++) { - MAKE_QUAD(kv+iy, kv+iy+1, mv+iy+1, mv+iy, 4, bias); - } - kv += nlayer; - } - - // RIGHT top row: - kv = midStart + wsegs + (hsegs-2)*nlayer; - mv = topStart + wsegs; - for (iy=0; iy<lsegs; iy++) { - MAKE_QUAD(kv, kv+1, mv+wsp1, mv, 4, bias); - mv += wsp1; - kv++; - } - - assert(nf==lsegs*wsegs*4 + wsegs*hsegs*2 + lsegs*hsegs*2); - - // do BACK faces. --------------------- - // BACK bottom row: - kv = topStart - 1; - mv = midStart + wsegs + lsegs; - for (ix=0; ix<wsegs; ix++) { - MAKE_QUAD(kv, kv-1, mv+1, mv, 5, bias); - kv --; - mv ++; - } - - // BACK middle part: - kv = midStart + wsegs + lsegs; - for(iz=0; iz<hsegs-2; iz++) { - mv = kv + nlayer; - for (ix=0; ix<wsegs; ix++) { - MAKE_QUAD(kv+ix, kv+ix+1, mv+ix+1, mv+ix, 5, bias); - } - kv += nlayer; - } - - // BACK top row: - kv = midStart + wsegs + lsegs + (hsegs-2)*nlayer; - mv = topStart + lsegs*(wsegs+1)+wsegs; - for (ix=0; ix<wsegs; ix++) { - MAKE_QUAD(kv, kv+1, mv-1, mv, 5, bias); - mv --; - kv ++; - } - - assert(nf==lsegs*wsegs*4 + wsegs*hsegs*4 + lsegs*hsegs*2); - - // do LEFT faces. ----------------- - // LEFT bottom row: - kv = lsegs*(wsegs+1); // index into bottom - mv = midStart + 2*wsegs +lsegs; - for (iy=0; iy<lsegs; iy++) { - nextm = mv+1; - if (iy==lsegs-1) - nextm -= nlayer; - MAKE_QUAD(kv, kv-wsp1, nextm, mv, 6, bias); - kv -=wsp1; - mv ++; - } - - // LEFT middle part: - kv = midStart + 2*wsegs + lsegs; - for(iz=0; iz<hsegs-2; iz++) { - mv = kv + nlayer; - for (iy=0; iy<lsegs; iy++) { - nextm = mv+1; - nextk = kv+iy+1; - if (iy==lsegs-1) { - nextm -= nlayer; - nextk -= nlayer; - } - MAKE_QUAD(kv+iy, nextk, nextm, mv, 6, bias); - mv++; - } - kv += nlayer; - } - - // LEFT top row: - kv = midStart + 2*wsegs + lsegs+ (hsegs-2)*nlayer; - mv = topStart + lsegs*(wsegs+1); - for (iy=0; iy<lsegs; iy++) { - nextk = kv+1; - if (iy==lsegs-1) - nextk -= nlayer; - MAKE_QUAD(kv, nextk, mv-wsp1, mv, 6, bias); - mv -= wsp1; - kv++; - } - } - - mesh.setNumTVerts(0); - mesh.setNumTVFaces(0); - for (nf = 0; nf<nfaces; nf++) { - Face& f = mesh.faces[nf]; - DWORD* nv = f.getAllVerts(); - Point3 v[3]; - for (int ix =0; ix<3; ix++) - v[ix] = mesh.getVert(nv[ix]); - int dir = direction(v); - mesh.setFaceMtlIndex(nf,0); - //mesh.setFaceMtlIndex(nf,mapDir[dir]); - } - - mesh.InvalidateTopologyCache(); -} Object* bhkBoxObject::ConvertToType(TimeValue t, Class_ID obtype) { diff --git a/NifProps/bhkCapsuleObj.cpp b/NifProps/bhkCapsuleObj.cpp index 3a9498aa8bc6e6c0e37cc603ca86ac1e3a139d59..3e90a355def0c02092f5f21ae2590f79e9da5bf9 100644 --- a/NifProps/bhkCapsuleObj.cpp +++ b/NifProps/bhkCapsuleObj.cpp @@ -24,15 +24,13 @@ HISTORY: #include "bhkRigidBodyInterface.h" #include "NifGui.h" #include "NifStrings.h" +#include "bhkHelperFuncs.h" #ifndef _countof #define _countof(x) (sizeof(x)/sizeof((x)[0])) #endif -static void BuildScubaMesh(Mesh &mesh, int segs, int smooth, int llsegs, - float radius1, float radius2, float length); - -const Class_ID BHKCAPSULEOBJECT_CLASS_ID = Class_ID(0x7f8f629a, BHKRIGIDBODYCLASS_DESC.PartB()); +Class_ID BHKCAPSULEOBJECT_CLASS_ID = Class_ID(0x7f8f629a, BHKRIGIDBODYCLASS_DESC.PartB()); class bhkCapsuleObject : public SimpleObject2 { @@ -463,214 +461,6 @@ void bhkCapsuleObject::UpdateUI() dlg->Update(ip->GetTime()); } -void AddFace(Face *f,int a,int b,int c,int evis,int smooth_group) -{ - const int ALLF = 4; - f[0].setSmGroup(smooth_group); - f[0].setMatID((MtlID)0); /*default */ - if (evis==0) f[0].setEdgeVisFlags(1,1,0); - else if (evis==1) f[0].setEdgeVisFlags(0,1,1); - else if (evis==2) f[0].setEdgeVisFlags(0,0,1); - else if (evis==ALLF) f[0].setEdgeVisFlags(1,1,1); - else f[0].setEdgeVisFlags(1,0,1); - f[0].setVerts(a,b,c); -} - -void BuildScubaMesh(Mesh &mesh, int segs, int smooth, int llsegs, - float radius1, float radius2, float cylh) -{ - Point3 p; - int ix,jx,ic = 1; - int nf=0,nv=0, capsegs=(int)(segs/2.0f),csegs=0; - float ang; - float startAng = 0.0f; - float totalPie = TWOPI; - int lsegs = llsegs-1 + 2*capsegs; - int levels=csegs*2+(llsegs-1); - int capv=segs,sideedge=capsegs+csegs; - int totlevels=levels+capsegs*2+2; - int tvinslice=totlevels+totlevels-2; - float delta = (float)2.0*PI/(float)segs; - int VertexPerLevel=segs; - int nfaces=2*segs*(levels+1); - int ntverts=2*(segs+1)+llsegs-1; - int *edgelstl=new int[totlevels]; - int *edgelstr=new int[totlevels]; - int lastlevel=totlevels-1,dcapv=capv-1,dvertper=VertexPerLevel-1; - edgelstr[0] = edgelstl[0] = 0; - edgelstr[1] = 1; - edgelstl[1] = capv; - for (int i=2;i<=sideedge;i++){ - edgelstr[i]=edgelstr[i-1]+capv; - edgelstl[i]=edgelstr[i]+dcapv; - } - while ((i<lastlevel)&&(i<=totlevels-sideedge)){ - edgelstr[i]=edgelstr[i-1]+VertexPerLevel; - edgelstl[i]=edgelstr[i]+dcapv; - i++; - } - while (i<lastlevel) { - edgelstr[i]=edgelstr[i-1]+capv; - edgelstl[i]=edgelstr[i]+dcapv; - i++; - } - edgelstl[lastlevel]= (edgelstr[lastlevel]=edgelstl[i-1]+1); - int nverts=edgelstl[lastlevel]+1; - nfaces+=2*segs*(2*capsegs-1); - - mesh.setNumVerts(nverts); - mesh.setNumFaces(nfaces); - mesh.setSmoothFlags(smooth != 0); - mesh.setNumTVerts(0); - mesh.setNumTVFaces(0); - mesh.setSmoothFlags(smooth != 0); - - // bottom vertex - float height = cylh + radius1 + radius2; - mesh.setVert(nv, Point3(0.0f,0.0f,height)); - mesh.setVert(nverts-1, Point3(0.0f,0.0f,0.0f)); - - // Top (1) and bottom (2) cap vertices - float ru,cang,sang; - int msegs=segs,deltaend=nverts-capv-1; - ang = startAng; - msegs--; - float rincr=PI/(2.0f*capsegs),aincr; - for (jx = 0; jx<=msegs; jx++) - { - cang=(float)cos(ang); - sang=(float)sin(ang); - for(ix=1; ix<=sideedge; ix++) { - aincr = (rincr*(float)ix); - ru=(float)sin(aincr); - - p.x = cang*radius1*ru; - p.y = sang*radius1*ru; - p.z = (jx==0) ? height-radius1*(1.0f-(float)cos(aincr)) : mesh.verts[edgelstr[ix]].z; - mesh.setVert(edgelstr[ix]+jx, p); - - p.x = cang*radius2*ru; - p.y = sang*radius2*ru; - p.z = (jx==0) ? radius2*(1.0f-(float)cos(aincr)) : mesh.verts[edgelstr[lastlevel-ix]].z ; - mesh.setVert(edgelstr[lastlevel-ix]+jx,p); - } - ang += delta; - } - - //// Middle vertices - //int sidevs,startv=edgelstr[sideedge],deltav; - //for(ix=1; ix<llsegs; ix++) { - // // Put center vertices all the way up - // float u = float(ix)/float(llsegs); - // float rad = (radius1*(1.0f-u) + radius2*u); - // p.z = cylh *((float)ix/float(llsegs)) + radius2; - // ang = startAng; - // for (sidevs=0;sidevs<VertexPerLevel;sidevs++) - // p.x = (float)cos(ang)*rad; - // p.y = (float)sin(ang)*rad; - // mesh.setVert(nv, p); - // nv++; - // ang += delta; - // } - //} - - //top layer done, now reflect sides down - int sidevs,deltav; - int startv=edgelstr[sideedge]; - int endv=edgelstr[totlevels-capsegs-1]; - if (llsegs>1) - { - float sincr = cylh/llsegs; - for (sidevs=0;sidevs<VertexPerLevel;sidevs++) - { - Point3 topp = mesh.verts[startv]; - Point3 botp = mesh.verts[endv]; - p.x = (topp.x + botp.x) / 2.0f; - p.y = (topp.y + botp.y) / 2.0f; - deltav=VertexPerLevel; - for (ic=1;ic<llsegs;ic++) - { - p.z = topp.z-sincr*ic; - mesh.setVert(startv+deltav, p); - deltav+=VertexPerLevel; - } - startv++; - } - } - int lasttvl=0,lasttvr=0; - int lvert=segs; - int t0,t1,b0,b1,tvt0=0,tvt1=0,tvb0=1,tvb1=2,fc=0,smoothgr=(smooth?4:0),vseg=segs+1; - int tvcount=0,lowerside=lastlevel-sideedge,onside=0; - - BOOL ok,wrap; - // Now make faces --- - for (int clevel=0;clevel<lastlevel-1;clevel++) - { - t1=(t0=edgelstr[clevel])+1; - b1=(b0=edgelstr[clevel+1])+1; - ok=1; wrap=FALSE; - if ((clevel>0)&&(onside==1)) { - tvt0++;tvt1++;tvb0++,tvb1++; - } - if (clevel==1) { - tvt0=1;tvt1=2; - } - if (clevel==sideedge) { - tvt1+=lvert;tvt0+=lvert;tvb0+=vseg;tvb1+=vseg;onside++; - } else if (clevel==lowerside) { - tvt1+=vseg;tvt0+=vseg;tvb0+=lvert;tvb1+=lvert;onside++; - } - while ((b0<edgelstl[clevel+1])||ok) - { - if (b1==edgelstr[clevel+2]) { - b1=edgelstr[clevel+1]; - t1=edgelstr[clevel]; - ok=FALSE; - wrap=(onside!=1); - } - if (smooth) smoothgr=4; - AddFace(&mesh.faces[fc++],t0,b0,b1,0,smoothgr); - if (clevel>0) { - AddFace(&mesh.faces[fc++],t0,b1,t1,1,smoothgr); - t0++;t1++; - } - b0++;b1++;tvb0++,tvb1++; - } - } - smoothgr=(smooth?4:0); - t1=(t0=edgelstr[lastlevel-1])+1;b0=edgelstr[lastlevel]; - int lastpt=lastlevel; - if (onside==1) { - tvt0++; - tvt1++; - tvb0++; - tvb1++; - } - if (sideedge==1) { - tvt1+=vseg; - tvt0+=vseg; - tvb0+=lvert; - tvb1+=lvert; - onside++; - } - while (t0<edgelstl[lastpt]) { - if (t1==edgelstr[lastlevel]) { - t1=edgelstr[lastlevel-1]; - tvt1-=segs; - } - AddFace(&mesh.faces[fc++],t0,b0,t1,1,smoothgr); - t0++;t1++; - } - for (i=0;i<nverts;i++) - mesh.verts[i].z -= (radius2 + cylh/2.0f); - - if (edgelstr) delete []edgelstr; - if (edgelstl) delete []edgelstl; - assert(fc==mesh.numFaces); - // assert(nv==mesh.numVerts); - mesh.InvalidateTopologyCache(); -} - int bhkCapsuleObject::Display(TimeValue t, INode* inode, ViewExp *vpt, int flags) { Matrix3 m; diff --git a/NifProps/bhkHelperFuncs.cpp b/NifProps/bhkHelperFuncs.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1233c680d8ad44676c46f66a96b2b87cc5d49e94 --- /dev/null +++ b/NifProps/bhkHelperFuncs.cpp @@ -0,0 +1,756 @@ +#pragma warning( disable:4800 ) + +#include <map> +#include "NifProps.h" +#include "NifStrings.h" +#include "NifPlugins.h" +#include "NifGui.h" + +using namespace std; + +#define MAKE_QUAD(na,nb,nc,nd,sm,b) {MakeQuad(nverts,&(mesh.faces[nf]),na, nb, nc, nd, sm, b);nf+=2;} + +// Misc stuff +#define MAX_SEGMENTS 200 +#define MIN_SEGMENTS 4 + +#define MIN_RADIUS float(0) +#define MAX_RADIUS float(1.0E30) + +#define MIN_SMOOTH 0 +#define MAX_SMOOTH 1 + +enum +{ + POSX = 0, // right + POSY = 1, // back + POSZ = 2, // top + NEGX = 3, // left + NEGY = 4, // front + NEGZ = 5, // bottom +}; + +int direction(Point3 *v) { + Point3 a = v[0]-v[2]; + Point3 b = v[1]-v[0]; + Point3 n = CrossProd(a,b); + switch(MaxComponent(n)) { + case 0: return (n.x<0)?NEGX:POSX; + case 1: return (n.y<0)?NEGY:POSY; + case 2: return (n.z<0)?NEGZ:POSZ; + } + return 0; +} + +// Remap the sub-object material numbers so that the top face is the first one +// The order now is: +// Top / Bottom / Left/ Right / Front / Back +static int mapDir[6] ={ 3, 5, 0, 2, 4, 1 }; + +// vertices ( a b c d ) are in counter clockwise order when viewd from +// outside the surface unless bias!=0 in which case they are clockwise +static void MakeQuad(int nverts, Face *f, int a, int b , int c , int d, int sg, int bias) { + int sm = 1<<sg; + assert(a<nverts); + assert(b<nverts); + assert(c<nverts); + assert(d<nverts); + if (bias) { + f[0].setVerts( b, a, c); + f[0].setSmGroup(sm); + f[0].setEdgeVisFlags(1,0,1); + f[1].setVerts( d, c, a); + f[1].setSmGroup(sm); + f[1].setEdgeVisFlags(1,0,1); + } else { + f[0].setVerts( a, b, c); + f[0].setSmGroup(sm); + f[0].setEdgeVisFlags(1,1,0); + f[1].setVerts( c, d, a); + f[1].setSmGroup(sm); + f[1].setEdgeVisFlags(1,1,0); + } +} + +void CalcAxisAlignedBox(Mesh& mesh, Box3& box) +{ + int nv = mesh.getNumVerts(); + box.IncludePoints(mesh.getVertPtr(0), nv, NULL); +} + +void CalcAxisAlignedBox(Mesh& mesh, Box3& box, Matrix3 *tm) +{ + int nv = mesh.getNumVerts(); + box.IncludePoints(mesh.getVertPtr(0), nv, tm); +} + +// Calculate bounding sphere using minimum-volume axis-align bounding box. Its fast but not a very good fit. +void CalcAxisAlignedSphere(Mesh& mesh, Point3& center, float& radius) +{ + //--Calculate center & radius--// + + //Set lows and highs to first vertex + int nv = mesh.getNumVerts(); + + Point3 lows = mesh.getVert(0); + Point3 highs = mesh.getVert(0); + + //Iterate through the vertices, adjusting the stored values + //if a vertex with lower or higher values is found + for ( unsigned int i = 0; i < nv; ++i ) { + const Point3 & v = mesh.getVert(i); + + if ( v.x > highs.x ) highs.x = v.x; + else if ( v.x < lows.x ) lows.x = v.x; + + if ( v.y > highs.y ) highs.y = v.y; + else if ( v.y < lows.y ) lows.y = v.y; + + if ( v.z > highs.z ) highs.z = v.z; + else if ( v.z < lows.z ) lows.z = v.z; + } + + //Now we know the extent of the shape, so the center will be the average + //of the lows and highs + center = (highs + lows) / 2.0f; + + //The radius will be the largest distance from the center + Point3 diff; + float dist2(0.0f), maxdist2(0.0f); + for ( unsigned int i = 0; i < nv; ++i ) { + const Point3 & v = mesh.getVert(i); + + diff = center - v; + dist2 = diff.x * diff.x + diff.y * diff.y + diff.z * diff.z; + if ( dist2 > maxdist2 ) maxdist2 = dist2; + }; + radius = sqrt(maxdist2); +} + +// Calculate bounding sphere using average position of the points. Better fit but slower. +void CalcCenteredSphere(Mesh& mesh, Point3& center, float& radius) +{ + int nv = mesh.getNumVerts(); + Point3 sum; + for (int i=0; i<nv; ++i) + sum += mesh.getVert(i); + center = sum / float(nv); + float radsq = 0.0f; + for (int i=0; i<nv; ++i){ + Point3 diff = mesh.getVert(i) - center; + float mag = diff.LengthSquared(); + radsq = max(radsq, mag); + } + radius = Sqrt(radsq); +} + + + +#define MAKE_QUAD(na,nb,nc,nd,sm,b) {MakeQuad(nverts,&(mesh.faces[nf]),na, nb, nc, nd, sm, b);nf+=2;} + +void BuildBox(Mesh&mesh, float l, float w, float h) +{ + int ix,iy,iz,nf,kv,mv,nlayer,topStart,midStart; + int nverts,nv,nextk,nextm,wsp1; + int nfaces; + Point3 va,vb,p; + BOOL bias = 0; + const int lsegs = 1, wsegs = 1, hsegs = 1; + + // Start the validity interval at forever and whittle it down. + if (h<0.0f) bias = 1; + + // Number of verts + // bottom : (lsegs+1)*(wsegs+1) + // top : (lsegs+1)*(wsegs+1) + // sides : (2*lsegs+2*wsegs)*(hsegs-1) + + // Number of rectangular faces. + // bottom : (lsegs)*(wsegs) + // top : (lsegs)*(wsegs) + // sides : 2*(hsegs*lsegs)+2*(wsegs*lsegs) + + wsp1 = wsegs + 1; + nlayer = 2*(lsegs+wsegs); + topStart = (lsegs+1)*(wsegs+1); + midStart = 2*topStart; + + nverts = midStart+nlayer*(hsegs-1); + nfaces = 4*(lsegs*wsegs + hsegs*lsegs + wsegs*hsegs); + + mesh.setNumVerts(nverts); + mesh.setNumFaces(nfaces); + mesh.InvalidateTopologyCache(); + + nv = 0; + + vb = Point3(w,l,h)/float(2); + va = -vb; + + float dx = w/wsegs; + float dy = l/lsegs; + float dz = h/hsegs; + + // do bottom vertices. + p.z = va.z; + p.y = va.y; + for(iy=0; iy<=lsegs; iy++) { + p.x = va.x; + for (ix=0; ix<=wsegs; ix++) { + mesh.setVert(nv++, p); + p.x += dx; + } + p.y += dy; + } + + nf = 0; + + // do bottom faces. + for(iy=0; iy<lsegs; iy++) { + kv = iy*(wsegs+1); + for (ix=0; ix<wsegs; ix++) { + MAKE_QUAD(kv, kv+wsegs+1, kv+wsegs+2, kv+1, 1, bias); + kv++; + } + } + assert(nf==lsegs*wsegs*2); + + // do top vertices. + p.z = vb.z; + p.y = va.y; + for(iy=0; iy<=lsegs; iy++) { + p.x = va.x; + for (ix=0; ix<=wsegs; ix++) { + mesh.setVert(nv++, p); + p.x += dx; + } + p.y += dy; + } + + // do top faces (lsegs*wsegs); + for(iy=0; iy<lsegs; iy++) { + kv = iy*(wsegs+1)+topStart; + for (ix=0; ix<wsegs; ix++) { + MAKE_QUAD(kv, kv+1, kv+wsegs+2,kv+wsegs+1, 2, bias); + kv++; + } + } + assert(nf==lsegs*wsegs*4); + + // do middle vertices + for(iz=1; iz<hsegs; iz++) { + + p.z = va.z + dz * iz; + + // front edge + p.x = va.x; p.y = va.y; + for (ix=0; ix<wsegs; ix++) { mesh.setVert(nv++, p); p.x += dx; } + + // right edge + p.x = vb.x; p.y = va.y; + for (iy=0; iy<lsegs; iy++) { mesh.setVert(nv++, p); p.y += dy; } + + // back edge + p.x = vb.x; p.y = vb.y; + for (ix=0; ix<wsegs; ix++) { mesh.setVert(nv++, p); p.x -= dx; } + + // left edge + p.x = va.x; p.y = vb.y; + for (iy=0; iy<lsegs; iy++) { mesh.setVert(nv++, p); p.y -= dy; } + } + + if (hsegs==1) { + // do FRONT faces ----------------------- + kv = 0; + mv = topStart; + for (ix=0; ix<wsegs; ix++) { + MAKE_QUAD(kv, kv+1, mv+1, mv, 3, bias); + kv++; + mv++; + } + + // do RIGHT faces.----------------------- + kv = wsegs; + mv = topStart + kv; + for (iy=0; iy<lsegs; iy++) { + MAKE_QUAD(kv, kv+wsp1, mv+wsp1, mv, 4, bias); + kv += wsp1; + mv += wsp1; + } + + // do BACK faces.----------------------- + kv = topStart - 1; + mv = midStart - 1; + for (ix=0; ix<wsegs; ix++) { + MAKE_QUAD(kv, kv-1, mv-1, mv, 5, bias); + kv --; + mv --; + } + + // do LEFT faces.---------------------- + kv = lsegs*(wsegs+1); // index into bottom + mv = topStart + kv; + for (iy=0; iy<lsegs; iy++) { + MAKE_QUAD(kv, kv-wsp1, mv-wsp1, mv, 6, bias); + kv -= wsp1; + mv -= wsp1; + } + } + + else { + // do front faces. + kv = 0; + mv = midStart; + for(iz=0; iz<hsegs; iz++) { + if (iz==hsegs-1) mv = topStart; + for (ix=0; ix<wsegs; ix++) + MAKE_QUAD(kv+ix, kv+ix+1, mv+ix+1, mv+ix, 3, bias); + kv = mv; + mv += nlayer; + } + + assert(nf==lsegs*wsegs*4 + wsegs*hsegs*2); + + // do RIGHT faces.------------------------- + // RIGHT bottom row: + kv = wsegs; // into bottom layer. + mv = midStart + wsegs; // first layer of mid verts + + + for (iy=0; iy<lsegs; iy++) { + MAKE_QUAD(kv, kv+wsp1, mv+1, mv, 4, bias); + kv += wsp1; + mv ++; + } + + // RIGHT middle part: + kv = midStart + wsegs; + for(iz=0; iz<hsegs-2; iz++) { + mv = kv + nlayer; + for (iy=0; iy<lsegs; iy++) { + MAKE_QUAD(kv+iy, kv+iy+1, mv+iy+1, mv+iy, 4, bias); + } + kv += nlayer; + } + + // RIGHT top row: + kv = midStart + wsegs + (hsegs-2)*nlayer; + mv = topStart + wsegs; + for (iy=0; iy<lsegs; iy++) { + MAKE_QUAD(kv, kv+1, mv+wsp1, mv, 4, bias); + mv += wsp1; + kv++; + } + + assert(nf==lsegs*wsegs*4 + wsegs*hsegs*2 + lsegs*hsegs*2); + + // do BACK faces. --------------------- + // BACK bottom row: + kv = topStart - 1; + mv = midStart + wsegs + lsegs; + for (ix=0; ix<wsegs; ix++) { + MAKE_QUAD(kv, kv-1, mv+1, mv, 5, bias); + kv --; + mv ++; + } + + // BACK middle part: + kv = midStart + wsegs + lsegs; + for(iz=0; iz<hsegs-2; iz++) { + mv = kv + nlayer; + for (ix=0; ix<wsegs; ix++) { + MAKE_QUAD(kv+ix, kv+ix+1, mv+ix+1, mv+ix, 5, bias); + } + kv += nlayer; + } + + // BACK top row: + kv = midStart + wsegs + lsegs + (hsegs-2)*nlayer; + mv = topStart + lsegs*(wsegs+1)+wsegs; + for (ix=0; ix<wsegs; ix++) { + MAKE_QUAD(kv, kv+1, mv-1, mv, 5, bias); + mv --; + kv ++; + } + + assert(nf==lsegs*wsegs*4 + wsegs*hsegs*4 + lsegs*hsegs*2); + + // do LEFT faces. ----------------- + // LEFT bottom row: + kv = lsegs*(wsegs+1); // index into bottom + mv = midStart + 2*wsegs +lsegs; + for (iy=0; iy<lsegs; iy++) { + nextm = mv+1; + if (iy==lsegs-1) + nextm -= nlayer; + MAKE_QUAD(kv, kv-wsp1, nextm, mv, 6, bias); + kv -=wsp1; + mv ++; + } + + // LEFT middle part: + kv = midStart + 2*wsegs + lsegs; + for(iz=0; iz<hsegs-2; iz++) { + mv = kv + nlayer; + for (iy=0; iy<lsegs; iy++) { + nextm = mv+1; + nextk = kv+iy+1; + if (iy==lsegs-1) { + nextm -= nlayer; + nextk -= nlayer; + } + MAKE_QUAD(kv+iy, nextk, nextm, mv, 6, bias); + mv++; + } + kv += nlayer; + } + + // LEFT top row: + kv = midStart + 2*wsegs + lsegs+ (hsegs-2)*nlayer; + mv = topStart + lsegs*(wsegs+1); + for (iy=0; iy<lsegs; iy++) { + nextk = kv+1; + if (iy==lsegs-1) + nextk -= nlayer; + MAKE_QUAD(kv, nextk, mv-wsp1, mv, 6, bias); + mv -= wsp1; + kv++; + } + } + + mesh.setNumTVerts(0); + mesh.setNumTVFaces(0); + for (nf = 0; nf<nfaces; nf++) { + Face& f = mesh.faces[nf]; + DWORD* nv = f.getAllVerts(); + Point3 v[3]; + for (int ix =0; ix<3; ix++) + v[ix] = mesh.getVert(nv[ix]); + int dir = direction(v); + mesh.setFaceMtlIndex(nf,0); + //mesh.setFaceMtlIndex(nf,mapDir[dir]); + } + + mesh.InvalidateTopologyCache(); +} + +extern void BuildSphere(Mesh&mesh, float radius, int segs, int smooth, float startAng) +{ + Point3 p; + int ix,na,nb,nc,nd,jx,kx; + int nf=0,nv=0; + float delta, delta2; + float a,alt,secrad,secang,b,c; + float hemi = 0.0f; + + LimitValue(segs, MIN_SEGMENTS, MAX_SEGMENTS); + LimitValue(smooth, MIN_SMOOTH, MAX_SMOOTH); + LimitValue(radius, MIN_RADIUS, MAX_RADIUS); + + float totalPie(0.0f); + if (hemi>=1.0f) hemi = 0.9999f; + hemi = (1.0f-hemi) * PI; + float basedelta=2.0f*PI/(float)segs; + delta2 = basedelta; + delta = basedelta; + + int rows = int(hemi/delta) + 1; + int realsegs=segs; + int nverts = rows * realsegs + 2; + int nfaces = rows * realsegs * 2; + mesh.setNumVerts(nverts); + mesh.setNumFaces(nfaces); + mesh.setSmoothFlags(smooth != 0); + int lastvert=nverts-1; + + // Top vertex + mesh.setVert(nv, 0.0f, 0.0f, radius); + nv++; + + // Middle vertices + alt=delta; + for(ix=1; ix<=rows; ix++) { + a = (float)cos(alt)*radius; + secrad = (float)sin(alt)*radius; + secang = startAng; //0.0f + for(jx=0; jx<segs; ++jx) { + b = (float)cos(secang)*secrad; + c = (float)sin(secang)*secrad; + mesh.setVert(nv++,b,c,a); + secang+=delta2; + } + alt+=delta; + } + + /* Bottom vertex */ + mesh.setVert(nv++, 0.0f, 0.0f,-radius); + + // Now make faces + + BitArray startSliceFaces; + BitArray endSliceFaces; + + // Make top conic cap + for(ix=1; ix<=segs; ++ix) { + nc=(ix==segs)?1:ix+1; + mesh.faces[nf].setEdgeVisFlags(1,1,1); + mesh.faces[nf].setSmGroup(smooth?1:0); + mesh.faces[nf].setMatID(1); + mesh.faces[nf].setVerts(0, ix, nc); + nf++; + } + + /* Make midsection */ + int lastrow=rows-1,lastseg=segs-1,almostlast=lastseg-1; + for(ix=1; ix<rows; ++ix) { + jx=(ix-1)*segs+1; + for(kx=0; kx<segs; ++kx) { + na = jx+kx; + nb = na+segs; + nc = (kx==lastseg)? jx+segs: nb+1; + nd = (kx==lastseg)? jx : na+1; + + mesh.faces[nf].setEdgeVisFlags(1,1,0); + mesh.faces[nf].setSmGroup(smooth?1:0); + mesh.faces[nf].setMatID(1); + mesh.faces[nf].setVerts(na,nb,nc); + nf++; + + mesh.faces[nf].setEdgeVisFlags(0,1,1); + mesh.faces[nf].setSmGroup(smooth?1:0); + mesh.faces[nf].setMatID(1); + mesh.faces[nf].setVerts(na,nc,nd); + nf++; + } + } + + // Make bottom conic cap + na = mesh.getNumVerts()-1; + int botsegs=segs; + jx = (rows-1)*segs+1;lastseg=botsegs-1; + int fstart = nf; + for(ix=0; ix<botsegs; ++ix) { + nc = ix + jx; + nb = (ix==lastseg)?jx:nc+1; + mesh.faces[nf].setEdgeVisFlags(1,1,1); + mesh.faces[nf].setSmGroup(smooth?1:0); + mesh.faces[nf].setMatID(1); + mesh.faces[nf].setVerts(na, nb, nc); + nf++; + } + + mesh.setNumTVerts(0); + mesh.setNumTVFaces(0); + mesh.InvalidateTopologyCache(); +} + + + +void AddFace(Face *f,int a,int b,int c,int evis,int smooth_group) +{ + const int ALLF = 4; + f[0].setSmGroup(smooth_group); + f[0].setMatID((MtlID)0); /*default */ + if (evis==0) f[0].setEdgeVisFlags(1,1,0); + else if (evis==1) f[0].setEdgeVisFlags(0,1,1); + else if (evis==2) f[0].setEdgeVisFlags(0,0,1); + else if (evis==ALLF) f[0].setEdgeVisFlags(1,1,1); + else f[0].setEdgeVisFlags(1,0,1); + f[0].setVerts(a,b,c); +} + + +void BuildScubaMesh(Mesh &mesh, int segs, int smooth, int llsegs, + float radius1, float radius2, float cylh) +{ + Point3 p; + int ix,jx,ic = 1; + int nf=0,nv=0, capsegs=(int)(segs/2.0f),csegs=0; + float ang; + float startAng = 0.0f; + float totalPie = TWOPI; + int lsegs = llsegs-1 + 2*capsegs; + int levels=csegs*2+(llsegs-1); + int capv=segs,sideedge=capsegs+csegs; + int totlevels=levels+capsegs*2+2; + int tvinslice=totlevels+totlevels-2; + float delta = (float)2.0*PI/(float)segs; + int VertexPerLevel=segs; + int nfaces=2*segs*(levels+1); + int ntverts=2*(segs+1)+llsegs-1; + int *edgelstl=new int[totlevels]; + int *edgelstr=new int[totlevels]; + int lastlevel=totlevels-1,dcapv=capv-1,dvertper=VertexPerLevel-1; + edgelstr[0] = edgelstl[0] = 0; + edgelstr[1] = 1; + edgelstl[1] = capv; + for (int i=2;i<=sideedge;i++){ + edgelstr[i]=edgelstr[i-1]+capv; + edgelstl[i]=edgelstr[i]+dcapv; + } + while ((i<lastlevel)&&(i<=totlevels-sideedge)){ + edgelstr[i]=edgelstr[i-1]+VertexPerLevel; + edgelstl[i]=edgelstr[i]+dcapv; + i++; + } + while (i<lastlevel) { + edgelstr[i]=edgelstr[i-1]+capv; + edgelstl[i]=edgelstr[i]+dcapv; + i++; + } + edgelstl[lastlevel]= (edgelstr[lastlevel]=edgelstl[i-1]+1); + int nverts=edgelstl[lastlevel]+1; + nfaces+=2*segs*(2*capsegs-1); + + mesh.setNumVerts(nverts); + mesh.setNumFaces(nfaces); + mesh.setSmoothFlags(smooth != 0); + mesh.setNumTVerts(0); + mesh.setNumTVFaces(0); + mesh.setSmoothFlags(smooth != 0); + + // bottom vertex + float height = cylh + radius1 + radius2; + mesh.setVert(nv, Point3(0.0f,0.0f,height)); + mesh.setVert(nverts-1, Point3(0.0f,0.0f,0.0f)); + + // Top (1) and bottom (2) cap vertices + float ru,cang,sang; + int msegs=segs,deltaend=nverts-capv-1; + ang = startAng; + msegs--; + float rincr=PI/(2.0f*capsegs),aincr; + for (jx = 0; jx<=msegs; jx++) + { + cang=(float)cos(ang); + sang=(float)sin(ang); + for(ix=1; ix<=sideedge; ix++) { + aincr = (rincr*(float)ix); + ru=(float)sin(aincr); + + p.x = cang*radius1*ru; + p.y = sang*radius1*ru; + p.z = (jx==0) ? height-radius1*(1.0f-(float)cos(aincr)) : mesh.verts[edgelstr[ix]].z; + mesh.setVert(edgelstr[ix]+jx, p); + + p.x = cang*radius2*ru; + p.y = sang*radius2*ru; + p.z = (jx==0) ? radius2*(1.0f-(float)cos(aincr)) : mesh.verts[edgelstr[lastlevel-ix]].z ; + mesh.setVert(edgelstr[lastlevel-ix]+jx,p); + } + ang += delta; + } + + //// Middle vertices + //int sidevs,startv=edgelstr[sideedge],deltav; + //for(ix=1; ix<llsegs; ix++) { + // // Put center vertices all the way up + // float u = float(ix)/float(llsegs); + // float rad = (radius1*(1.0f-u) + radius2*u); + // p.z = cylh *((float)ix/float(llsegs)) + radius2; + // ang = startAng; + // for (sidevs=0;sidevs<VertexPerLevel;sidevs++) + // p.x = (float)cos(ang)*rad; + // p.y = (float)sin(ang)*rad; + // mesh.setVert(nv, p); + // nv++; + // ang += delta; + // } + //} + + //top layer done, now reflect sides down + int sidevs,deltav; + int startv=edgelstr[sideedge]; + int endv=edgelstr[totlevels-capsegs-1]; + if (llsegs>1) + { + float sincr = cylh/llsegs; + for (sidevs=0;sidevs<VertexPerLevel;sidevs++) + { + Point3 topp = mesh.verts[startv]; + Point3 botp = mesh.verts[endv]; + p.x = (topp.x + botp.x) / 2.0f; + p.y = (topp.y + botp.y) / 2.0f; + deltav=VertexPerLevel; + for (ic=1;ic<llsegs;ic++) + { + p.z = topp.z-sincr*ic; + mesh.setVert(startv+deltav, p); + deltav+=VertexPerLevel; + } + startv++; + } + } + int lasttvl=0,lasttvr=0; + int lvert=segs; + int t0,t1,b0,b1,tvt0=0,tvt1=0,tvb0=1,tvb1=2,fc=0,smoothgr=(smooth?4:0),vseg=segs+1; + int tvcount=0,lowerside=lastlevel-sideedge,onside=0; + + BOOL ok,wrap; + // Now make faces --- + for (int clevel=0;clevel<lastlevel-1;clevel++) + { + t1=(t0=edgelstr[clevel])+1; + b1=(b0=edgelstr[clevel+1])+1; + ok=1; wrap=FALSE; + if ((clevel>0)&&(onside==1)) { + tvt0++;tvt1++;tvb0++,tvb1++; + } + if (clevel==1) { + tvt0=1;tvt1=2; + } + if (clevel==sideedge) { + tvt1+=lvert;tvt0+=lvert;tvb0+=vseg;tvb1+=vseg;onside++; + } else if (clevel==lowerside) { + tvt1+=vseg;tvt0+=vseg;tvb0+=lvert;tvb1+=lvert;onside++; + } + while ((b0<edgelstl[clevel+1])||ok) + { + if (b1==edgelstr[clevel+2]) { + b1=edgelstr[clevel+1]; + t1=edgelstr[clevel]; + ok=FALSE; + wrap=(onside!=1); + } + if (smooth) smoothgr=4; + AddFace(&mesh.faces[fc++],t0,b0,b1,0,smoothgr); + if (clevel>0) { + AddFace(&mesh.faces[fc++],t0,b1,t1,1,smoothgr); + t0++;t1++; + } + b0++;b1++;tvb0++,tvb1++; + } + } + smoothgr=(smooth?4:0); + t1=(t0=edgelstr[lastlevel-1])+1;b0=edgelstr[lastlevel]; + int lastpt=lastlevel; + if (onside==1) { + tvt0++; + tvt1++; + tvb0++; + tvb1++; + } + if (sideedge==1) { + tvt1+=vseg; + tvt0+=vseg; + tvb0+=lvert; + tvb1+=lvert; + onside++; + } + while (t0<edgelstl[lastpt]) { + if (t1==edgelstr[lastlevel]) { + t1=edgelstr[lastlevel-1]; + tvt1-=segs; + } + AddFace(&mesh.faces[fc++],t0,b0,t1,1,smoothgr); + t0++;t1++; + } + for (i=0;i<nverts;i++) + mesh.verts[i].z -= (radius2 + cylh/2.0f); + + if (edgelstr) delete []edgelstr; + if (edgelstl) delete []edgelstl; + assert(fc==mesh.numFaces); + // assert(nv==mesh.numVerts); + mesh.InvalidateTopologyCache(); +} \ No newline at end of file diff --git a/NifProps/bhkHelperFuncs.h b/NifProps/bhkHelperFuncs.h new file mode 100644 index 0000000000000000000000000000000000000000..5d59f6534f27d9812ae604f4f15d978c98f3f263 --- /dev/null +++ b/NifProps/bhkHelperFuncs.h @@ -0,0 +1,14 @@ +#ifndef __BHKHELPERFUNCS_H__ +#define __BHKHELPERFUNCS_H__ + +extern void CalcAxisAlignedBox(Mesh& mesh, Box3& box); +extern void CalcAxisAlignedBox(Mesh& mesh, Box3& box, Matrix3* tm); +extern void CalcAxisAlignedSphere(Mesh& mesh, Point3& center, float& radius); +extern void CalcCenteredSphere(Mesh& mesh, Point3& center, float& radius); + +extern void BuildBox(Mesh&mesh, float l, float w, float h); +extern void BuildSphere(Mesh&mesh, float radius, int segs=32, int smooth=1, float startAng = 0.0f); +extern void BuildScubaMesh(Mesh &mesh, int segs, int smooth, int llsegs, + float radius1, float radius2, float cylh); + +#endif \ No newline at end of file diff --git a/NifProps/bhkHelperInterface.cpp b/NifProps/bhkHelperInterface.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1b5f5152355d6377733f05a11117262f0d1dc588 --- /dev/null +++ b/NifProps/bhkHelperInterface.cpp @@ -0,0 +1,43 @@ +/********************************************************************** +*< +FILE: bhkHelperInterface.cpp + +DESCRIPTION: Collision Helper Object Implementation + +CREATED BY: tazpn (Theo) + +HISTORY: + V1.0 - Derived from 3ds max prim sphere example + +*> Copyright (c) 2006, All Rights Reserved. +**********************************************************************/ +#pragma warning( disable:4800 ) +#include <max.h> +#include "MAX_Mem.h" +#include <map> +#include "NifProps.h" +#include "iparamm.h" +#include "Simpobj.h" +#include "notify.h" +#include "macroRec.h" +#include "bhkHelperInterface.h" +#include "NifPlugins.h" +#include "NifGui.h" +#include "NifStrings.h" +//--- Parameter map/block descriptors ------------------------------- + + +FPInterfaceDesc thebhkHelperInterface( + BHKHELPERINTERFACE_DESC, _T("bhkHelper"), -1/*IDS_OPS*/, 0, FP_MIXIN, + + bhkHelperInterface::get_mesh, _T("getMesh"), 0, TYPE_MESH, 0, 0, + end); + +FPInterfaceDesc *bhkHelperInterface::GetDesc() { + return &thebhkHelperInterface; +} + +FPInterfaceDesc* GetbhkHelperInterfaceDesc() +{ + return &thebhkHelperInterface; +} diff --git a/NifProps/bhkHelperInterface.h b/NifProps/bhkHelperInterface.h new file mode 100644 index 0000000000000000000000000000000000000000..b964ca31408441ad4a3829cedbad5e2d5bed8495 --- /dev/null +++ b/NifProps/bhkHelperInterface.h @@ -0,0 +1,50 @@ +/********************************************************************** +*< +FILE: bhkHelperInterface.hpp + +DESCRIPTION: Collision Helper Object Declration + +CREATED BY: tazpn (Theo) + +HISTORY: + V1.0 - Derived from 3ds max prim Helper example + +*> Copyright (c) 2006, All Rights Reserved. +**********************************************************************/ +#ifndef __BHKHELPERINTERFACE__H +#define __BHKHELPERINTERFACE__H + +#include <ifnpub.h> + +#ifndef _countof +#define _countof(x) (sizeof(x)/sizeof((x)[0])) +#endif + +//! The unique instance of the helper interface +extern CoreExport FPInterfaceDesc gbhkHelperDesc; + +const Interface_ID BHKHELPERINTERFACE_DESC(0xd4ecb630, 0x52c54024); + +extern FPInterfaceDesc* GetbhkHelperInterfaceDesc(); + +class bhkHelperInterface : public FPMixinInterface +{ +public: + virtual const Mesh* GetMesh() const = 0 ; + + //Function Publishing System + enum { + get_mesh, + }; + + //Function Map For Mixin Interface + //************************************************* + BEGIN_FUNCTION_MAP + FN_0(get_mesh, TYPE_MESH, GetMesh) \ + END_FUNCTION_MAP + + FPInterfaceDesc* GetDesc(); // <--- Must Implement + //************************************************** +}; + +#endif \ No newline at end of file diff --git a/NifProps/bhkListObj.cpp b/NifProps/bhkListObj.cpp index a572cceb0b821d8fbed4d3bbd885fa4ea81726ce..10c583519d8485591d86847938ad4c6c536175f7 100644 --- a/NifProps/bhkListObj.cpp +++ b/NifProps/bhkListObj.cpp @@ -571,52 +571,3 @@ int bhkListObject::Display(TimeValue t, INode* inode, ViewExp *vpt, int flags) gw->setRndLimits(rlim); return 0; } - -#if 0 -int bhkListObject::HitTest(TimeValue t, INode *inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt) -{ - Matrix3 tm(1); - HitRegion hitRegion; - DWORD savedLimits; - Point3 pt(0,0,0); - - vpt->getGW()->setTransform(tm); - GraphicsWindow *gw = vpt->getGW(); - Material *mtl = gw->getMaterial(); - - tm = inode->GetObjectTM(t); - MakeHitRegion(hitRegion, type, crossing, 4, p); - - gw->setRndLimits(((savedLimits = gw->getRndLimits())|GW_PICK)&~GW_ILLUM); - gw->setHitRegion(&hitRegion); - gw->clearHitCode(); - -// DrawAndHit(t, inode, vpt); - float size = 20.0f; - Point3 pts[5]; - // X - pts[0] = Point3(-size, 0.0f, 0.0f); pts[1] = Point3(size, 0.0f, 0.0f); - vpt->getGW()->polyline(2, pts, NULL, NULL, FALSE, NULL); - - // Y - pts[0] = Point3(0.0f, -size, 0.0f); pts[1] = Point3(0.0f, size, 0.0f); - vpt->getGW()->polyline(2, pts, NULL, NULL, FALSE, NULL); - - // Z - pts[0] = Point3(0.0f, 0.0f, -size); pts[1] = Point3(0.0f, 0.0f, size); - vpt->getGW()->polyline(2, pts, NULL, NULL, FALSE, NULL); - - - gw->setRndLimits(savedLimits); - - // CAL-08/27/03: This doesn't make sense. It shouldn't do this. (Defect #468271) - // This will always select this helper when there's an intersection on the bounding box and the selection window. - // TODO: There's still a problem with window selection. We need to check if it hits all components in DrawAndHit. - /* - if((hitRegion.type != POINT_RGN) && !hitRegion.crossing) - return TRUE; - */ - - return gw->checkHitCode(); -} -#endif \ No newline at end of file diff --git a/NifProps/bhkProxyObj.cpp b/NifProps/bhkProxyObj.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0c2dbbfee7a08046db88e710e45fd9792c5aea80 --- /dev/null +++ b/NifProps/bhkProxyObj.cpp @@ -0,0 +1,780 @@ +/********************************************************************** +*< +FILE: bhkProxyObj.cpp + +DESCRIPTION: Collision Proxy Object Implementation + +CREATED BY: tazpn (Theo) + +HISTORY: + V1.0 - Derived from 3ds max prim box example + +*> Copyright (c) 2006, All Rights Reserved. +**********************************************************************/ +#pragma warning( disable:4800 ) +#include <max.h> +#include "MAX_Mem.h" +#include <map> +#include "NifProps.h" +#include "iparamm.h" +#include "Simpobj.h" +#include "surf_api.h" +#include "notify.h" +#include "macroRec.h" +#include "bhkRigidBodyInterface.h" +#include "NifGui.h" +#include "NifStrings.h" +#include "bhkHelperFuncs.h" +#include "meshdelta.h" +#ifndef _countof +#define _countof(x) (sizeof(x)/sizeof((x)[0])) +#endif + +extern void compute_convex_hull(Mesh& mesh, Mesh& outmesh); + +Class_ID BHKPROXYOBJECT_CLASS_ID = Class_ID(0x3f087788, BHKRIGIDBODYCLASS_DESC.PartB()); +class ProxyPickObjectMode; + +class bhkProxyValidatorClass : public PBValidator +{ +public: + class bhkProxyObject *mod; +private: + BOOL Validate(PB2Value &v) + { + INode *node = (INode*) v.r; + if (node->TestForLoop(FOREVER,(ReferenceMaker *) mod)!=REF_SUCCEED) return FALSE; + + ObjectState os = node->EvalWorldState(0); + //Allow only tri object derived objects + if (os.obj->CanConvertToType(triObjectClassID) && os.obj->SuperClassID() != SHAPE_CLASS_ID) { + return TRUE; + } + return FALSE; + }; +}; + +class bhkProxyObject : public SimpleObject2 +{ + typedef SimpleObject2 BaseClass; +public: + // Class vars + IParamMap2 *pmapParam; + IObjParam *ip; + ProxyPickObjectMode *pickObMode; + IParamMap2 *pbvParams[1]; //proxy + Interface *mIP; + bhkProxyValidatorClass validator; + ICustButton *iPickButton; + Mesh proxyMesh; + Point3 proxyPos; + bool forceRedraw; + + bhkProxyObject(BOOL loading); + ~bhkProxyObject(); + + // From Object + int CanConvertToType(Class_ID obtype); + Object* ConvertToType(TimeValue t, Class_ID obtype); + void GetCollapseTypes(Tab<Class_ID> &clist,Tab<TSTR*> &nlist); + + CreateMouseCallBack* GetCreateMouseCallBack(); + void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev); + void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next); + RefTargetHandle Clone(RemapDir& remap); + TCHAR *GetObjectName() { return GetString(IDS_RB_PROXY); } + + int NumParamBlocks() { return 1; } // return number of ParamBlocks in this instance + IParamBlock2* GetParamBlock(int i) { return pblock2; } // return i'th ParamBlock + IParamBlock2* GetParamBlockByID(BlockID id) { return (pblock2->ID() == id) ? pblock2 : NULL; } // return id'd ParamBlock + + // Animatable methods + void DeleteThis() {delete this;} + Class_ID ClassID() { return BHKPROXYOBJECT_CLASS_ID; } + SClass_ID SuperClassID() { return HELPER_CLASS_ID; } + + // From SimpleObject + void BuildMesh(TimeValue t); + BOOL OKtoDisplay(TimeValue t); + void InvalidateUI(); + + int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags); + + void BuildEmpty(); + void BuildColBox(); + void BuildColStrips(); + void BuildColPackedStrips(); + void BuildColConvex(); + + void UpdateUI(); + + Modifier *CreateWSMMod(INode *) + { + return NULL; + } +}; + +//--- ClassDescriptor and class vars --------------------------------- + +// The class descriptor for box +class bhkProxyObjClassDesc : public ClassDesc2 +{ +public: + bhkProxyObjClassDesc(); + int IsPublic() { return 1; } + void * Create(BOOL loading = FALSE) { + return new bhkProxyObject(loading); + } + const TCHAR * ClassName() { return GetString(IDS_RB_PROXY_CLASS); } + SClass_ID SuperClassID() { return HELPER_CLASS_ID; } + Class_ID ClassID() { return BHKPROXYOBJECT_CLASS_ID; } + const TCHAR* Category() { return "NifTools"; } + + const TCHAR* InternalName() { return _T("bhkProxyShape"); } // returns fixed parsable name (scripter-visible name) + HINSTANCE HInstance() { return hInstance; } // returns owning module handle +}; + +extern ClassDesc2* GetbhkProxyObjDesc(); + +// in prim.cpp - The dll instance handle +extern HINSTANCE hInstance; + +//--- Parameter map/block descriptors ------------------------------- + +// Parameter and ParamBlock IDs +enum { list_params, bv_mesh, }; // pblock2 ID +enum +{ + PB_MATERIAL, + PB_MESHLIST, + PB_BOUND_TYPE, + PB_CENTER, +}; + +enum { list_params_panel, }; + +enum { bv_type_none, bv_type_box, bv_type_shapes, bv_type_packed, bv_type_convex, }; // pblock ID + +class ProxyBVTypePBAccessor : public PBAccessor +{ +public: + void Get(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t, Interval &valid) + { + bhkProxyObject* p = (bhkProxyObject*)owner; + switch (id) + { + case PB_CENTER: + v.p = const_cast<Point3*>(&p->proxyPos); + break; + } + } + + void Set(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t) // set from v + { + bhkProxyObject* p = (bhkProxyObject*)owner; + switch (id) + { + case PB_BOUND_TYPE: + { + switch (v.i) + { + case bv_type_none: + // Delete mesh. + //p->BuildEmpty(); + break; + + case bv_type_shapes: // Shapes + //p->BuildColBox(); + //BuildBox(mesh,,,) + break; + + case bv_type_packed: // Packed + //BuildSphere(); + break; + + case bv_type_convex: // Capsule + //BuildScubaMesh(); + break; + } + } + } + } +}; + +static ProxyBVTypePBAccessor bv_type_accessor; + +static ParamBlockDesc2 param_blk ( + list_params, _T("parameters"), 0, NULL, P_AUTO_CONSTRUCT + P_AUTO_UI + P_MULTIMAP, 0, + //rollout + 1, + list_params, IDD_PROXYPARAM1, IDS_PARAMS, 0, 0, NULL, + + // params + PB_MATERIAL, _T("material"), TYPE_INT, P_ANIMATABLE, IDS_DS_MATERIAL, + p_default, NP_DEFAULT_HVK_MATERIAL, + end, + + PB_BOUND_TYPE, _T("boundType"), TYPE_INT, 0, IDS_BV_BOUNDING_TYPE, + p_default, 0, + p_range, 0, 4, + p_ui, list_params, TYPE_RADIO, 5, IDC_RDO_NO_COLL, IDC_RDO_AXIS_ALIGNED_BOX, IDC_RDO_STRIPS_SHAPE, IDC_RDO_PACKED_STRIPS, IDC_RDO_CONVEX, + p_accessor, &bv_type_accessor, + end, + + PB_MESHLIST, _T("meshProxy"), TYPE_INODE_TAB, 0, P_AUTO_UI|P_VARIABLE_SIZE, IDS_MESHLIST, + p_ui, list_params, TYPE_NODELISTBOX, IDC_LIST1,IDC_ADD,0,IDC_REMOVE, + end, + + PB_CENTER, _T("center"), TYPE_POINT3, P_TRANSIENT, IDS_CENTER, + p_accessor, &bv_type_accessor, + end, + + end + ); + +// bug in pb desc? forces us to use this rather than in inline version +static bhkProxyObjClassDesc listDesc; +extern ClassDesc2* GetbhkProxyObjDesc() { return &listDesc; } +bhkProxyObjClassDesc::bhkProxyObjClassDesc() { + param_blk.SetClassDesc(this); +} + + +class ProxyPickObjectMode : + public PickModeCallback, + public PickNodeCallback { +public: + bhkProxyObject *mod; + + BOOL HitTest(IObjParam *ip,HWND hWnd,ViewExp *vpt,IPoint2 m,int flags); + BOOL Pick(IObjParam *ip,ViewExp *vpt); + void EnterMode(IObjParam *ip); + void ExitMode(IObjParam *ip); + BOOL RightClick(IObjParam *ip,ViewExp *vpt) {return TRUE;} + BOOL Filter(INode *node); + PickNodeCallback *GetFilter() {return this;} +}; + +//--- ProxyPickObjectMode ------------------------------------------------ + +BOOL ProxyPickObjectMode::Filter(INode *node) +{ + if (node) { + node->BeginDependencyTest(); + mod->NotifyDependents(FOREVER,0,REFMSG_TEST_DEPENDENCY); + if (node->EndDependencyTest()) { + return FALSE; + } + ////added code for looptest + //if (node->TestForLoop(FOREVER,(ReferenceMaker *) mod)!=REF_SUCCEED) + // return FALSE; + + for (int i = 0;i < mod->pblock2->Count(PB_MESHLIST); i++) { + INode *tnode = NULL; + mod->pblock2->GetValue(PB_MESHLIST,0,tnode,FOREVER,i); + if (node == tnode) + return FALSE; + } + + ObjectState os = node->EvalWorldState(0); + //added code such that lines are not selected + if ( (os.obj->IsSubClassOf(triObjectClassID) || os.obj->CanConvertToType(triObjectClassID)) + && (os.obj->SuperClassID() != SHAPE_CLASS_ID) + ) + { + return TRUE; + } + if (os.obj->SuperClassID() == HELPER_CLASS_ID && os.obj->ClassID().PartB() == BHKRIGIDBODYCLASS_DESC.PartB() ) { + return TRUE; + } + } + return FALSE; +} + +BOOL ProxyPickObjectMode::HitTest( + IObjParam *ip,HWND hWnd,ViewExp *vpt,IPoint2 m,int flags) +{ + INode *node = mod->mIP->PickNode(hWnd,m, this); //added "this" argument such that the Filter above is used + return node?TRUE:FALSE; +} + +BOOL ProxyPickObjectMode::Pick(IObjParam *ip,ViewExp *vpt) +{ + BOOL rv = FALSE; + if (INode *node = vpt->GetClosestHit()) { + theHold.Begin(); + ObjectState os = node->EvalWorldState(0); + if (os.obj->CanConvertToType(triObjectClassID)) { + mod->pblock2->Append(PB_MESHLIST,1,&node,1); + rv = TRUE; + } + theHold.Accept(GetString(IDS_ADD_MESH)); + } + return rv; +} + +void ProxyPickObjectMode::EnterMode(IObjParam *ip) +{mod->iPickButton->SetCheck(TRUE);} + +void ProxyPickObjectMode::ExitMode(IObjParam *ip) +{mod->iPickButton->SetCheck(FALSE);} + +static ProxyPickObjectMode thePickMode; + + + +class ProxyParamDlgProc : public ParamMap2UserDlgProc { +public: + bhkProxyObject *so; + HWND thishWnd; + NpComboBox mCbMaterial; + + ProxyParamDlgProc(bhkProxyObject *s) {so=s;thishWnd=NULL;} + INT_PTR DlgProc(TimeValue t,IParamMap2 *map,HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam); + void Update(TimeValue t); + void DeleteThis() {delete this;} + + //--- ParamDlgProc -------------------------------- + void TurnSpinner(HWND hWnd,int SpinNum,BOOL ison) + { + ISpinnerControl *spin2 = GetISpinner(GetDlgItem(hWnd,SpinNum)); + if (ison) spin2->Enable();else spin2->Disable(); + ReleaseISpinner(spin2); + }; + +}; + +void ProxyParamDlgProc::Update(TimeValue t) +{ + if (!thishWnd) + return; + return; +} + +INT_PTR ProxyParamDlgProc::DlgProc(TimeValue t,IParamMap2 *map,HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) +{ + thishWnd=hWnd; + switch (msg) + { + case WM_INITDIALOG: + { + mCbMaterial.init(GetDlgItem(hWnd, IDC_CB_MATERIAL)); + for (const char **str = NpHvkMaterialNames; *str; ++str) + mCbMaterial.add(*str); + + int sel = NP_DEFAULT_HVK_MATERIAL; + Interval valid; + so->pblock2->GetValue( PB_MATERIAL, 0, sel, valid); + mCbMaterial.select( sel ); + + Update(t); + break; + } + case WM_DESTROY: + if (so && so->iPickButton != NULL) { + ReleaseICustButton(so->iPickButton); + so->iPickButton = NULL; + } + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDC_CB_MATERIAL: + if (HIWORD(wParam)==CBN_SELCHANGE) { + so->pblock2->SetValue( PB_MATERIAL, 0, mCbMaterial.selection() ); + } + break; + } + break; + } + return FALSE; +} +//--- Proxy methods ------------------------------- + + +bhkProxyObject::bhkProxyObject(BOOL loading) +{ + pmapParam = NULL; + ip = NULL; + pickObMode = NULL; + pbvParams[0] = NULL; + mIP = NULL; + iPickButton = NULL; + validator.mod = this; + forceRedraw = false; + + SetAFlag(A_PLUGIN1); + listDesc.MakeAutoParamBlocks(this); + assert(pblock2); +} + +bhkProxyObject::~bhkProxyObject() +{ + param_blk.SetUserDlgProc(); + if (pmapParam) { + pmapParam = NULL; + } +} + +void bhkProxyObject::BeginEditParams(IObjParam *ip,ULONG flags,Animatable *prev) +{ + BaseClass::BeginEditParams(ip,flags,prev); + mIP = ip; + + listDesc.BeginEditParams(ip,this,flags,prev); + param_blk.SetUserDlgProc(new ProxyParamDlgProc(this)); + pmapParam = pblock2->GetMap(list_params); + + this->ip = ip; +} + +void bhkProxyObject::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next ) +{ + param_blk.SetUserDlgProc(); + + BaseClass::EndEditParams(ip,flags,next); + this->ip = NULL; + pmapParam = NULL; + + if (iPickButton != NULL) { + ReleaseICustButton(iPickButton); + iPickButton = NULL; + } + + // tear down the appropriate auto-rollouts + listDesc.EndEditParams(ip, this, flags, next); + mIP = NULL; +} + +void bhkProxyObject::UpdateUI() +{ + if (ip == NULL) + return; + ProxyParamDlgProc* dlg = static_cast<ProxyParamDlgProc*>(pmapParam->GetUserDlgProc()); + dlg->Update(ip->GetTime()); +} + +enum +{ + POSX = 0, // right + POSY = 1, // back + POSZ = 2, // top + NEGX = 3, // left + NEGY = 4, // front + NEGZ = 5, // bottom +}; + +void bhkProxyObject::BuildMesh(TimeValue t) +{ + ivalid = FOREVER; + + int bvType = 0; + pblock2->GetValue(PB_BOUND_TYPE, 0, bvType, FOREVER, 0); + + BuildEmpty(); + + switch (bvType) + { + default: + case bv_type_none: + // Delete mesh. + break; + + case bv_type_box: // box + BuildColBox(); + break; + + case bv_type_shapes: // Shapes + BuildColStrips(); + //BuildBox(mesh,,,) + break; + + case bv_type_packed: // Packed + BuildColPackedStrips(); + //BuildSphere(); + break; + + case bv_type_convex: // Capsule + BuildColConvex(); + //BuildScubaMesh(); + break; + } +} + +Object* bhkProxyObject::ConvertToType(TimeValue t, Class_ID obtype) +{ + if (obtype == triObjectClassID) + { + int bvType = 0; + pblock2->GetValue(PB_BOUND_TYPE, 0, bvType, FOREVER, 0); + if (bvType != 0) + { + TriObject *ob = CreateNewTriObject(); +#if VERSION_3DSMAX >= ((5000<<16)+(15<<8)+0) // Version 5+ + ob->GetMesh().CopyBasics(proxyMesh); +#else + ob->GetMesh() = proxyMesh; +#endif + ob->SetChannelValidity(TOPO_CHAN_NUM,ObjectValidity(t)); + ob->SetChannelValidity(GEOM_CHAN_NUM,ObjectValidity(t)); + return ob; + } + } + return 0; +} + +int bhkProxyObject::CanConvertToType(Class_ID obtype) +{ + if (obtype == triObjectClassID) { + int bvType = 0; + pblock2->GetValue(PB_BOUND_TYPE, 0, bvType, FOREVER, 0); + return (bvType != 0) ? TRUE : FALSE; + } + return FALSE; +} + + +void bhkProxyObject::GetCollapseTypes(Tab<Class_ID> &clist,Tab<TSTR*> &nlist) +{ + Object::GetCollapseTypes(clist, nlist); +} + +class ProxyObjCreateCallBack: public CreateMouseCallBack { + bhkProxyObject *ob; + Point3 p0,p1; + IPoint2 sp0, sp1; + BOOL square; +public: + int proc( ViewExp *vpt,int msg, int point, int flags, IPoint2 m, Matrix3& mat ); + void SetObj(bhkProxyObject *obj) { ob = obj; } +}; + +int ProxyObjCreateCallBack::proc(ViewExp *vpt,int msg, int point, int flags, IPoint2 m, Matrix3& mat ) { + Point3 d; + if (msg == MOUSE_FREEMOVE) + { + vpt->SnapPreview(m,m,NULL, SNAP_IN_3D); + } + + else if (msg==MOUSE_POINT||msg==MOUSE_MOVE) { + switch(point) { + case 0: + // Find the node and plug in the wire color + { + ULONG handle; + ob->NotifyDependents(FOREVER, (PartID)&handle, REFMSG_GET_NODE_HANDLE); + INode *node = GetCOREInterface()->GetINodeByHandle(handle); + if (node) node->SetWireColor(RGB(255, 0, 0)); + } + + sp0 = m; + //ob->suspendSnap = TRUE; + p0 = vpt->SnapPoint(m,m,NULL,SNAP_IN_3D); + p1 = p0 + Point3(.01,.01,.01); + mat.SetTrans(float(.5)*(p0+p1)); + + ob->pmapParam->Invalidate(); + + if (msg==MOUSE_POINT) + { + //ob->suspendSnap = FALSE; + return CREATE_STOP; + } + break; + } + } + else + if (msg == MOUSE_ABORT) { + return CREATE_ABORT; + } + + return TRUE; +} + +static ProxyObjCreateCallBack listCreateCB; + +CreateMouseCallBack* bhkProxyObject::GetCreateMouseCallBack() +{ + listCreateCB.SetObj(this); + return(&listCreateCB); +} + + +BOOL bhkProxyObject::OKtoDisplay(TimeValue t) +{ + return TRUE; +} + +void bhkProxyObject::InvalidateUI() +{ + param_blk.InvalidateUI(pblock2->LastNotifyParamID()); + if (pmapParam) pmapParam->Invalidate(); +} + +RefTargetHandle bhkProxyObject::Clone(RemapDir& remap) +{ + bhkProxyObject* newob = new bhkProxyObject(FALSE); + newob->ReplaceReference(0,remap.CloneRef(pblock2)); + newob->ivalid.SetEmpty(); + BaseClone(this, newob, remap); + return(newob); +} + +int bhkProxyObject::Display(TimeValue t, INode* inode, ViewExp *vpt, int flags) +{ + if (forceRedraw) + { + Interface *gi = GetCOREInterface(); + gi->ForceCompleteRedraw(); + } + + Matrix3 m; + Color color = Color(inode->GetWireColor()); + GraphicsWindow *gw = vpt->getGW(); + Material *mtl = gw->getMaterial(); + m = inode->GetObjectTM(t); + gw->setTransform(m); + DWORD rlim = gw->getRndLimits(); + + DWORD newrlim = GW_WIREFRAME|GW_Z_BUFFER; +#if VERSION_3DSMAX >= ((5000<<16)+(15<<8)+0) // Version 5+ + newrlim |= GW_EDGES_ONLY; +#endif + gw->setRndLimits(newrlim); + + if (inode->Selected()) + gw->setColor( LINE_COLOR, GetSelColor()); + else if(!inode->IsFrozen() && !inode->Dependent()) + gw->setColor( LINE_COLOR, color); + + Matrix3 m3(true); + + float size = 20.0f; + Point3 pts[5]; + // X + pts[0] = Point3(-size, 0.0f, 0.0f); pts[1] = Point3(size, 0.0f, 0.0f); + vpt->getGW()->polyline(2, pts, NULL, NULL, FALSE, NULL); + + // Y + pts[0] = Point3(0.0f, -size, 0.0f); pts[1] = Point3(0.0f, size, 0.0f); + vpt->getGW()->polyline(2, pts, NULL, NULL, FALSE, NULL); + + // Z + pts[0] = Point3(0.0f, 0.0f, -size); pts[1] = Point3(0.0f, 0.0f, size); + vpt->getGW()->polyline(2, pts, NULL, NULL, FALSE, NULL); + + //UpdateMesh(t); + + int bvType = 0; + pblock2->GetValue(PB_BOUND_TYPE, 0, bvType, FOREVER, 0); + if (bvType != 0) + { + Matrix3 tm = gw->getTransform(); + Matrix3 proxyTM(true); + proxyTM.SetTranslate(proxyPos); + gw->setTransform(proxyTM); + proxyMesh.render( gw, mtl, NULL, COMP_ALL); + gw->setTransform(tm); + } + gw->setRndLimits(rlim); + return 0; +} + +void bhkProxyObject::BuildEmpty() +{ + BuildBox(mesh, 10.0f, 10.0f, 10.0f); + proxyMesh.FreeAll(); + proxyPos = Point3::Origin; + forceRedraw = true; +} + +void bhkProxyObject::BuildColBox() +{ + Box3 box; box.Init(); + for (int i = 0;i < pblock2->Count(PB_MESHLIST); i++) { + INode *tnode = NULL; + pblock2->GetValue(PB_MESHLIST,0,tnode,FOREVER,i); + if (tnode) + { + ObjectState os = tnode->EvalWorldState(0); + Matrix3 wm = tnode->GetNodeTM(0); + TriObject *tri = (TriObject *)os.obj->ConvertToType(0, Class_ID(TRIOBJ_CLASS_ID, 0)); + if (tri) + { + Box3 box2; box2.Init(); + Mesh& mesh = tri->GetMesh(); + CalcAxisAlignedBox(mesh, box2, &wm); + box += box2; + } + } + } + BuildBox(proxyMesh, box.Max().y-box.Min().y, box.Max().x-box.Min().x, box.Max().z-box.Min().z); + + MNMesh mn(proxyMesh); + Matrix3 tm(true); + tm.SetTranslate(box.Center()); + mn.Transform(tm); + mn.OutToTri(proxyMesh); + + //proxyPos = box.Center(); + proxyPos = Point3::Origin; + forceRedraw = true; +} + +void bhkProxyObject::BuildColStrips() +{ + proxyMesh.FreeAll(); + MeshDelta md(proxyMesh); + for (int i = 0;i < pblock2->Count(PB_MESHLIST); i++) { + INode *tnode = NULL; + pblock2->GetValue(PB_MESHLIST,0,tnode,FOREVER,i); + if (tnode) + { + ObjectState os = tnode->EvalWorldState(0); + Matrix3 wm = tnode->GetNodeTM(0); + TriObject *tri = (TriObject *)os.obj->ConvertToType(0, Class_ID(TRIOBJ_CLASS_ID, 0)); + if (tri) + { + Mesh& mesh = tri->GetMesh(); + MeshDelta tmd (mesh); + md.AttachMesh(proxyMesh, mesh, wm, 0); + md.Apply(proxyMesh); + } + } + } + proxyPos = Point3::Origin; + forceRedraw = true; +} + +void bhkProxyObject::BuildColPackedStrips() +{ + BuildColStrips(); +} + +void bhkProxyObject::BuildColConvex() +{ + proxyMesh.FreeAll(); + MeshDelta md(proxyMesh); + for (int i = 0;i < pblock2->Count(PB_MESHLIST); i++) { + INode *tnode = NULL; + pblock2->GetValue(PB_MESHLIST,0,tnode,FOREVER,i); + if (tnode) + { + ObjectState os = tnode->EvalWorldState(0); + Matrix3 wm = tnode->GetNodeTM(0); + TriObject *tri = (TriObject *)os.obj->ConvertToType(0, Class_ID(TRIOBJ_CLASS_ID, 0)); + if (tri) + { + Mesh& mesh = tri->GetMesh(); + MeshDelta tmd (mesh); + md.AttachMesh(proxyMesh, mesh, wm, 0); + md.Apply(proxyMesh); + } + } + } + compute_convex_hull(proxyMesh, proxyMesh); + + proxyPos = Point3::Origin; + forceRedraw = true; +} diff --git a/NifProps/bhkRigidBodyModifer.cpp b/NifProps/bhkRigidBodyModifer.cpp index c15b62d6affa6ba9df42a762bc4687add82f444b..2753e93946a391162b5618c93034a942951af753 100644 --- a/NifProps/bhkRigidBodyModifer.cpp +++ b/NifProps/bhkRigidBodyModifer.cpp @@ -6,84 +6,14 @@ #include "NifPlugins.h" #include "NifGui.h" #include "bhkRigidBodyInterface.h" +#include "bhkHelperInterface.h" +#include "bhkHelperFuncs.h" +#include <MeshDelta.h> using namespace std; #define PBLOCK_REF 0 -const Class_ID BHKRIGIDBODYMODIFIER_CLASS_ID = Class_ID(0x398fd801, 0x303e44e5); -class PickObjectMode; - -extern void BuildBox(Mesh&mesh, float l, float w, float h); -extern void BuildSphere(Mesh&mesh, float radius, int segs=32, int smooth=1, float startAng = 0.0f); -extern void BuildScubaMesh(Mesh &mesh, int segs, int smooth, int llsegs, - float radius1, float radius2, float cylh); - -void CalcAxisAlignedBox(Mesh& mesh, Box3& box) -{ - int nv = mesh.getNumVerts(); - box.IncludePoints(mesh.getVertPtr(0), nv, NULL); -} - -// Calculate bounding sphere using minimum-volume axis-align bounding box. Its fast but not a very good fit. -void CalcAxisAlignedSphere(Mesh& mesh, Point3& center, float& radius) -{ - //--Calculate center & radius--// - - //Set lows and highs to first vertex - int nv = mesh.getNumVerts(); - - Point3 lows = mesh.getVert(0); - Point3 highs = mesh.getVert(0); - - //Iterate through the vertices, adjusting the stored values - //if a vertex with lower or higher values is found - for ( unsigned int i = 0; i < nv; ++i ) { - const Point3 & v = mesh.getVert(i); - - if ( v.x > highs.x ) highs.x = v.x; - else if ( v.x < lows.x ) lows.x = v.x; - - if ( v.y > highs.y ) highs.y = v.y; - else if ( v.y < lows.y ) lows.y = v.y; - - if ( v.z > highs.z ) highs.z = v.z; - else if ( v.z < lows.z ) lows.z = v.z; - } - - //Now we know the extent of the shape, so the center will be the average - //of the lows and highs - center = (highs + lows) / 2.0f; - - //The radius will be the largest distance from the center - Point3 diff; - float dist2(0.0f), maxdist2(0.0f); - for ( unsigned int i = 0; i < nv; ++i ) { - const Point3 & v = mesh.getVert(i); - - diff = center - v; - dist2 = diff.x * diff.x + diff.y * diff.y + diff.z * diff.z; - if ( dist2 > maxdist2 ) maxdist2 = dist2; - }; - radius = sqrt(maxdist2); -} - -// Calculate bounding sphere using average position of the points. Better fit but slower. -void CalcCenteredSphere(Mesh& mesh, Point3& center, float& radius) -{ - int nv = mesh.getNumVerts(); - Point3 sum; - for (int i=0; i<nv; ++i) - sum += mesh.getVert(i); - center = sum / float(nv); - float radsq = 0.0f; - for (int i=0; i<nv; ++i){ - Point3 diff = mesh.getVert(i) - center; - float mag = diff.LengthSquared(); - radsq = max(radsq, mag); - } - radius = Sqrt(radsq); -} - +Class_ID BHKRIGIDBODYMODIFIER_CLASS_ID = Class_ID(0x398fd801, 0x303e44e5); class bhkValidatorClass : public PBValidator { @@ -111,9 +41,7 @@ private: }; }; -enum { bv_type_none, bv_type_box, bv_type_sphere, bv_type_capsule, bv_type_mesh }; // pblock ID - -class bhkRigidBodyModifier : public Modifier, public bhkRigidBodyIfcHelper +class bhkRigidBodyModifier : public Modifier, public bhkHelperInterface { public: @@ -144,6 +72,13 @@ public: int Display(TimeValue t, INode* inode, ViewExp *vpt, int flagst, ModContext *mc); + void BuildEmpty(Mesh& mesh); + void BuildColBox(Mesh& mesh); + void BuildColSphere(Mesh& mesh); + void BuildColCapsule(Mesh& mesh); + void BuildColStrips(Mesh& mesh); + void BuildColPackedStrips(Mesh& mesh); + void BuildColConvex(Mesh& mesh); void SelectionSetChanged(Interface *ip,IUtil *iu); @@ -179,19 +114,23 @@ public: void UpdateBVDialogs(); - BaseInterface *GetInterface(Interface_ID id) { - if (id == BHKRIGIDBODYINTERFACE_DESC) - return this; - return Modifier::GetInterface(id); - } + const Mesh* GetMesh() const + { + return &proxyMesh; + } + + virtual BaseInterface *GetInterface(Interface_ID id) + { + if (id == BHKHELPERINTERFACE_DESC) + return (bhkHelperInterface*)this; + return Modifier::GetInterface(id); + } -public: - friend class PickObjectMode; +public: StdMat2* collMat; - Mesh mesh; + Mesh proxyMesh; - PickObjectMode *pickObMode; IParamBlock2 *pblock; IParamMap2 *pmapParam; IParamMap2 *pbvParams[4]; //box, sphere, capsule, proxy @@ -199,12 +138,7 @@ public: Interface *mIP; Tab<INode*> mNodes; - NpComboBox mCbLayer; - NpComboBox mCbMaterial; - NpComboBox mCbMotionSystem; - NpComboBox mCbQualityType; bhkValidatorClass validator; - ICustButton *iPickButton; void enableGUI(BOOL object, BOOL hvk, BOOL anim); }; @@ -235,141 +169,27 @@ class bhkRigidBodyModifierClassDesc : public ClassDesc2 // Parameter and ParamBlock IDs enum { havok_params, bv_box, bv_sphere, bv_capsule, bv_mesh}; // pblock ID -enum { PB_BOUND_TYPE, PB_MESHLIST, }; +enum { PB_BOUND_TYPE, PB_MATERIAL, }; enum { havok_params_panel, }; -class BVTypePBAccessor : public PBAccessor -{ -public: - - void Set(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t) // set from v - { - bhkRigidBodyModifier* p = (bhkRigidBodyModifier*)owner; - switch (id) - { - case PB_BOUND_TYPE: - { - switch (v.i) - { - case bv_type_none: - // Delete mesh. - break; - - case bv_type_box: // Box - - //BuildBox(mesh,,,) - break; - - case bv_type_sphere: // Sphere - //BuildSphere(); - break; - - case bv_type_capsule: // Capsule - //BuildScubaMesh(); - break; - - case bv_type_mesh: - break; - } - } - } - } -}; - - -static BVTypePBAccessor bv_type_accessor; - +enum { bv_type_none, bv_type_box, bv_type_sphere, bv_type_capsule, bv_type_shapes, bv_type_convex, }; // pblock ID static ParamBlockDesc2 havok_param_blk ( havok_params, _T("BoundingVolumes"), 0, NULL, P_AUTO_CONSTRUCT + P_AUTO_UI + P_MULTIMAP, PBLOCK_REF, //rollout - 2, - havok_params, IDD_RB_MOD_PANEL, IDS_PARAMS, 0, 0, NULL, - bv_mesh, IDD_RB_MOD_PANEL4, IDS_RB_MOD_PANEL4, 0, 0, NULL, - - PB_BOUND_TYPE, _T("boundType"), TYPE_INT, 0, IDS_BV_BOUNDING_TYPE, - p_default, 0, - p_range, 0, 4, - p_ui, havok_params, TYPE_RADIO, 5, IDC_RDO_NO_COLL, IDC_RDO_AXIS_ALIGNED_BOX, IDC_RDO_SPHERE, IDC_RDO_CAPSULE, IDC_RDO_PROXY_MESH, - p_accessor, &bv_type_accessor, - end, - - PB_MESHLIST, _T("meshList"), TYPE_INODE_TAB, 0, P_AUTO_UI|P_VARIABLE_SIZE, IDS_MESHLIST, - p_ui, bv_mesh, TYPE_NODELISTBOX, IDC_LIST1,IDC_ADD,0,IDC_REMOVE, - end, - -#if 0 - // params - PB_RB_LAYER, _T("Layer"), TYPE_INT, 0, IDS_DS_LAYER, - p_default, NP_DEFAULT_HVK_LAYER, - end, + 1, + havok_params, IDD_RB_MOD_PANEL, IDS_PARAMS, 0, 0, NULL, - PB_RB_MATERIAL, _T("Material"), TYPE_INT, 0, IDS_DS_MATERIAL, + PB_MATERIAL, _T("material"), TYPE_INT, P_ANIMATABLE, IDS_DS_MATERIAL, p_default, NP_DEFAULT_HVK_MATERIAL, - end, - - PB_RB_MASS, _T("mass"), TYPE_FLOAT, 0, IDS_DS_MASS, - p_default, NP_DEFAULT_HVK_MASS, - p_range, 0.0, 1000.0, - p_ui, TYPE_SPINNER, EDITTYPE_UNIVERSE, IDC_ED_MASS, IDC_SP_MASS, SPIN_AUTOSCALE, - end, - - PB_RB_FRICTION, _T("friction"), TYPE_FLOAT, 0, IDS_DS_FRICTION, - p_default, NP_DEFAULT_HVK_FRICTION, - p_range, 0.0, 10.0, - p_ui, TYPE_SPINNER, EDITTYPE_UNIVERSE, IDC_ED_FRICTION, IDC_SP_FRICTION, SPIN_AUTOSCALE, - end, - - PB_RB_RESTITUTION, _T("restitution"), TYPE_FLOAT, 0, IDS_DS_RESTITUTION, - p_default, NP_DEFAULT_HVK_RESTITUTION, - p_range, 0.0, 10.0, - p_ui, TYPE_SPINNER, EDITTYPE_UNIVERSE, IDC_ED_RESTITUTION, IDC_SP_RESTITUTION, SPIN_AUTOSCALE, - end, - - PB_RB_LINEAR_DAMPING, _T("linear_damping"), TYPE_FLOAT, 0, IDS_DS_LINEAR_DAMPING, - p_default, NP_DEFAULT_HVK_LINEAR_DAMPING, - p_range, 0.0, 10.0, - p_ui, TYPE_SPINNER, EDITTYPE_UNIVERSE, IDC_ED_LINEAR_DAMPING, IDC_SP_LINEAR_DAMPING, SPIN_AUTOSCALE, - end, - - PB_RB_ANGULAR_DAMPING, _T("angular_damping"), TYPE_FLOAT, 0, IDS_DS_ANGULAR_DAMPING, - p_default, NP_DEFAULT_HVK_ANGULAR_DAMPING, - p_range, 0.0, 10.0, - p_ui, TYPE_SPINNER, EDITTYPE_UNIVERSE, IDC_ED_ANGULAR_DAMPING, IDC_SP_ANGULAR_DAMPING, SPIN_AUTOSCALE, - end, - - PB_RB_MAX_LINEAR_VELOCITY, _T("max_linear_velocity"), TYPE_FLOAT, 0, IDS_DS_MAX_LINEAR_VELOCITY, - p_default, NP_DEFAULT_HVK_MAX_LINEAR_VELOCITY, - p_range, 0.0, 10.0, - p_ui, TYPE_SPINNER, EDITTYPE_UNIVERSE, IDC_ED_MAX_LINEAR_VELOCITY, IDC_SP_MAX_LINEAR_VELOCITY, SPIN_AUTOSCALE, - end, - - PB_RB_MAX_ANGULAR_VELOCITY, _T("max_angular_velocity"), TYPE_FLOAT, 0, IDS_DS_MAX_ANGULAR_VELOCITY, - p_default, NP_DEFAULT_HVK_MAX_ANGULAR_VELOCITY, - p_range, 0.0, 10.0, - p_ui, TYPE_SPINNER, EDITTYPE_UNIVERSE, IDC_ED_MAX_ANGULAR_VELOCITY, IDC_SP_MAX_ANGULAR_VELOCITY, SPIN_AUTOSCALE, - end, - - PB_RB_PENETRATION_DEPTH, _T("penetration_depth"), TYPE_FLOAT, 0, IDS_DS_PENETRATION_DEPTH, - p_default, NP_DEFAULT_HVK_PENETRATION_DEPTH, - p_range, 0.0, 10.0, - p_ui, TYPE_SPINNER, EDITTYPE_UNIVERSE, IDC_ED_PENETRATION_DEPTH, IDC_SP_PENETRATION_DEPTH, SPIN_AUTOSCALE, - end, - - PB_RB_MOTION_SYSTEM, _T("motion_system"), TYPE_INT, 0, IDS_DS_MOTION_SYSTEM, - p_default, NP_DEFAULT_HVK_MOTION_SYSTEM, - end, - - PB_RB_QUALITY_TYPE, _T("quality_type"), TYPE_INT, 0, IDS_DS_QUALITY_TYPE, - p_default, NP_DEFAULT_HVK_QUALITY_TYPE, - end, -#endif + end, + PB_BOUND_TYPE, _T("boundType"), TYPE_INT, 0, IDS_BV_BOUNDING_TYPE, + p_default, bv_type_shapes, + p_range, 0, 5, + p_ui, havok_params, TYPE_RADIO, 6, IDC_RDO_NO_COLL, IDC_RDO_AXIS_ALIGNED_BOX, IDC_RDO_SPHERE, IDC_RDO_CAPSULE, IDC_RDO_PROXY_MESH, IDC_RDO_CONVEX, + end, - //PB_HK_NODE, _T("node"), TYPE_INODE, 0, IDS_DS_NODE, - // p_ui, TYPE_PICKNODEBUTTON, IDC_PICK_NODE, - // p_prompt, IDS_PICKNODE_PROMPT, - // //p_validator, &validator, end, end ); @@ -381,90 +201,10 @@ ParamBlockDesc2& get_havok_param_blk() { } -class PickObjectMode : - public PickModeCallback, - public PickNodeCallback { -public: - bhkRigidBodyModifier *mod; - - BOOL HitTest(IObjParam *ip,HWND hWnd,ViewExp *vpt,IPoint2 m,int flags); - BOOL Pick(IObjParam *ip,ViewExp *vpt); - void EnterMode(IObjParam *ip); - void ExitMode(IObjParam *ip); - BOOL RightClick(IObjParam *ip,ViewExp *vpt) {return TRUE;} - BOOL Filter(INode *node); - PickNodeCallback *GetFilter() {return this;} -}; - -//--- PickObjectMode ------------------------------------------------ - -BOOL PickObjectMode::Filter(INode *node) -{ - if (node) { - node->BeginDependencyTest(); - mod->NotifyDependents(FOREVER,0,REFMSG_TEST_DEPENDENCY); - if (node->EndDependencyTest()) { - return FALSE; - } - ////added code for looptest - //if (node->TestForLoop(FOREVER,(ReferenceMaker *) mod)!=REF_SUCCEED) - // return FALSE; - - for (int i = 0;i < mod->pblock->Count(PB_MESHLIST); i++) { - INode *tnode = NULL; - mod->pblock->GetValue(PB_MESHLIST,0,tnode,FOREVER,i); - if (node == tnode) - return FALSE; - } - - ObjectState os = node->EvalWorldState(0); - //added code such that lines are not selected - if ( (os.obj->IsSubClassOf(triObjectClassID) || os.obj->CanConvertToType(triObjectClassID)) - && (os.obj->SuperClassID() != SHAPE_CLASS_ID) - ) - { - return TRUE; - } - if (os.obj->SuperClassID() == HELPER_CLASS_ID && os.obj->ClassID().PartB() == BHKRIGIDBODYCLASS_DESC.PartB() ) { - return TRUE; - } - } - return FALSE; -} - -BOOL PickObjectMode::HitTest( - IObjParam *ip,HWND hWnd,ViewExp *vpt,IPoint2 m,int flags) -{ - INode *node = mod->mIP->PickNode(hWnd,m, this); //added "this" argument such that the Filter above is used - return node?TRUE:FALSE; -} - -BOOL PickObjectMode::Pick(IObjParam *ip,ViewExp *vpt) -{ - BOOL rv = FALSE; - if (INode *node = vpt->GetClosestHit()) { - theHold.Begin(); - ObjectState os = node->EvalWorldState(0); - if (os.obj->CanConvertToType(triObjectClassID)) { - mod->pblock->Append(PB_MESHLIST,1,&node,1); - rv = TRUE; - } - theHold.Accept(GetString(IDS_ADD_MESH)); - } - return rv; -} - -void PickObjectMode::EnterMode(IObjParam *ip) -{mod->iPickButton->SetCheck(TRUE);} - -void PickObjectMode::ExitMode(IObjParam *ip) -{mod->iPickButton->SetCheck(FALSE);} - -static PickObjectMode thePickMode; - class bhkRigidBodyModifierDlgProc : public ParamMap2UserDlgProc { public: bhkRigidBodyModifier *mod; + NpComboBox mCbMaterial; bhkRigidBodyModifierDlgProc(bhkRigidBodyModifier* m) {mod = m;} INT_PTR DlgProc(TimeValue t,IParamMap2 *map,HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam); void DeleteThis() {delete this;} @@ -475,35 +215,37 @@ INT_PTR bhkRigidBodyModifierDlgProc::DlgProc (TimeValue t,IParamMap2 *map,HWND h switch (msg) { case WM_INITDIALOG: - //mod->iPickButton = GetICustButton(GetDlgItem(hWnd, IDC_ADD)); - //mod->iPickButton->SetType(CBT_CHECK); - //mod->iPickButton->SetHighlightColor(GREEN_WASH); - break; + { + mCbMaterial.init(GetDlgItem(hWnd, IDC_CB_MATERIAL)); + for (const char **str = NpHvkMaterialNames; *str; ++str) + mCbMaterial.add(*str); + + int sel = NP_DEFAULT_HVK_MATERIAL; + Interval valid; + mod->pblock->GetValue( PB_MATERIAL, 0, sel, valid); + mCbMaterial.select( sel ); + + Update(t); + break; + } case WM_DESTROY: - if (mod && mod->iPickButton != NULL) { - ReleaseICustButton(mod->iPickButton); - mod->iPickButton = NULL; - } - break; + break; case WM_COMMAND: - switch (LOWORD(wParam)) - { - case IDC_ADD: - { - thePickMode.mod = mod; - GetCOREInterface()->SetPickMode(&thePickMode); - break; - } - } - break; - - default: - return FALSE; + switch (LOWORD(wParam)) + { + case IDC_CB_MATERIAL: + if (HIWORD(wParam)==CBN_SELCHANGE) { + mod->pblock->SetValue( PB_MATERIAL, 0, mCbMaterial.selection() ); + } + break; + + default: + return FALSE; + } } - - return TRUE; + return FALSE; } //--- bhkRigidBodyModifier ------------------------------------------------------- @@ -513,9 +255,7 @@ bhkRigidBodyModifier::bhkRigidBodyModifier() mIP = NULL; pblock = NULL; pmapParam = NULL; - pickObMode = NULL; validator.mod = this; - iPickButton = NULL; bhkRigidBodyModifierDesc.MakeAutoParamBlocks(this); collMat = NewDefaultStdMat(); @@ -526,12 +266,6 @@ bhkRigidBodyModifier::bhkRigidBodyModifier() bhkRigidBodyModifier::~bhkRigidBodyModifier() { havok_param_blk.SetUserDlgProc(); -#if 0 - if (NULL != pickObMode) { - delete pickObMode; - pickObMode = NULL; - } -#endif if (pmapParam) { DestroyCPParamMap2 (pmapParam); pmapParam = NULL; @@ -549,13 +283,12 @@ RefTargetHandle bhkRigidBodyModifier::Clone(RemapDir& remap) { int bhkRigidBodyModifier::NumRefs() { - return 2; + return 1; } RefTargetHandle bhkRigidBodyModifier::GetReference(int i) { if (i==0) return pblock; - if (i==1) return GetRBBlock(); return NULL; } @@ -575,12 +308,6 @@ RefResult bhkRigidBodyModifier::NotifyRefChanged( case REFMSG_CHANGE: ParamID changing_param = pblock->LastNotifyParamID(); havok_param_blk.InvalidateUI(changing_param); - if (changing_param == PB_MESHLIST) - { - if (partID == PART_TOPO) { - NotifyDependents(FOREVER,GEOM_CHANNEL,REFMSG_CHANGE); - } - } break; } return REF_SUCCEED; @@ -594,14 +321,65 @@ Interval bhkRigidBodyModifier::GetValidity (TimeValue t) { void bhkRigidBodyModifier::ModifyObject (TimeValue t, ModContext &mc, ObjectState *os, INode *inode) { -OutputDebugString("bhkRigidBodyModifier::ModifyObject\n"); + OutputDebugString("bhkRigidBodyModifier::ModifyObject\n"); + int bvType = 0; + pblock->GetValue(PB_BOUND_TYPE, 0, bvType, FOREVER, 0); + if (bvType == 0) + return; + + TriObject *tobj=NULL; + bool needsDelete(false); + if (os->obj->IsSubClassOf(triObjectClassID)) + tobj = (TriObject*)os->obj; + else { + if (os->obj->CanConvertToType (triObjectClassID)) { + tobj = (TriObject *) os->obj->ConvertToType (t, triObjectClassID); + if (tobj != os->obj) needsDelete = true; + } + } + if (!tobj) return; // If it's not an object we support, don't go any further. - Box3 box; box.Init(); - if (TriObject *tri = (TriObject *)os->obj->ConvertToType(t, Class_ID(TRIOBJ_CLASS_ID, 0))) - { - CalcAxisAlignedBox(tri->GetMesh(), box); - BuildBox(mesh, box.Max().x-box.Min().x, box.Max().y-box.Min().y, box.Max().z-box.Min().z); - } + Mesh& mesh = tobj->GetMesh(); +#if VERSION_3DSMAX >= ((5000<<16)+(15<<8)+0) // Version 5+ + proxyMesh.CopyBasics(mesh); +#else + proxyMesh = mesh; +#endif + + switch (bvType) + { + default: + case bv_type_none: + // Delete mesh. + break; + + case bv_type_box: // box + BuildColBox(proxyMesh); + break; + + case bv_type_sphere: // sphere + BuildColSphere(proxyMesh); + break; + + case bv_type_shapes: // Shapes + BuildColStrips(proxyMesh); + break; + + //case bv_type_packed: // Packed + // BuildColPackedStrips(); + // //BuildSphere(); + // break; + + case bv_type_convex: // Capsule + BuildColConvex(proxyMesh); + //BuildScubaMesh(); + break; + } + + if (needsDelete) { + os->obj = tobj; + os->obj->UnlockObject (); + } //Modifier::ModifyObject(t, mc, os, inode); } void bhkRigidBodyModifier::NotifyInputChanged(Interval changeInt, PartID partID, RefMessage message, ModContext *mc) @@ -668,14 +446,14 @@ void bhkRigidBodyModifier::BeginEditParams(IObjParam *ip, ULONG flags,Animatabl SetAFlag(A_MOD_BEING_EDITED); bhkRigidBodyModifierDesc.BeginEditParams(ip,this,flags,prev); - //havok_param_blk.SetUserDlgProc(bv_mesh, new bhkRigidBodyModifierDlgProc(this)); + havok_param_blk.SetUserDlgProc(havok_params, new bhkRigidBodyModifierDlgProc(this)); - pmapParam = pblock->GetMap(havok_params); - UpdateBVDialogs(); + //pmapParam = pblock->GetMap(havok_params); + //UpdateBVDialogs(); //pmapParam->GetIRollup()->Hide(1); //pmapParam->GetIRollup()->Hide(3); - BeginEditRBParams(ip, flags, prev); + // BeginEditRBParams(ip, flags, prev); mNodes.ZeroCount(); } @@ -700,14 +478,9 @@ void bhkRigidBodyModifier::EndEditParams (IObjParam *ip,ULONG flags,Animatable * UpdateBVDialogs(); } - if (iPickButton != NULL) { - ReleaseICustButton(iPickButton); - iPickButton = NULL; - } - // For PB2 we ask the ClassDesc2 to take care of the EndEditParams - NH bhkRigidBodyModifierDesc.EndEditParams(ip,this,flags,next); - EndEditRBParams(ip, flags, next); + //EndEditRBParams(ip, flags, next); } class CollisionWireMtl: public Material @@ -728,41 +501,109 @@ CollisionWireMtl::CollisionWireMtl():Material() int bhkRigidBodyModifier::Display(TimeValue t, INode* inode, ViewExp *vpt, int flagst, ModContext *mc) { - //OutputDebugString("bhkRigidBodyModifier::Display\n"); - if (!Modifier::IsEnabled()) - return 0; + //OutputDebugString("bhkRigidBodyModifier::Display\n"); + if (!Modifier::IsEnabled()) + return 0; + + int bvType = 0; + pblock->GetValue(PB_BOUND_TYPE, 0, bvType, FOREVER, 0); + if (bvType == 0) + return 0; Matrix3 m; GraphicsWindow *gw = vpt->getGW(); - int wrgb = inode->GetWireColor(); - inode->SetWireColor( RGB(255,0,0) ); + int wrgb = inode->GetWireColor(); + inode->SetWireColor( RGB(255,0,0) ); - Material *mtl = &swMtl; - //gw->setTransform(mat); - if (inode->Selected()) - gw->setColor( LINE_COLOR, GetSelColor()); - else if(!inode->IsFrozen()) - gw->setColor(LINE_COLOR,GetUIColor(COLOR_SPACE_WARPS)); + Material *mtl = &swMtl; + //gw->setTransform(mat); + if (inode->Selected()) + gw->setColor( LINE_COLOR, GetSelColor()); + else if(!inode->IsFrozen()) + gw->setColor(LINE_COLOR,GetUIColor(COLOR_SPACE_WARPS)); m = inode->GetObjectTM(t); gw->setTransform(m); DWORD rlim = gw->getRndLimits(); - DWORD newrlim = GW_WIREFRAME/*|GW_Z_BUFFER*/; + DWORD newrlim = GW_WIREFRAME/*|GW_Z_BUFFER*/; #if VERSION_3DSMAX >= ((5000<<16)+(15<<8)+0) // Version 5+ - newrlim |= GW_EDGES_ONLY; + newrlim |= GW_EDGES_ONLY; #endif - gw->setRndLimits(newrlim); + gw->setRndLimits(newrlim); //UpdateMesh(t); - gw->setMaterial(swMtl); - gw->setColor(LINE_COLOR, 1.0f, 0.0f, 0.0f); - gw->setColor(FILL_COLOR, 1.0f, 0.0f, 0.0f); - mesh.render( gw, mtl, NULL, COMP_ALL); + gw->setMaterial(swMtl); + gw->setColor(LINE_COLOR, 1.0f, 0.0f, 0.0f); + gw->setColor(FILL_COLOR, 1.0f, 0.0f, 0.0f); + proxyMesh.render( gw, mtl, NULL, COMP_ALL); - inode->SetWireColor(wrgb); + inode->SetWireColor(wrgb); gw->setRndLimits(rlim); return 0; -} \ No newline at end of file +} + +void bhkRigidBodyModifier::BuildEmpty(Mesh& mesh) +{ +} + +void bhkRigidBodyModifier::BuildColBox(Mesh& mesh) +{ + Box3 box; box.Init(); + CalcAxisAlignedBox(mesh, box, NULL); + BuildBox(mesh, box.Max().y-box.Min().y, box.Max().x-box.Min().x, box.Max().z-box.Min().z); + + MNMesh mn(mesh); + Matrix3 tm(true); + tm.Translate(box.Center()); + mn.Transform(tm); + mn.OutToTri(mesh); +} + +void bhkRigidBodyModifier::BuildColSphere(Mesh& mesh) +{ + Point3 center = Point3::Origin; + float radius = 0.0f; + CalcAxisAlignedSphere(mesh, center, radius); + BuildSphere(mesh, radius); + + MNMesh mn(mesh); + Matrix3 tm(true); + tm.Translate(center); + mn.Transform(tm); + mn.OutToTri(mesh); +} + +void bhkRigidBodyModifier::BuildColCapsule(Mesh& mesh) +{ + Point3 center = Point3::Origin; + float radius = 0.0f; + CalcCenteredSphere(mesh, center, radius); + BuildSphere(mesh, radius); + + MNMesh mn(mesh); + Matrix3 tm(true); + tm.Translate(center); + mn.Transform(tm); + mn.OutToTri(mesh); +} + +void bhkRigidBodyModifier::BuildColStrips(Mesh& mesh) +{ + MeshDelta tmd (mesh); + tmd.Apply(mesh); +} + +void bhkRigidBodyModifier::BuildColPackedStrips(Mesh& mesh) +{ + BuildColStrips(mesh); +} + +void bhkRigidBodyModifier::BuildColConvex(Mesh& mesh) +{ + extern void compute_convex_hull(Mesh& mesh, Mesh& outmesh); + + compute_convex_hull(mesh, mesh); +} diff --git a/NifProps/bhkSphereObj.cpp b/NifProps/bhkSphereObj.cpp index 043885a8e9df3650ab13411d4e7fe2eecf245142..7a6c48cbcb0c642b413c4d795ded2954f6104b41 100644 --- a/NifProps/bhkSphereObj.cpp +++ b/NifProps/bhkSphereObj.cpp @@ -24,14 +24,18 @@ HISTORY: #include "bhkRigidBodyInterface.h" #include "NifGui.h" #include "NifStrings.h" +#include "bhkHelperFuncs.h" #ifndef _countof #define _countof(x) (sizeof(x)/sizeof((x)[0])) #endif -const Class_ID bhkSphereObject_CLASS_ID = Class_ID(0x8d532427, BHKRIGIDBODYCLASS_DESC.PartB()); +#define MAX_SEGMENTS 200 +#define MIN_SEGMENTS 4 + +Class_ID bhkSphereObject_CLASS_ID = Class_ID(0x8d532427, BHKRIGIDBODYCLASS_DESC.PartB()); -extern void BuildSphere(Mesh&mesh, float radius, int segs=32, int smooth=1, float startAng = 0.0f); +extern void BuildSphere(Mesh&mesh, float radius, int segs, int smooth, float startAng); class bhkSphereObject : public SimpleObject2 { @@ -76,17 +80,6 @@ public: }; -// Misc stuff -#define MAX_SEGMENTS 200 -#define MIN_SEGMENTS 4 - -#define MIN_RADIUS float(0) -#define MAX_RADIUS float(1.0E30) - -#define MIN_SMOOTH 0 -#define MAX_SMOOTH 1 - - //--- ClassDescriptor and class vars --------------------------------- // The class descriptor for sphere @@ -314,115 +307,7 @@ void bhkSphereObject::BuildMesh(TimeValue t) BuildSphere(mesh, radius, segs, smooth, startAng); } -extern void BuildSphere(Mesh&mesh, float radius, int segs, int smooth, float startAng) -{ - Point3 p; - int ix,na,nb,nc,nd,jx,kx; - int nf=0,nv=0; - float delta, delta2; - float a,alt,secrad,secang,b,c; - float hemi = 0.0f; - - LimitValue(segs, MIN_SEGMENTS, MAX_SEGMENTS); - LimitValue(smooth, MIN_SMOOTH, MAX_SMOOTH); - LimitValue(radius, MIN_RADIUS, MAX_RADIUS); - - float totalPie(0.0f); - if (hemi>=1.0f) hemi = 0.9999f; - hemi = (1.0f-hemi) * PI; - float basedelta=2.0f*PI/(float)segs; - delta2 = basedelta; - delta = basedelta; - - int rows = int(hemi/delta) + 1; - int realsegs=segs; - int nverts = rows * realsegs + 2; - int nfaces = rows * realsegs * 2; - mesh.setNumVerts(nverts); - mesh.setNumFaces(nfaces); - mesh.setSmoothFlags(smooth != 0); - int lastvert=nverts-1; - - // Top vertex - mesh.setVert(nv, 0.0f, 0.0f, radius); - nv++; - - // Middle vertices - alt=delta; - for(ix=1; ix<=rows; ix++) { - a = (float)cos(alt)*radius; - secrad = (float)sin(alt)*radius; - secang = startAng; //0.0f - for(jx=0; jx<segs; ++jx) { - b = (float)cos(secang)*secrad; - c = (float)sin(secang)*secrad; - mesh.setVert(nv++,b,c,a); - secang+=delta2; - } - alt+=delta; - } - /* Bottom vertex */ - mesh.setVert(nv++, 0.0f, 0.0f,-radius); - - // Now make faces - - BitArray startSliceFaces; - BitArray endSliceFaces; - - // Make top conic cap - for(ix=1; ix<=segs; ++ix) { - nc=(ix==segs)?1:ix+1; - mesh.faces[nf].setEdgeVisFlags(1,1,1); - mesh.faces[nf].setSmGroup(smooth?1:0); - mesh.faces[nf].setMatID(1); - mesh.faces[nf].setVerts(0, ix, nc); - nf++; - } - - /* Make midsection */ - int lastrow=rows-1,lastseg=segs-1,almostlast=lastseg-1; - for(ix=1; ix<rows; ++ix) { - jx=(ix-1)*segs+1; - for(kx=0; kx<segs; ++kx) { - na = jx+kx; - nb = na+segs; - nc = (kx==lastseg)? jx+segs: nb+1; - nd = (kx==lastseg)? jx : na+1; - - mesh.faces[nf].setEdgeVisFlags(1,1,0); - mesh.faces[nf].setSmGroup(smooth?1:0); - mesh.faces[nf].setMatID(1); - mesh.faces[nf].setVerts(na,nb,nc); - nf++; - - mesh.faces[nf].setEdgeVisFlags(0,1,1); - mesh.faces[nf].setSmGroup(smooth?1:0); - mesh.faces[nf].setMatID(1); - mesh.faces[nf].setVerts(na,nc,nd); - nf++; - } - } - - // Make bottom conic cap - na = mesh.getNumVerts()-1; - int botsegs=segs; - jx = (rows-1)*segs+1;lastseg=botsegs-1; - int fstart = nf; - for(ix=0; ix<botsegs; ++ix) { - nc = ix + jx; - nb = (ix==lastseg)?jx:nc+1; - mesh.faces[nf].setEdgeVisFlags(1,1,1); - mesh.faces[nf].setSmGroup(smooth?1:0); - mesh.faces[nf].setMatID(1); - mesh.faces[nf].setVerts(na, nb, nc); - nf++; - } - - mesh.setNumTVerts(0); - mesh.setNumTVFaces(0); - mesh.InvalidateTopologyCache(); -} Object* bhkSphereObject::ConvertToType(TimeValue t, Class_ID obtype) { diff --git a/NifProps/resource.h b/NifProps/resource.h index ee8c2e56f5e3f2353a6da3c4735dd555707afdd0..b5c7132922a228ee9817300275ee07c26936a0dd 100755 --- a/NifProps/resource.h +++ b/NifProps/resource.h @@ -38,6 +38,9 @@ #define IDC_PICK_NODE 1713 #define IDC_SLIDER1 1714 #define IDC_RDO_AXIS_ALIGNED_BOX 1715 +#define IDC_RDO_STRIPS_SHAPE 1716 +#define IDC_RDO_PACKED_STRIPS 1717 +#define IDC_RDO_CONVEX 1718 #define IDC_LENGTHEDIT 3009 #define IDC_WIDTHEDIT 3010 #define IDD_PANEL 11001 @@ -80,6 +83,7 @@ #define IDD_LISTPARAM 11012 #define IDC_LBL_POS2 11013 #define IDS_DS_FRICTION 11013 +#define IDD_PROXYPARAM1 11013 #define IDS_DS_RESTITUTION 11014 #define IDS_DS_LINEAR_DAMPING 11015 #define IDS_DS_ANGULAR_DAMPING 11016 @@ -120,6 +124,10 @@ #define IDS_RB_MOD_PANEL4 11051 #define IDS_RB_LIST 11052 #define IDS_RB_LIST_CLASS 11053 +#define IDS_RB_PROXY 11054 +#define IDS_RB_PROXY_CLASS 11055 +#define IDS_CENTER_X 11056 +#define IDS_CENTER 11056 #define IDC_ED_CENTER_X 11490 #define IDC_SP_CENTER_X 11491 #define IDC_ED_CENTER_Y 11492 @@ -167,7 +175,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 105 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1716 +#define _APS_NEXT_CONTROL_VALUE 1719 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif