Panagiotis Christopoulos Charitos 15 rokov pred
rodič
commit
b9b6c1cfbf

+ 0 - 7
.project

@@ -83,11 +83,4 @@
 		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
 		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
 	</natures>
-	<linkedResources>
-		<link>
-			<name>include</name>
-			<type>2</type>
-			<location>/usr/include</location>
-		</link>
-	</linkedResources>
 </projectDescription>

+ 4 - 3
src/Main.cpp

@@ -32,9 +32,10 @@
 #include "ScriptingEngine.h"
 #include "StdinListener.h"
 #include "Messaging.h"
+#include "ModelNode.h"
 
 // map (hard coded)
-//MeshNode* floor__,* sarge,* horse,* crate;
+ModelNode* floor__,* sarge,* horse,* crate;
 //SkelModelNode* imp;
 PointLight* point_lights[10];
 SpotLight* spot_lights[2];
@@ -160,8 +161,8 @@ void init()
 	app->getScene().skybox.load(skybox_fnames);*/
 
 	// horse
-	//horse = new MeshNode();
-	//horse->init("meshes/horse/horse.mesh");
+	//horse = new ModelNode();
+	//horse->init("meshes/horse/horse.mdl");
 	//horse->init("models/head/head.mesh");
 	//horse->setLocalTransform(Transform(Vec3(-2, 0, 1), Mat3::getIdentity(), 1.0));
 

+ 1 - 1
src/Scene/SceneNode.h

@@ -38,7 +38,7 @@ class SceneNode: public Object
 		
 		SceneNode(SceneNodeType type_, SceneNode* parent = NULL);
 		virtual ~SceneNode();
-		virtual void render() = 0;
+		virtual void render() {}
 		virtual void init(const char*) = 0; ///< init using a script
 
 		/// @name Updates

+ 6 - 2
unit-tests/Resources/Material.ut.cpp

@@ -3,7 +3,6 @@
 #include "RsrcPtr.h"
 
 
-
 TEST(MaterialTests, Test)
 {
 	// Tests
@@ -24,6 +23,11 @@ TEST(MaterialTests, Test)
 	
 	{
 		RsrcPtr<Material> mtl;
-		EXPECT_THROW(mtl.loadRsrc("unit-tests/data/bool_err.mtl"));
+		EXPECT_ANY_THROW(mtl.loadRsrc("unit-tests/data/bool_err.mtl"));
+	}
+
+	{
+		RsrcPtr<Material> mtl;
+		EXPECT_NO_THROW(mtl.loadRsrc("unit-tests/data/complex.mtl"));
 	}
 }

+ 58 - 0
unit-tests/data/complex.mtl

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<material>
+	<shaderProg>
+		<customMsSProg>
+			<defines>
+				<define>DIFFUSE_MAPPING</define>
+				<define>NORMAL_MAPPING</define>
+				<define>ENVIRONMENT_MAPPING</define>
+			</defines>
+		</customMsSProg>
+	</shaderProg>
+
+	<userDefinedVars>
+		<userDefinedVar>
+			<name>diffuseMap</name>
+			<value>
+				<texture>meshes/horse/horse.diff.png</texture>
+			</value>
+		</userDefinedVar>
+	
+		<userDefinedVar>
+			<name>meshes/horse/horse.norm.png</name>
+			<value>
+				<texture>meshes/horse/horse.norm.png</texture>
+			</value>
+		</userDefinedVar>
+	
+		<userDefinedVar>
+			<name>environmentMap</name>
+			<value>
+				<texture>textures/env/env_map_3.png</texture>
+			</value>
+		</userDefinedVar>
+	
+		<userDefinedVar>
+			<name>specularCol</name>
+			<value>
+				<vec3><x>1.0</x><y>1.0</y><z>0.8</z></vec3>
+			</value>
+		</userDefinedVar>
+	
+		<userDefinedVar>
+			<name>diffuseCol</name>
+			<value>
+				<vec3><x>1.0</x><y>1.0</y><z>1.0</z></vec3>
+			</value>
+		</userDefinedVar>
+	
+		<userDefinedVar>
+			<name>shininess</name>
+			<value>
+				<float>90.0</float>
+			</value>
+		</userDefinedVar>
+	</userDefinedVars>
+</material>
+