Introduced btActionInterface. This makes it easier to extend user-defined actions, such as vehicles and characters.

btRaycastVehicle and btKinematicCharacterController are derived from btActionInterface now.
Some cosmetic cleanup: changed sourceforce/sf.net url to bulletphysics.com.
This commit is contained in:
erwin.coumans
2009-03-03 16:18:23 +00:00
parent 459c22e7cb
commit 90f96aec27
38 changed files with 409 additions and 203 deletions

View File

@@ -87,6 +87,7 @@ void BasicDemo::initPhysics()
///collision configuration contains default setup for memory, collision setup
m_collisionConfiguration = new btDefaultCollisionConfiguration();
//m_collisionConfiguration->setConvexConvexMultipointIterations();
///use the default collision dispatcher. For parallel processing you can use a diffent dispatcher (see Extras/BulletMultiThreaded)
m_dispatcher = new btCollisionDispatcher(m_collisionConfiguration);
@@ -173,6 +174,7 @@ void BasicDemo::initPhysics()
btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform);
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,colShape,localInertia);
btRigidBody* body = new btRigidBody(rbInfo);
//body->setContactProcessingThreshold(colShape->getContactBreakingThreshold());
body->setActivationState(ISLAND_SLEEPING);
m_dynamicsWorld->addRigidBody(body);

View File

@@ -81,7 +81,7 @@ int main(int argc,char** argv)
#ifdef CHECK_MEMORY_LEAKS
ccdDemo.exitPhysics();
#else
return glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bullet.sf.net",&ccdDemo);
return glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bulletphysics.com",&ccdDemo);
#endif
//default glut doesn't return from mainloop

View File

@@ -41,7 +41,7 @@ int main(int argc,char** argv)
ccdDemo->getDynamicsWorld()->setDebugDrawer(&gDebugDrawer);
glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bullet.sf.net",ccdDemo);
glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bulletphysics.com",ccdDemo);
delete ccdDemo;
return 0;

View File

@@ -1,44 +1,44 @@
/*
Bullet Continuous Collision Detection and Physics Library
GenericJointDemo
Copyright (c) 2007 Starbreeze Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Marten Svanfeldt
*/
#ifndef GENERIGJOINTDEMO_H
#define GENERIGJOINTDEMO_H
#include "DemoApplication.h"
/*
Bullet Continuous Collision Detection and Physics Library
GenericJointDemo
Copyright (c) 2007 Starbreeze Studios
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Written by: Marten Svanfeldt
*/
#ifndef GENERIGJOINTDEMO_H
#define GENERIGJOINTDEMO_H
#include "DemoApplication.h"
#include "LinearMath/btAlignedObjectArray.h"
#include "Ragdoll.h"
class GenericJointDemo : public DemoApplication
{
btAlignedObjectArray<class RagDoll*> m_ragdolls;
public:
void initPhysics();
void spawnRagdoll(bool random = false);
virtual void clientMoveAndDisplay();
virtual void displayCallback();
virtual void keyboardCallback(unsigned char key, int x, int y);
};
#endif
#include "Ragdoll.h"
class GenericJointDemo : public DemoApplication
{
btAlignedObjectArray<class RagDoll*> m_ragdolls;
public:
void initPhysics();
void spawnRagdoll(bool random = false);
virtual void clientMoveAndDisplay();
virtual void displayCallback();
virtual void keyboardCallback(unsigned char key, int x, int y);
};
#endif

View File

@@ -1,3 +1,20 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#include <stdio.h>
#include "btHfFluid.h"
#include "btHfFluidCollisionShape.h"

View File

@@ -1,3 +1,20 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#ifndef __HFFLUID_H
#define __HFFLUID_H
@@ -14,6 +31,7 @@ class btManifoldResult;
// add buoyant convex vs. convex / concave
// add buoyant concave support (try bunny model)
///experimental buyancy fluid demo
class btHfFluid : public btCollisionObject
{
public:

View File

@@ -1,3 +1,19 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#include <stdio.h>
#include "LinearMath/btAabbUtil2.h"

View File

@@ -1,3 +1,19 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#ifndef __BT_HFFLUID_BUOYANT_CONVEX_SHAPE_H
#define __BT_HFFLUID_BUOYANT_CONVEX_SHAPE_H
@@ -7,7 +23,7 @@
#define MAX_VOXEL_DIMENSION 32
class btConvexShape;
///experimental buyancy fluid demo
class btHfFluidBuoyantConvexShape : public btCollisionShape
{
public:

View File

@@ -1,3 +1,19 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#include <stdio.h>
#include "btHfFluidBuoyantShapeCollisionAlgorithm.h"

View File

@@ -1,6 +1,6 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
@@ -11,6 +11,8 @@ subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#ifndef HF_FLUID_BUOYANT_SHAPE_COLLISION_ALGORITHM_H
@@ -31,6 +33,8 @@ class btHfFluid;
class btConvexConvexAlgorithm;
class btConvexPenetrationDepthSolver;
class btSimplexSolverInterface;
///experimental buyancy fluid demo
/// btHfFluidBuoyantShapeCollisionAlgorithm provides collision detection between btHfFluidBuoyantConvexShape and btHfFluidBuoyantConvexShape
class btHfFluidBuoyantShapeCollisionAlgorithm : public btCollisionAlgorithm
{

View File

@@ -1,2 +1,18 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#include "btHfFluidCollisionShape.h"

View File

@@ -1,3 +1,19 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#ifndef BT_HF_FLUID_COLLISION_SHAPE_H
#define BT_HF_FLUID_COLLISION_SHAPE_H

View File

@@ -1,3 +1,20 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#include <stdio.h>
#include "btHfFluidRigidCollisionAlgorithm.h"

View File

@@ -1,6 +1,6 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
@@ -11,6 +11,8 @@ subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#ifndef HF_FLUID_RIGID_COLLISION_ALGORITHM_H
@@ -27,6 +29,7 @@ subject to the following restrictions:
#include "LinearMath/btVector3.h"
class btHfFluid;
///experimental buyancy fluid demo
/// btHfFluidRigidCollisionAlgorithm provides collision detection between btHfFluid and btRigidBody
class btHfFluidRigidCollisionAlgorithm : public btCollisionAlgorithm
{

View File

@@ -1,6 +1,6 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
@@ -11,6 +11,8 @@ subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#include "btHfFluidRigidCollisionConfiguration.h"

View File

@@ -1,6 +1,6 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
@@ -11,6 +11,8 @@ subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#ifndef BT_HFFLUID_RIGID_COLLISION_CONFIGURATION
@@ -21,7 +23,7 @@ subject to the following restrictions:
class btVoronoiSimplexSolver;
class btGjkEpaPenetrationDepthSolver;
///experimental buyancy fluid demo
///btSoftBodyRigidBodyCollisionConfiguration add softbody interaction on top of btDefaultCollisionConfiguration
class btHfFluidRigidCollisionConfiguration : public btDefaultCollisionConfiguration
{

View File

@@ -1,6 +1,6 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
@@ -11,6 +11,8 @@ subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#include <stdio.h>

View File

@@ -1,16 +1,18 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
@@ -31,6 +33,7 @@ typedef btAlignedObjectArray<btHfFluid*> btHfFluidArray;
class btHfFluidBuoyantConvexShape;
///experimental buyancy fluid demo
class btHfFluidRigidDynamicsWorld : public btDiscreteDynamicsWorld
{

View File

@@ -1,6 +1,6 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
@@ -11,6 +11,8 @@ subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#include "btBulletDynamicsCommon.h"

View File

@@ -1,6 +1,6 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
@@ -11,6 +11,8 @@ subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#ifndef HFFLUID_DEMO_H
@@ -32,7 +34,7 @@ class btHfFluidRigidDynamicsWorld;
///collisions between a btSoftBody and a btRigidBody
class btFluidRididCollisionAlgorithm;
///experimental buyancy fluid demo
///CcdPhysicsDemo shows basic stacking using Bullet physics, and allows toggle of Ccd (using key '1')
class HfFluidDemo : public DemoApplication
{

View File

@@ -1,6 +1,6 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
@@ -11,6 +11,8 @@ subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#ifdef WIN32 //needed for glut.h

View File

@@ -1,6 +1,6 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
@@ -11,12 +11,16 @@ subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#ifndef HFFLUID_GL_SHAPE_DRAWER_H
#define HFFLUID_GL_SHAPE_DRAWER_H
#include "GL_ShapeDrawer.h"
///experimental buyancy fluid demo
/// OpenGL shape drawing
class HfFluidDemo_GL_ShapeDrawer : public GL_ShapeDrawer
{

View File

@@ -1,6 +1,6 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
@@ -11,6 +11,8 @@ subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Experimental Buoyancy fluid demo written by John McCutchan
*/
#include "HfFluidDemo.h"
@@ -29,7 +31,7 @@ int main(int argc,char** argv)
fluidDemo->getDynamicsWorld()->setDebugDrawer(&gDebugDrawer);
glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bullet.sf.net",fluidDemo);
glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bulletphysics.com",fluidDemo);
delete fluidDemo;
return 0;

View File

@@ -28,7 +28,7 @@ int main(int argc,char** argv)
demo->getDynamicsWorld()->setDebugDrawer(&gDebugDrawer);
glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bullet.sf.net",demo);
glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bulletphysics.com",demo);
delete demo;

View File

@@ -27,5 +27,5 @@ int main(int argc,char* argv[])
demoApp.initPhysics();
demoApp.getDynamicsWorld()->setDebugDrawer(&gDebugDrawer);
return glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bullet.sf.net",&demoApp);
return glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bulletphysics.com",&demoApp);
}

View File

@@ -29,7 +29,7 @@ int main(int argc,char** argv)
softDemo->getDynamicsWorld()->setDebugDrawer(&gDebugDrawer);
glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bullet.sf.net",softDemo);
glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bulletphysics.com",softDemo);
delete softDemo;
return 0;

View File

@@ -2761,7 +2761,7 @@ bool ColladaConverter::save(const char* filename)
}
m_dom->getAsset()->getContributor_array().get(0)->getAuthor()->setValue
("http://bullet.sf.net Erwin Coumans");
("http://bulletphysics.com Erwin Coumans");
if (!m_dom->getAsset()->getContributor_array().get(0)->getAuthoring_tool())
{

View File

@@ -17,12 +17,13 @@ subject to the following restrictions:
#define CHARACTER_CONTROLLER_INTERFACE_H
#include "LinearMath/btVector3.h"
#include "BulletDynamics/Dynamics/btActionInterface.h"
class btCollisionShape;
class btRigidBody;
class btCollisionWorld;
class btCharacterControllerInterface
class btCharacterControllerInterface : public btActionInterface
{
public:
btCharacterControllerInterface () {};

View File

@@ -116,7 +116,7 @@ btPairCachingGhostObject* btKinematicCharacterController::getGhostObject()
return m_ghostObject;
}
bool btKinematicCharacterController::recoverFromPenetration (btCollisionWorld* collisionWorld)
bool btKinematicCharacterController::recoverFromPenetration ( btCollisionWorld* collisionWorld)
{
bool penetration = false;
@@ -390,7 +390,7 @@ void btKinematicCharacterController::warp (const btVector3& origin)
}
void btKinematicCharacterController::preStep ( btCollisionWorld* collisionWorld)
void btKinematicCharacterController::preStep ( btCollisionWorld* collisionWorld)
{
int numPenetrationLoops = 0;
@@ -413,7 +413,7 @@ void btKinematicCharacterController::preStep ( btCollisionWorld* collisionWorld)
}
void btKinematicCharacterController::playerStep ( btCollisionWorld* collisionWorld, btScalar dt)
void btKinematicCharacterController::playerStep ( btCollisionWorld* collisionWorld, btScalar dt)
{
btTransform xform;
xform = m_ghostObject->getWorldTransform ();
@@ -469,3 +469,8 @@ bool btKinematicCharacterController::onGround () const
{
return true;
}
void btKinematicCharacterController::debugDraw(btIDebugDraw* debugDrawer)
{
}

View File

@@ -69,7 +69,7 @@ protected:
btVector3 parallelComponent (const btVector3& direction, const btVector3& normal);
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));
void stepForwardAndStrafe (btCollisionWorld* collisionWorld, const btVector3& walkMove);
@@ -78,6 +78,17 @@ public:
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)
@@ -95,8 +106,8 @@ public:
void reset ();
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);
void setJumpSpeed (btScalar jumpSpeed);

View File

@@ -30,7 +30,6 @@ enum btTypedConstraintType
HINGE_CONSTRAINT_TYPE,
CONETWIST_CONSTRAINT_TYPE,
D6_CONSTRAINT_TYPE,
VEHICLE_CONSTRAINT_TYPE,
SLIDER_CONSTRAINT_TYPE
};

View File

@@ -0,0 +1,39 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef _BT_ACTION_INTERFACE_H
#define _BT_ACTION_INTERFACE_H
class btIDebugDraw;
class btCollisionWorld;
#include "LinearMath/btScalar.h"
///Basic interface to allow actions such as vehicles and characters to be updated inside a btDynamicsWorld
class btActionInterface
{
public:
virtual ~btActionInterface()
{
}
virtual void updateAction( btCollisionWorld* collisionWorld, btScalar deltaTimeStep)=0;
virtual void debugDraw(btIDebugDraw* debugDrawer) = 0;
};
#endif //_BT_ACTION_INTERFACE_H

View File

@@ -90,8 +90,7 @@ void btContinuousDynamicsWorld::internalSingleStepSimulation( btScalar timeStep)
integrateTransforms(timeStep * toi);
///update vehicle simulation
updateVehicles(timeStep);
updateActions(timeStep);
updateActivationState( timeStep );

View File

@@ -51,15 +51,7 @@ subject to the following restrictions:
#include "LinearMath/btIDebugDraw.h"
//vehicle
#include "BulletDynamics/Vehicle/btRaycastVehicle.h"
#include "BulletDynamics/Vehicle/btVehicleRaycaster.h"
#include "BulletDynamics/Vehicle/btWheelInfo.h"
//character
#include "BulletDynamics/Character/btCharacterControllerInterface.h"
#include "LinearMath/btIDebugDraw.h"
#include "BulletDynamics/Dynamics/btActionInterface.h"
#include "LinearMath/btQuickprof.h"
#include "LinearMath/btMotionState.h"
@@ -212,32 +204,11 @@ void btDiscreteDynamicsWorld::debugDrawWorld()
}
for ( i=0;i<this->m_vehicles.size();i++)
if (getDebugDrawer() && getDebugDrawer()->getDebugMode())
{
for (int v=0;v<m_vehicles[i]->getNumWheels();v++)
for (i=0;i<m_actions.size();i++)
{
btVector3 wheelColor(0,255,255);
if (m_vehicles[i]->getWheelInfo(v).m_raycastInfo.m_isInContact)
{
wheelColor.setValue(0,0,255);
} else
{
wheelColor.setValue(255,0,255);
}
btVector3 wheelPosWS = m_vehicles[i]->getWheelInfo(v).m_worldTransform.getOrigin();
btVector3 axle = btVector3(
m_vehicles[i]->getWheelInfo(v).m_worldTransform.getBasis()[0][m_vehicles[i]->getRightAxis()],
m_vehicles[i]->getWheelInfo(v).m_worldTransform.getBasis()[1][m_vehicles[i]->getRightAxis()],
m_vehicles[i]->getWheelInfo(v).m_worldTransform.getBasis()[2][m_vehicles[i]->getRightAxis()]);
//m_vehicles[i]->getWheelInfo(v).m_raycastInfo.m_wheelAxleWS
//debug wheels (cylinders)
m_debugDrawer->drawLine(wheelPosWS,wheelPosWS+axle,wheelColor);
m_debugDrawer->drawLine(wheelPosWS,m_vehicles[i]->getWheelInfo(v).m_raycastInfo.m_contactPointWS,wheelColor);
m_actions[i]->debugDraw(m_debugDrawer);
}
}
}
@@ -309,7 +280,7 @@ void btDiscreteDynamicsWorld::synchronizeMotionStates()
synchronizeSingleMotionState(body);
}
}
/*
if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawWireframe)
{
for ( int i=0;i<this->m_vehicles.size();i++)
@@ -321,6 +292,8 @@ void btDiscreteDynamicsWorld::synchronizeMotionStates()
}
}
}
*/
}
@@ -426,10 +399,8 @@ void btDiscreteDynamicsWorld::internalSingleStepSimulation(btScalar timeStep)
integrateTransforms(timeStep);
///update vehicle simulation
updateVehicles(timeStep);
updateActions(timeStep);
updateCharacters(timeStep);
updateActivationState( timeStep );
if(0 != m_internalTickCallback) {
@@ -493,29 +464,15 @@ void btDiscreteDynamicsWorld::addRigidBody(btRigidBody* body, short group, short
}
void btDiscreteDynamicsWorld::updateVehicles(btScalar timeStep)
void btDiscreteDynamicsWorld::updateActions(btScalar timeStep)
{
BT_PROFILE("updateVehicles");
BT_PROFILE("updateActions");
for ( int i=0;i<m_vehicles.size();i++)
for ( int i=0;i<m_actions.size();i++)
{
btRaycastVehicle* vehicle = m_vehicles[i];
vehicle->updateVehicle( timeStep);
m_actions[i]->updateAction( this, timeStep);
}
}
void btDiscreteDynamicsWorld::updateCharacters(btScalar timeStep)
{
BT_PROFILE("updateCharacters");
for ( int i=0;i<m_characters.size();i++)
{
btCharacterControllerInterface* character = m_characters[i];
character->preStep (this);
character->playerStep (this,timeStep);
}
}
void btDiscreteDynamicsWorld::updateActivationState(btScalar timeStep)
@@ -572,24 +529,35 @@ void btDiscreteDynamicsWorld::removeConstraint(btTypedConstraint* constraint)
constraint->getRigidBodyB().removeConstraintRef(constraint);
}
void btDiscreteDynamicsWorld::addVehicle(btRaycastVehicle* vehicle)
void btDiscreteDynamicsWorld::addAction(btActionInterface* action)
{
m_vehicles.push_back(vehicle);
m_actions.push_back(action);
}
void btDiscreteDynamicsWorld::removeVehicle(btRaycastVehicle* vehicle)
void btDiscreteDynamicsWorld::removeAction(btActionInterface* action)
{
m_vehicles.remove(vehicle);
m_actions.remove(action);
}
void btDiscreteDynamicsWorld::addCharacter(btCharacterControllerInterface* character)
void btDiscreteDynamicsWorld::addVehicle(btActionInterface* vehicle)
{
m_characters.push_back(character);
addAction(vehicle);
}
void btDiscreteDynamicsWorld::removeCharacter(btCharacterControllerInterface* character)
void btDiscreteDynamicsWorld::removeVehicle(btActionInterface* vehicle)
{
m_characters.remove(character);
removeAction(vehicle);
}
void btDiscreteDynamicsWorld::addCharacter(btActionInterface* character)
{
addAction(character);
}
void btDiscreteDynamicsWorld::removeCharacter(btActionInterface* character)
{
removeAction(character);
}

View File

@@ -23,10 +23,8 @@ class btOverlappingPairCache;
class btConstraintSolver;
class btSimulationIslandManager;
class btTypedConstraint;
class btActionInterface;
class btRaycastVehicle;
class btCharacterControllerInterface;
class btIDebugDraw;
#include "LinearMath/btAlignedObjectArray.h"
@@ -52,12 +50,8 @@ protected:
bool m_ownsIslandManager;
bool m_ownsConstraintSolver;
btAlignedObjectArray<btActionInterface*> m_actions;
btAlignedObjectArray<btRaycastVehicle*> m_vehicles;
btAlignedObjectArray<btCharacterControllerInterface*> m_characters;
int m_profileTimings;
virtual void predictUnconstraintMotion(btScalar timeStep);
@@ -70,9 +64,7 @@ protected:
void updateActivationState(btScalar timeStep);
void updateVehicles(btScalar timeStep);
void updateCharacters(btScalar timeStep);
void updateActions(btScalar timeStep);
void startProfiling(btScalar timeStep);
@@ -105,15 +97,10 @@ public:
virtual void removeConstraint(btTypedConstraint* constraint);
virtual void addVehicle(btRaycastVehicle* vehicle);
virtual void addAction(btActionInterface*);
virtual void removeVehicle(btRaycastVehicle* vehicle);
virtual void removeAction(btActionInterface*);
virtual void addCharacter(btCharacterControllerInterface* character);
virtual void removeCharacter(btCharacterControllerInterface* character);
btSimulationIslandManager* getSimulationIslandManager()
{
return m_islandManager;
@@ -130,6 +117,7 @@ public:
}
virtual void setGravity(const btVector3& gravity);
virtual btVector3 getGravity () const;
virtual void addRigidBody(btRigidBody* body);
@@ -171,6 +159,15 @@ public:
(void) numTasks;
}
///obsolete, use addAction instead
virtual void addVehicle(btActionInterface* vehicle);
///obsolete, use removeAction instead
virtual void removeVehicle(btActionInterface* vehicle);
///obsolete, use addAction instead
virtual void addCharacter(btActionInterface* character);
///obsolete, use removeAction instead
virtual void removeCharacter(btActionInterface* character);
};
#endif //BT_DISCRETE_DYNAMICS_WORLD_H

View File

@@ -20,10 +20,10 @@ subject to the following restrictions:
#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h"
class btTypedConstraint;
class btRaycastVehicle;
class btActionInterface;
class btConstraintSolver;
class btDynamicsWorld;
class btCharacterControllerInterface;
/// Type for the callback for each tick
typedef void (*btInternalTickCallback)(btDynamicsWorld *world, btScalar timeStep);
@@ -72,14 +72,9 @@ public:
virtual void removeConstraint(btTypedConstraint* constraint) {(void)constraint;}
virtual void addVehicle(btRaycastVehicle* vehicle) {(void)vehicle;}
virtual void removeVehicle(btRaycastVehicle* vehicle) {(void)vehicle;}
virtual void addCharacter(btCharacterControllerInterface* character) {(void)character;}
virtual void removeCharacter(btCharacterControllerInterface* character) {(void)character;}
virtual void addAction(btActionInterface* action) = 0;
virtual void removeAction(btActionInterface* action) = 0;
//once a rigidbody is added to the dynamics world, it will get this gravity assigned
//existing rigidbodies in the world get gravity assigned too, during this method
@@ -129,6 +124,16 @@ public:
}
///obsolete, use addAction instead.
virtual void addVehicle(btActionInterface* vehicle) {(void)vehicle;}
///obsolete, use removeAction instead
virtual void removeVehicle(btActionInterface* vehicle) {(void)vehicle;}
///obsolete, use addAction instead.
virtual void addCharacter(btActionInterface* character) {(void)character;}
///obsolete, use removeAction instead
virtual void removeCharacter(btActionInterface* character) {(void)character;}
};
#endif //BT_DYNAMICS_WORLD_H

View File

@@ -19,15 +19,13 @@
#include "btVehicleRaycaster.h"
#include "btWheelInfo.h"
#include "LinearMath/btMinMax.h"
#include "LinearMath/btIDebugDraw.h"
#include "BulletDynamics/ConstraintSolver/btContactConstraint.h"
static btRigidBody s_fixedObject( 0,0,0);
btRaycastVehicle::btRaycastVehicle(const btVehicleTuning& tuning,btRigidBody* chassis, btVehicleRaycaster* raycaster )
: btTypedConstraint(VEHICLE_CONSTRAINT_TYPE),
m_vehicleRaycaster(raycaster),
:m_vehicleRaycaster(raycaster),
m_pitchControl(btScalar(0.))
{
m_chassisBody = chassis;
@@ -704,6 +702,36 @@ void btRaycastVehicle::updateFriction(btScalar timeStep)
}
void btRaycastVehicle::debugDraw(btIDebugDraw* debugDrawer)
{
for (int v=0;v<this->getNumWheels();v++)
{
btVector3 wheelColor(0,255,255);
if (getWheelInfo(v).m_raycastInfo.m_isInContact)
{
wheelColor.setValue(0,0,255);
} else
{
wheelColor.setValue(255,0,255);
}
btVector3 wheelPosWS = getWheelInfo(v).m_worldTransform.getOrigin();
btVector3 axle = btVector3(
getWheelInfo(v).m_worldTransform.getBasis()[0][getRightAxis()],
getWheelInfo(v).m_worldTransform.getBasis()[1][getRightAxis()],
getWheelInfo(v).m_worldTransform.getBasis()[2][getRightAxis()]);
//debug wheels (cylinders)
debugDrawer->drawLine(wheelPosWS,wheelPosWS+axle,wheelColor);
debugDrawer->drawLine(wheelPosWS,getWheelInfo(v).m_raycastInfo.m_contactPointWS,wheelColor);
}
}
void* btDefaultVehicleRaycaster::castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result)
{
// RayResultCallback& resultCallback;
@@ -727,3 +755,4 @@ void* btDefaultVehicleRaycaster::castRay(const btVector3& from,const btVector3&
}
return 0;
}

View File

@@ -17,11 +17,12 @@
class btDynamicsWorld;
#include "LinearMath/btAlignedObjectArray.h"
#include "btWheelInfo.h"
#include "BulletDynamics/Dynamics/btActionInterface.h"
class btVehicleTuning;
///rayCast vehicle, very special constraint that turn a rigidbody into a vehicle.
class btRaycastVehicle : public btTypedConstraint
class btRaycastVehicle : public btActionInterface
{
btAlignedObjectArray<btVector3> m_forwardWS;
@@ -73,13 +74,24 @@ public:
virtual ~btRaycastVehicle() ;
///btActionInterface interface
virtual void updateAction( btCollisionWorld* collisionWorld, btScalar step)
{
updateVehicle(step);
}
///btActionInterface interface
void debugDraw(btIDebugDraw* debugDrawer);
const btTransform& getChassisWorldTransform() const;
btScalar rayCast(btWheelInfo& wheel);
virtual void updateVehicle(btScalar step);
void resetSuspension();
btScalar getSteeringValue(int wheel) const;
@@ -175,27 +187,6 @@ public:
m_indexForwardAxis = forwardIndex;
}
virtual void buildJacobian()
{
//not yet
}
virtual void getInfo1 (btConstraintInfo1* info)
{
info->m_numConstraintRows = 0;
info->nub = 0;
}
virtual void getInfo2 (btConstraintInfo2* info)
{
btAssert(0);
}
virtual void solveConstraintObsolete(btSolverBody& bodyA,btSolverBody& bodyB,btScalar timeStep)
{
(void)timeStep;
//not yet
}
};