From 179932603483cde0e34d966623cb835302a2282c Mon Sep 17 00:00:00 2001
From: Tazpn <tazpn@users.sourceforge.net>
Date: Tue, 19 Aug 2008 02:59:12 +0000
Subject: [PATCH] max: set material on bhkMoppBvTreeShape during export

---
 NifExport/Coll.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/NifExport/Coll.cpp b/NifExport/Coll.cpp
index be8807c..3a836af 100755
--- a/NifExport/Coll.cpp
+++ b/NifExport/Coll.cpp
@@ -444,10 +444,10 @@ bhkNiTriStripsShapeRef Exporter::makeTriStripsShape(Mesh& mesh, Matrix3& sm)
 	return shape;
 }
 
-static bhkMoppBvTreeShapeRef makeTreeShape(bhkPackedNiTriStripsShapeRef mesh)
+static bhkMoppBvTreeShapeRef makeTreeShape(bhkPackedNiTriStripsShapeRef mesh, Niflib::HavokMaterial mtl)
 {
 	bhkMoppBvTreeShapeRef mopp = new bhkMoppBvTreeShape();
-	mopp->SetMaterial( HAV_MAT_WOOD );
+	mopp->SetMaterial( mtl );
 	mopp->SetShape( mesh );
 
 	try
@@ -1160,7 +1160,7 @@ bhkShapeRef	Exporter::makeProxyPackedTriStripShape(INode *node, Object *obj, Mes
 		Matrix3 ident(true);
 		bhkPackedNiTriStripsShapeRef trishape = makePackedTriStripsShape(localmesh, ident);
 		if ( TheHavokCode.Initialize() )
-			shape = StaticCast<bhkShape>( makeTreeShape(trishape) );
+			shape = StaticCast<bhkShape>( makeTreeShape(trishape, (Niflib::HavokMaterial)mtl) );
 		else
 			shape = StaticCast<bhkShape>(trishape);
 	}
@@ -1423,7 +1423,7 @@ bhkShapeRef	Exporter::makeModPackedTriStripShape(INode *node, Modifier* mod, Mes
 		}
 
 		if ( TheHavokCode.Initialize() )
-			shape = StaticCast<bhkShape>( makeTreeShape(trishape) );
+			shape = StaticCast<bhkShape>( makeTreeShape(trishape, (Niflib::HavokMaterial)material) );
 		else
 			shape = StaticCast<bhkShape>(trishape);
 	}
-- 
GitLab