Bladeren bron

*Working on physics

Panagiotis Christopoulos Charitos 15 jaren geleden
bovenliggende
commit
68f75d4554

File diff suppressed because it is too large
+ 378 - 302
build/debug/Makefile


+ 1 - 1
docs/Doxyfile

@@ -139,7 +139,7 @@ STRIP_FROM_INC_PATH    =
 # (but less readable) file names. This can be useful is your file systems 
 # doesn't support long names like on DOS, Mac, or CD-ROM.
 
-SHORT_NAMES            = NO
+SHORT_NAMES            = YES
 
 # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
 # will interpret the first line (until the first dot) of a JavaDoc-style 

+ 4 - 4
src/Main.cpp

@@ -165,7 +165,6 @@ void initPhysics()
 	//dynamicsWorld->setDebugDrawer(&debugDrawer);
 }
 
-#include "ShaderPrePreprocessor.h"
 
 
 //=====================================================================================================================================
@@ -332,7 +331,7 @@ int main( int /*argc*/, char* /*argv*/[] )
 		app->scene->updateAllControllers();
 		app->scene->updateAllWorldStuff();
 
-		partEmitter->update();
+		//partEmitter->update();
 
 		app->scene->getPhyWorld()->getDynamicsWorld()->stepSimulation( app->timerTick );
 		app->scene->getPhyWorld()->getDynamicsWorld()->debugDrawWorld();
@@ -354,9 +353,10 @@ int main( int /*argc*/, char* /*argv*/[] )
 		if( I::keys[SDLK_F11] ) app->togleFullScreen();
 		if( I::keys[SDLK_F12] == 1 ) R::takeScreenshot("gfx/screenshot.jpg");
 
-		char str[128];
+
+		/*char str[128];
 		sprintf( str, "capt/%06d.jpg", R::framesNum );
-		R::takeScreenshot(str);
+		R::takeScreenshot(str);*/
 
 		// std stuff follow
 		SDL_GL_SwapBuffers();

+ 3 - 1
src/Physics/PhyCharacter.h

@@ -13,7 +13,7 @@ class PhyCharacter
 	public:
 		btPairCachingGhostObject* ghostObject;
 		btCapsuleShape* capsule;
-		btKinematicCharacterController* charachter;
+		btKinematicCharacterController* character;
 
 		PhyCharacter( PhyWorld* world, float charHeight, float charWidth, float stepHeight, float maxJumpHeight )
 		{
@@ -25,6 +25,8 @@ class PhyCharacter
 			character = new btKinematicCharacterController( ghostObject, capsule, stepHeight );
 			character->setMaxJumpHeight( maxJumpHeight );
 		}
+
+
 };
 
 #endif

+ 2 - 0
src/Physics/PhyCommon.h

@@ -4,6 +4,8 @@
 #include <btBulletCollisionCommon.h>
 #include <btBulletDynamicsCommon.h>
 #include <BulletDynamics/Character/btKinematicCharacterController.h>
+#include <BulletCollision/CollisionDispatch/btGhostObject.h>
+
 #include "Common.h"
 #include "Math.h"
 #include "PhyConversions.h"

+ 1 - 2
src/Physics/PhyWorld.h

@@ -11,13 +11,12 @@ class PhyWorld
 {
 	PROPERTY_R( btDiscreteDynamicsWorld*, dynamicsWorld, getDynamicsWorld )
 
-	private:
+	public:
 		btDefaultCollisionConfiguration* collisionConfiguration;
 		btCollisionDispatcher* dispatcher;
 		btDbvtBroadphase* broadphase;
 		btSequentialImpulseConstraintSolver* sol;
 
-	public:
 		/**
 		 * Collision groups
 		 */

+ 1 - 1
src/Renderer/BufferObjects/BufferObject.h

@@ -68,7 +68,7 @@ class BufferObject
 		 */
 		bool create( GLenum target_, uint sizeInBytes, const void* dataPtr, GLenum usage_ )
 		{
-			DEBUG_ERR( !isCreated() ); // BO already initialized
+			DEBUG_ERR( isCreated() ); // BO already initialized
 			DEBUG_ERR( usage_!=GL_STREAM_DRAW && usage_!=GL_STATIC_DRAW && usage_!=GL_DYNAMIC_DRAW ); // unacceptable usage_
 			DEBUG_ERR( sizeInBytes < 1 ); // unacceptable sizeInBytes
 

+ 1 - 1
src/Scene/ParticleEmitter.cpp

@@ -59,8 +59,8 @@ void ParticleEmitter::init( const char* filename )
 		btRigidBody::btRigidBodyConstructionInfo rbInfo( mass, mState, colShape, localInertia );
 		btRigidBody* body = new btRigidBody( rbInfo );
 		particles[i]->body = body;
-		body->setActivationState( DISABLE_SIMULATION );
 		app->scene->getPhyWorld()->getDynamicsWorld()->addRigidBody( body, PhyWorld::CG_PARTICLE, PhyWorld::CG_MAP );
+		body->forceActivationState( DISABLE_SIMULATION );
 	}
 }
 

Some files were not shown because too many files changed in this diff