2
0
Panagiotis Christopoulos Charitos 15 жил өмнө
parent
commit
49a22018a4

+ 1 - 1
.cproject

@@ -20,7 +20,7 @@
 <option id="cdt.managedbuild.option.gnu.cross.prefix.124248385" name="Prefix" superClass="cdt.managedbuild.option.gnu.cross.prefix"/>
 <option id="cdt.managedbuild.option.gnu.cross.path.568633506" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
 <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.2099631" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
-<builder arguments="make -j3" buildPath="${workspace_loc:/anki/build/debug}" command="nice" id="cdt.managedbuild.toolchain.gnu.cross.base.1593777304.618553305" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder">
+<builder arguments="make -j 4" autoBuildTarget="all" buildPath="${workspace_loc:/anki/build/debug}" cleanBuildTarget="clean" command="nice" enableAutoBuild="false" enableCleanBuild="true" enabledIncrementalBuild="true" id="cdt.managedbuild.toolchain.gnu.cross.base.1593777304.618553305" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelizationNumber="1" superClass="org.eclipse.cdt.build.core.settings.default.builder">
 <outputEntries>
 <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="build/debug"/>
 </outputEntries>

+ 1 - 1
.project

@@ -27,7 +27,7 @@
 				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.buildArguments</key>
-					<value>make -j3</value>
+					<value>make -j 4</value>
 				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.buildCommand</key>

+ 2 - 2
blenderscripts/skeleton.py

@@ -123,7 +123,7 @@ def getAnkiSkeletonScript(skeleton, flipYZ):
 		m4 = bone.matrix["ARMATURESPACE"].copy()
 		
 		if flipYZ:
-			m4 = multMatrix(rotMat, m4)
+			m4 = multMatrix(m4, rotMat)
 		
 		for i_ in range(0, 4):
 			for j_ in range(0, 4):
@@ -164,4 +164,4 @@ def export(skeletonInit):
 	file.write(getAnkiSkeletonScript(skeleton, skeletonInit.flipYZ))
 	
 	print("Skeleton exported!! \"" + filename + "\"")	
-	
+	

+ 4 - 0
src/Main.cpp

@@ -164,6 +164,10 @@ void init()
 	//horse->init("models/head/head.mesh");
 	horse->setLocalTransform(Transform(Vec3(-2, 0, 1), Mat3(Euler(-M::PI/2, 0.0, 0.0)), 0.5));
 	
+	RsrcPtr<Texture> ttex;
+	ttex.loadRsrc("gfx/stone.diff.png");
+	INFO(ttex->getMaxLevel());
+
 	// sarge
 	sarge = new MeshNode();
 	sarge->init("meshes/sphere/sphere16.mesh");

+ 1 - 1
src/Math/Mat3.inl.h

@@ -112,7 +112,7 @@ inline Mat3::Mat3(const Euler& e)
 // constructor [axisang]
 inline Mat3::Mat3(const Axisang& axisang)
 {
-	DEBUG_ERR(!isZero(1.0-axisang.axis.getLength())); // Not normalized axis
+	DEBUG_ERR(!isZero(1.0 - axisang.axis.getLength())); // Not normalized axis
 
 	float c, s;
 	sinCos(axisang.ang, s, c);

+ 3 - 2
src/Resources/Skeleton.cpp

@@ -29,8 +29,9 @@ bool Skeleton::load(const char* filename)
 		Bone& bone = bones[i];
 		bone.id = i;
 
-		Mat3 m3_(Axisang(-PI/2, Vec3(1,0,0)));
-		Mat4 m4_(Vec3(0), m3_, 1.0);
+		///@todo clean
+		/*Mat3 m3_(Axisang(-PI/2, Vec3(1,0,0)));
+		Mat4 m4_(Vec3(0), m3_, 1.0);*/
 
 		// NAME
 		token = &scanner.getNextToken();

+ 12 - 0
src/Resources/Texture.cpp

@@ -257,3 +257,15 @@ uint Texture::getBindedTexId(uint unit)
 	glGetIntegerv(GL_TEXTURE_BINDING_2D, &id);
 	return id;
 }
+
+
+//======================================================================================================================
+// getMaxLevel                                                                                                         =
+//======================================================================================================================
+int Texture::getMaxLevel() const
+{
+	bind(LAST_TEX_UNIT);
+	int level;
+	glGetTexParameteriv(target, GL_TEXTURE_MAX_LEVEL, &level);
+	return level;
+}

+ 1 - 0
src/Resources/Texture.h

@@ -38,6 +38,7 @@ class Texture: public Resource
 		void setTexParameter(GLenum paramName, GLint value) const;
 		void texParameter(GLenum paramName, GLfloat value) const;
 		int getBaseLevel() const;
+		int getMaxLevel() const;
 		static uint getActiveTexUnit();
 		static uint getBindedTexId(uint unit);