Index: code/branches/questsystem5/src/bullet/BulletDynamics/Character/btCharacterControllerInterface.h
===================================================================
--- code/branches/questsystem5/src/bullet/BulletDynamics/Character/btCharacterControllerInterface.h	(revision 2777)
+++ code/branches/questsystem5/src/bullet/BulletDynamics/Character/btCharacterControllerInterface.h	(revision 2907)
@@ -18,4 +18,5 @@
 
 #include "LinearMath/btVector3.h"
+#include "BulletDynamics/Dynamics/btActionInterface.h"
 
 class btCollisionShape;
@@ -23,5 +24,5 @@
 class btCollisionWorld;
 
-class btCharacterControllerInterface
+class btCharacterControllerInterface : public btActionInterface
 {
 public:
Index: code/branches/questsystem5/src/bullet/BulletDynamics/Character/btKinematicCharacterController.cpp
===================================================================
--- code/branches/questsystem5/src/bullet/BulletDynamics/Character/btKinematicCharacterController.cpp	(revision 2777)
+++ code/branches/questsystem5/src/bullet/BulletDynamics/Character/btKinematicCharacterController.cpp	(revision 2907)
@@ -23,4 +23,6 @@
 #include "btKinematicCharacterController.h"
 
+static btVector3 upAxisDirection[3] = { btVector3(1.0f, 0.0f, 0.0f), btVector3(0.0f, 1.0f, 0.0f), btVector3(0.0f, 0.0f, 1.0f) };
+
 ///@todo Interact with dynamic objects,
 ///Ride kinematicly animated platforms properly
@@ -94,6 +96,7 @@
 }
 
-btKinematicCharacterController::btKinematicCharacterController (btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight)
-{
+btKinematicCharacterController::btKinematicCharacterController (btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight, int upAxis)
+{
+	m_upAxis = upAxis;
 	m_addedMargin = 0.02f;
 	m_walkDirection.setValue(0,0,0);
@@ -102,6 +105,5 @@
 	m_stepHeight = stepHeight;
 	m_turnAngle = btScalar(0.0);
-	m_convexShape=convexShape;
-	
+	m_convexShape=convexShape;	
 }
 
@@ -110,5 +112,4 @@
 }
 
-
 btPairCachingGhostObject* btKinematicCharacterController::getGhostObject()
 {
@@ -116,5 +117,5 @@
 }
 
-bool btKinematicCharacterController::recoverFromPenetration (btCollisionWorld* collisionWorld)
+bool btKinematicCharacterController::recoverFromPenetration ( btCollisionWorld* collisionWorld)
 {
 
@@ -173,5 +174,5 @@
 	// phase 1: up
 	btTransform start, end;
-	m_targetPosition = m_currentPosition + btVector3 (btScalar(0.0), m_stepHeight, btScalar(0.0));
+	m_targetPosition = m_currentPosition + upAxisDirection[m_upAxis] * m_stepHeight;
 
 	start.setIdentity ();
@@ -179,5 +180,5 @@
 
 	/* FIXME: Handle penetration properly */
-	start.setOrigin (m_currentPosition + btVector3(btScalar(0.0), btScalar(0.1), btScalar(0.0)));
+	start.setOrigin (m_currentPosition + upAxisDirection[m_upAxis] * btScalar(0.1f));
 	end.setOrigin (m_targetPosition);
 
@@ -344,6 +345,6 @@
 
 	// phase 3: down
-	btVector3 step_drop = btVector3(btScalar(0.0), m_currentStepOffset, btScalar(0.0));
-	btVector3 gravity_drop = btVector3(btScalar(0.0), m_stepHeight, btScalar(0.0));
+	btVector3 step_drop = upAxisDirection[m_upAxis] * m_currentStepOffset;
+	btVector3 gravity_drop = upAxisDirection[m_upAxis] * m_stepHeight; 
 	m_targetPosition -= (step_drop + gravity_drop);
 
@@ -390,5 +391,5 @@
 
 
-void btKinematicCharacterController::preStep ( btCollisionWorld* collisionWorld)
+void btKinematicCharacterController::preStep (  btCollisionWorld* collisionWorld)
 {
 	
@@ -413,5 +414,5 @@
 }
 
-void btKinematicCharacterController::playerStep ( btCollisionWorld* collisionWorld, btScalar dt)
+void btKinematicCharacterController::playerStep (  btCollisionWorld* collisionWorld, btScalar dt)
 {
 	btTransform xform;
@@ -469,2 +470,7 @@
 	return true;
 }
+
+
+void	btKinematicCharacterController::debugDraw(btIDebugDraw* debugDrawer)
+{
+}
Index: code/branches/questsystem5/src/bullet/BulletDynamics/Character/btKinematicCharacterController.h
===================================================================
--- code/branches/questsystem5/src/bullet/BulletDynamics/Character/btKinematicCharacterController.h	(revision 2777)
+++ code/branches/questsystem5/src/bullet/BulletDynamics/Character/btKinematicCharacterController.h	(revision 2907)
@@ -63,4 +63,6 @@
 
 	bool	m_useGhostObjectSweepTest;
+
+	int m_upAxis;
 	
 	btVector3 computeReflectionDirection (const btVector3& direction, const btVector3& normal);
@@ -68,5 +70,5 @@
 	btVector3 perpindicularComponent (const btVector3& direction, const btVector3& normal);
 
-	bool recoverFromPenetration (btCollisionWorld* collisionWorld);
+	bool recoverFromPenetration ( btCollisionWorld* collisionWorld);
 	void stepUp (btCollisionWorld* collisionWorld);
 	void updateTargetPositionBasedOnCollision (const btVector3& hit_normal, btScalar tangentMag = btScalar(0.0), btScalar normalMag = btScalar(1.0));
@@ -74,7 +76,27 @@
 	void stepDown (btCollisionWorld* collisionWorld, btScalar dt);
 public:
-	btKinematicCharacterController (btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight);
+	btKinematicCharacterController (btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight, int upAxis = 1);
 	~btKinematicCharacterController ();
 	
+
+	///btActionInterface interface
+	virtual void updateAction( btCollisionWorld* collisionWorld,btScalar deltaTime)
+	{
+		preStep ( collisionWorld);
+		playerStep (collisionWorld, deltaTime);
+	}
+	
+	///btActionInterface interface
+	void	debugDraw(btIDebugDraw* debugDrawer);
+
+	void setUpAxis (int axis)
+	{
+		if (axis < 0)
+			axis = 0;
+		if (axis > 2)
+			axis = 2;
+		m_upAxis = axis;
+	}
+
 	virtual void	setWalkDirection(const btVector3& walkDirection)
 	{
@@ -85,6 +107,6 @@
 	void warp (const btVector3& origin);
 
-	void preStep ( btCollisionWorld* collisionWorld);
-	void playerStep (btCollisionWorld* collisionWorld, btScalar dt);
+	void preStep (  btCollisionWorld* collisionWorld);
+	void playerStep ( btCollisionWorld* collisionWorld, btScalar dt);
 
 	void setFallSpeed (btScalar fallSpeed);
