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:
@@ -87,6 +87,7 @@ void BasicDemo::initPhysics()
|
|||||||
|
|
||||||
///collision configuration contains default setup for memory, collision setup
|
///collision configuration contains default setup for memory, collision setup
|
||||||
m_collisionConfiguration = new btDefaultCollisionConfiguration();
|
m_collisionConfiguration = new btDefaultCollisionConfiguration();
|
||||||
|
//m_collisionConfiguration->setConvexConvexMultipointIterations();
|
||||||
|
|
||||||
///use the default collision dispatcher. For parallel processing you can use a diffent dispatcher (see Extras/BulletMultiThreaded)
|
///use the default collision dispatcher. For parallel processing you can use a diffent dispatcher (see Extras/BulletMultiThreaded)
|
||||||
m_dispatcher = new btCollisionDispatcher(m_collisionConfiguration);
|
m_dispatcher = new btCollisionDispatcher(m_collisionConfiguration);
|
||||||
@@ -173,6 +174,7 @@ void BasicDemo::initPhysics()
|
|||||||
btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform);
|
btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform);
|
||||||
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,colShape,localInertia);
|
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,colShape,localInertia);
|
||||||
btRigidBody* body = new btRigidBody(rbInfo);
|
btRigidBody* body = new btRigidBody(rbInfo);
|
||||||
|
//body->setContactProcessingThreshold(colShape->getContactBreakingThreshold());
|
||||||
body->setActivationState(ISLAND_SLEEPING);
|
body->setActivationState(ISLAND_SLEEPING);
|
||||||
|
|
||||||
m_dynamicsWorld->addRigidBody(body);
|
m_dynamicsWorld->addRigidBody(body);
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ int main(int argc,char** argv)
|
|||||||
#ifdef CHECK_MEMORY_LEAKS
|
#ifdef CHECK_MEMORY_LEAKS
|
||||||
ccdDemo.exitPhysics();
|
ccdDemo.exitPhysics();
|
||||||
#else
|
#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
|
#endif
|
||||||
|
|
||||||
//default glut doesn't return from mainloop
|
//default glut doesn't return from mainloop
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ int main(int argc,char** argv)
|
|||||||
ccdDemo->getDynamicsWorld()->setDebugDrawer(&gDebugDrawer);
|
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;
|
delete ccdDemo;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -1,44 +1,44 @@
|
|||||||
/*
|
/*
|
||||||
Bullet Continuous Collision Detection and Physics Library
|
Bullet Continuous Collision Detection and Physics Library
|
||||||
GenericJointDemo
|
GenericJointDemo
|
||||||
Copyright (c) 2007 Starbreeze Studios
|
Copyright (c) 2007 Starbreeze Studios
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied warranty.
|
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.
|
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,
|
Permission is granted to anyone to use this software for any purpose,
|
||||||
including commercial applications, and to alter it and redistribute it freely,
|
including commercial applications, and to alter it and redistribute it freely,
|
||||||
subject to the following restrictions:
|
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.
|
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.
|
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.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
|
||||||
Written by: Marten Svanfeldt
|
Written by: Marten Svanfeldt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef GENERIGJOINTDEMO_H
|
#ifndef GENERIGJOINTDEMO_H
|
||||||
#define GENERIGJOINTDEMO_H
|
#define GENERIGJOINTDEMO_H
|
||||||
|
|
||||||
#include "DemoApplication.h"
|
#include "DemoApplication.h"
|
||||||
#include "LinearMath/btAlignedObjectArray.h"
|
#include "LinearMath/btAlignedObjectArray.h"
|
||||||
#include "Ragdoll.h"
|
#include "Ragdoll.h"
|
||||||
|
|
||||||
class GenericJointDemo : public DemoApplication
|
class GenericJointDemo : public DemoApplication
|
||||||
{
|
{
|
||||||
|
|
||||||
btAlignedObjectArray<class RagDoll*> m_ragdolls;
|
btAlignedObjectArray<class RagDoll*> m_ragdolls;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void initPhysics();
|
void initPhysics();
|
||||||
|
|
||||||
void spawnRagdoll(bool random = false);
|
void spawnRagdoll(bool random = false);
|
||||||
|
|
||||||
virtual void clientMoveAndDisplay();
|
virtual void clientMoveAndDisplay();
|
||||||
|
|
||||||
virtual void displayCallback();
|
virtual void displayCallback();
|
||||||
|
|
||||||
virtual void keyboardCallback(unsigned char key, int x, int y);
|
virtual void keyboardCallback(unsigned char key, int x, int y);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -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 <stdio.h>
|
||||||
#include "btHfFluid.h"
|
#include "btHfFluid.h"
|
||||||
#include "btHfFluidCollisionShape.h"
|
#include "btHfFluidCollisionShape.h"
|
||||||
|
|||||||
@@ -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
|
#ifndef __HFFLUID_H
|
||||||
#define __HFFLUID_H
|
#define __HFFLUID_H
|
||||||
|
|
||||||
@@ -14,6 +31,7 @@ class btManifoldResult;
|
|||||||
// add buoyant convex vs. convex / concave
|
// add buoyant convex vs. convex / concave
|
||||||
// add buoyant concave support (try bunny model)
|
// add buoyant concave support (try bunny model)
|
||||||
|
|
||||||
|
///experimental buyancy fluid demo
|
||||||
class btHfFluid : public btCollisionObject
|
class btHfFluid : public btCollisionObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -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 <stdio.h>
|
||||||
|
|
||||||
#include "LinearMath/btAabbUtil2.h"
|
#include "LinearMath/btAabbUtil2.h"
|
||||||
|
|||||||
@@ -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
|
#ifndef __BT_HFFLUID_BUOYANT_CONVEX_SHAPE_H
|
||||||
#define __BT_HFFLUID_BUOYANT_CONVEX_SHAPE_H
|
#define __BT_HFFLUID_BUOYANT_CONVEX_SHAPE_H
|
||||||
|
|
||||||
@@ -7,7 +23,7 @@
|
|||||||
#define MAX_VOXEL_DIMENSION 32
|
#define MAX_VOXEL_DIMENSION 32
|
||||||
|
|
||||||
class btConvexShape;
|
class btConvexShape;
|
||||||
|
///experimental buyancy fluid demo
|
||||||
class btHfFluidBuoyantConvexShape : public btCollisionShape
|
class btHfFluidBuoyantConvexShape : public btCollisionShape
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -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 <stdio.h>
|
||||||
|
|
||||||
#include "btHfFluidBuoyantShapeCollisionAlgorithm.h"
|
#include "btHfFluidBuoyantShapeCollisionAlgorithm.h"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Bullet Continuous Collision Detection and Physics Library
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
#ifndef HF_FLUID_BUOYANT_SHAPE_COLLISION_ALGORITHM_H
|
||||||
@@ -31,6 +33,8 @@ class btHfFluid;
|
|||||||
class btConvexConvexAlgorithm;
|
class btConvexConvexAlgorithm;
|
||||||
class btConvexPenetrationDepthSolver;
|
class btConvexPenetrationDepthSolver;
|
||||||
class btSimplexSolverInterface;
|
class btSimplexSolverInterface;
|
||||||
|
|
||||||
|
///experimental buyancy fluid demo
|
||||||
/// btHfFluidBuoyantShapeCollisionAlgorithm provides collision detection between btHfFluidBuoyantConvexShape and btHfFluidBuoyantConvexShape
|
/// btHfFluidBuoyantShapeCollisionAlgorithm provides collision detection between btHfFluidBuoyantConvexShape and btHfFluidBuoyantConvexShape
|
||||||
class btHfFluidBuoyantShapeCollisionAlgorithm : public btCollisionAlgorithm
|
class btHfFluidBuoyantShapeCollisionAlgorithm : public btCollisionAlgorithm
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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"
|
#include "btHfFluidCollisionShape.h"
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
#ifndef BT_HF_FLUID_COLLISION_SHAPE_H
|
||||||
#define BT_HF_FLUID_COLLISION_SHAPE_H
|
#define BT_HF_FLUID_COLLISION_SHAPE_H
|
||||||
|
|
||||||
|
|||||||
@@ -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 <stdio.h>
|
||||||
|
|
||||||
#include "btHfFluidRigidCollisionAlgorithm.h"
|
#include "btHfFluidRigidCollisionAlgorithm.h"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Bullet Continuous Collision Detection and Physics Library
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
#ifndef HF_FLUID_RIGID_COLLISION_ALGORITHM_H
|
||||||
@@ -27,6 +29,7 @@ subject to the following restrictions:
|
|||||||
#include "LinearMath/btVector3.h"
|
#include "LinearMath/btVector3.h"
|
||||||
class btHfFluid;
|
class btHfFluid;
|
||||||
|
|
||||||
|
///experimental buyancy fluid demo
|
||||||
/// btHfFluidRigidCollisionAlgorithm provides collision detection between btHfFluid and btRigidBody
|
/// btHfFluidRigidCollisionAlgorithm provides collision detection between btHfFluid and btRigidBody
|
||||||
class btHfFluidRigidCollisionAlgorithm : public btCollisionAlgorithm
|
class btHfFluidRigidCollisionAlgorithm : public btCollisionAlgorithm
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Bullet Continuous Collision Detection and Physics Library
|
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.
|
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.
|
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.
|
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.
|
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.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
|
||||||
|
Experimental Buoyancy fluid demo written by John McCutchan
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "btHfFluidRigidCollisionConfiguration.h"
|
#include "btHfFluidRigidCollisionConfiguration.h"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Bullet Continuous Collision Detection and Physics Library
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
#ifndef BT_HFFLUID_RIGID_COLLISION_CONFIGURATION
|
||||||
@@ -21,7 +23,7 @@ subject to the following restrictions:
|
|||||||
class btVoronoiSimplexSolver;
|
class btVoronoiSimplexSolver;
|
||||||
class btGjkEpaPenetrationDepthSolver;
|
class btGjkEpaPenetrationDepthSolver;
|
||||||
|
|
||||||
|
///experimental buyancy fluid demo
|
||||||
///btSoftBodyRigidBodyCollisionConfiguration add softbody interaction on top of btDefaultCollisionConfiguration
|
///btSoftBodyRigidBodyCollisionConfiguration add softbody interaction on top of btDefaultCollisionConfiguration
|
||||||
class btHfFluidRigidCollisionConfiguration : public btDefaultCollisionConfiguration
|
class btHfFluidRigidCollisionConfiguration : public btDefaultCollisionConfiguration
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Bullet Continuous Collision Detection and Physics Library
|
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.
|
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.
|
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.
|
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.
|
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.
|
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 <stdio.h>
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
/*
|
/*
|
||||||
Bullet Continuous Collision Detection and Physics Library
|
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.
|
||||||
|
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.
|
Experimental Buoyancy fluid demo written by John McCutchan
|
||||||
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.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
|
#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
|
||||||
@@ -31,6 +33,7 @@ typedef btAlignedObjectArray<btHfFluid*> btHfFluidArray;
|
|||||||
|
|
||||||
class btHfFluidBuoyantConvexShape;
|
class btHfFluidBuoyantConvexShape;
|
||||||
|
|
||||||
|
///experimental buyancy fluid demo
|
||||||
class btHfFluidRigidDynamicsWorld : public btDiscreteDynamicsWorld
|
class btHfFluidRigidDynamicsWorld : public btDiscreteDynamicsWorld
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Bullet Continuous Collision Detection and Physics Library
|
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.
|
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.
|
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.
|
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.
|
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.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
|
||||||
|
Experimental Buoyancy fluid demo written by John McCutchan
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "btBulletDynamicsCommon.h"
|
#include "btBulletDynamicsCommon.h"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Bullet Continuous Collision Detection and Physics Library
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
#ifndef HFFLUID_DEMO_H
|
||||||
@@ -32,7 +34,7 @@ class btHfFluidRigidDynamicsWorld;
|
|||||||
///collisions between a btSoftBody and a btRigidBody
|
///collisions between a btSoftBody and a btRigidBody
|
||||||
class btFluidRididCollisionAlgorithm;
|
class btFluidRididCollisionAlgorithm;
|
||||||
|
|
||||||
|
///experimental buyancy fluid demo
|
||||||
///CcdPhysicsDemo shows basic stacking using Bullet physics, and allows toggle of Ccd (using key '1')
|
///CcdPhysicsDemo shows basic stacking using Bullet physics, and allows toggle of Ccd (using key '1')
|
||||||
class HfFluidDemo : public DemoApplication
|
class HfFluidDemo : public DemoApplication
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Bullet Continuous Collision Detection and Physics Library
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
#ifdef WIN32 //needed for glut.h
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Bullet Continuous Collision Detection and Physics Library
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
#ifndef HFFLUID_GL_SHAPE_DRAWER_H
|
||||||
#define HFFLUID_GL_SHAPE_DRAWER_H
|
#define HFFLUID_GL_SHAPE_DRAWER_H
|
||||||
|
|
||||||
#include "GL_ShapeDrawer.h"
|
#include "GL_ShapeDrawer.h"
|
||||||
|
|
||||||
|
///experimental buyancy fluid demo
|
||||||
/// OpenGL shape drawing
|
/// OpenGL shape drawing
|
||||||
class HfFluidDemo_GL_ShapeDrawer : public GL_ShapeDrawer
|
class HfFluidDemo_GL_ShapeDrawer : public GL_ShapeDrawer
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Bullet Continuous Collision Detection and Physics Library
|
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.
|
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.
|
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.
|
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.
|
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.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
|
||||||
|
Experimental Buoyancy fluid demo written by John McCutchan
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "HfFluidDemo.h"
|
#include "HfFluidDemo.h"
|
||||||
@@ -29,7 +31,7 @@ int main(int argc,char** argv)
|
|||||||
fluidDemo->getDynamicsWorld()->setDebugDrawer(&gDebugDrawer);
|
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;
|
delete fluidDemo;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ int main(int argc,char** argv)
|
|||||||
demo->getDynamicsWorld()->setDebugDrawer(&gDebugDrawer);
|
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;
|
delete demo;
|
||||||
|
|
||||||
|
|||||||
@@ -27,5 +27,5 @@ int main(int argc,char* argv[])
|
|||||||
demoApp.initPhysics();
|
demoApp.initPhysics();
|
||||||
demoApp.getDynamicsWorld()->setDebugDrawer(&gDebugDrawer);
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ int main(int argc,char** argv)
|
|||||||
softDemo->getDynamicsWorld()->setDebugDrawer(&gDebugDrawer);
|
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;
|
delete softDemo;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -2761,7 +2761,7 @@ bool ColladaConverter::save(const char* filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_dom->getAsset()->getContributor_array().get(0)->getAuthor()->setValue
|
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())
|
if (!m_dom->getAsset()->getContributor_array().get(0)->getAuthoring_tool())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,12 +17,13 @@ subject to the following restrictions:
|
|||||||
#define CHARACTER_CONTROLLER_INTERFACE_H
|
#define CHARACTER_CONTROLLER_INTERFACE_H
|
||||||
|
|
||||||
#include "LinearMath/btVector3.h"
|
#include "LinearMath/btVector3.h"
|
||||||
|
#include "BulletDynamics/Dynamics/btActionInterface.h"
|
||||||
|
|
||||||
class btCollisionShape;
|
class btCollisionShape;
|
||||||
class btRigidBody;
|
class btRigidBody;
|
||||||
class btCollisionWorld;
|
class btCollisionWorld;
|
||||||
|
|
||||||
class btCharacterControllerInterface
|
class btCharacterControllerInterface : public btActionInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
btCharacterControllerInterface () {};
|
btCharacterControllerInterface () {};
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ btPairCachingGhostObject* btKinematicCharacterController::getGhostObject()
|
|||||||
return m_ghostObject;
|
return m_ghostObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool btKinematicCharacterController::recoverFromPenetration (btCollisionWorld* collisionWorld)
|
bool btKinematicCharacterController::recoverFromPenetration ( btCollisionWorld* collisionWorld)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool penetration = false;
|
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;
|
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;
|
btTransform xform;
|
||||||
xform = m_ghostObject->getWorldTransform ();
|
xform = m_ghostObject->getWorldTransform ();
|
||||||
@@ -469,3 +469,8 @@ bool btKinematicCharacterController::onGround () const
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void btKinematicCharacterController::debugDraw(btIDebugDraw* debugDrawer)
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -69,7 +69,7 @@ protected:
|
|||||||
btVector3 parallelComponent (const btVector3& direction, const btVector3& normal);
|
btVector3 parallelComponent (const btVector3& direction, const btVector3& normal);
|
||||||
btVector3 perpindicularComponent (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 stepUp (btCollisionWorld* collisionWorld);
|
||||||
void updateTargetPositionBasedOnCollision (const btVector3& hit_normal, btScalar tangentMag = btScalar(0.0), btScalar normalMag = btScalar(1.0));
|
void updateTargetPositionBasedOnCollision (const btVector3& hit_normal, btScalar tangentMag = btScalar(0.0), btScalar normalMag = btScalar(1.0));
|
||||||
void stepForwardAndStrafe (btCollisionWorld* collisionWorld, const btVector3& walkMove);
|
void stepForwardAndStrafe (btCollisionWorld* collisionWorld, const btVector3& walkMove);
|
||||||
@@ -78,6 +78,17 @@ public:
|
|||||||
btKinematicCharacterController (btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight, int upAxis = 1);
|
btKinematicCharacterController (btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight, int upAxis = 1);
|
||||||
~btKinematicCharacterController ();
|
~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)
|
void setUpAxis (int axis)
|
||||||
{
|
{
|
||||||
if (axis < 0)
|
if (axis < 0)
|
||||||
@@ -95,8 +106,8 @@ public:
|
|||||||
void reset ();
|
void reset ();
|
||||||
void warp (const btVector3& origin);
|
void warp (const btVector3& origin);
|
||||||
|
|
||||||
void preStep ( btCollisionWorld* collisionWorld);
|
void preStep ( btCollisionWorld* collisionWorld);
|
||||||
void playerStep (btCollisionWorld* collisionWorld, btScalar dt);
|
void playerStep ( btCollisionWorld* collisionWorld, btScalar dt);
|
||||||
|
|
||||||
void setFallSpeed (btScalar fallSpeed);
|
void setFallSpeed (btScalar fallSpeed);
|
||||||
void setJumpSpeed (btScalar jumpSpeed);
|
void setJumpSpeed (btScalar jumpSpeed);
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ enum btTypedConstraintType
|
|||||||
HINGE_CONSTRAINT_TYPE,
|
HINGE_CONSTRAINT_TYPE,
|
||||||
CONETWIST_CONSTRAINT_TYPE,
|
CONETWIST_CONSTRAINT_TYPE,
|
||||||
D6_CONSTRAINT_TYPE,
|
D6_CONSTRAINT_TYPE,
|
||||||
VEHICLE_CONSTRAINT_TYPE,
|
|
||||||
SLIDER_CONSTRAINT_TYPE
|
SLIDER_CONSTRAINT_TYPE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
39
src/BulletDynamics/Dynamics/btActionInterface.h
Normal file
39
src/BulletDynamics/Dynamics/btActionInterface.h
Normal 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
|
||||||
@@ -90,8 +90,7 @@ void btContinuousDynamicsWorld::internalSingleStepSimulation( btScalar timeStep)
|
|||||||
integrateTransforms(timeStep * toi);
|
integrateTransforms(timeStep * toi);
|
||||||
|
|
||||||
///update vehicle simulation
|
///update vehicle simulation
|
||||||
updateVehicles(timeStep);
|
updateActions(timeStep);
|
||||||
|
|
||||||
|
|
||||||
updateActivationState( timeStep );
|
updateActivationState( timeStep );
|
||||||
|
|
||||||
|
|||||||
@@ -51,15 +51,7 @@ subject to the following restrictions:
|
|||||||
#include "LinearMath/btIDebugDraw.h"
|
#include "LinearMath/btIDebugDraw.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include "BulletDynamics/Dynamics/btActionInterface.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 "LinearMath/btQuickprof.h"
|
#include "LinearMath/btQuickprof.h"
|
||||||
#include "LinearMath/btMotionState.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);
|
m_actions[i]->debugDraw(m_debugDrawer);
|
||||||
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);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -309,7 +280,7 @@ void btDiscreteDynamicsWorld::synchronizeMotionStates()
|
|||||||
synchronizeSingleMotionState(body);
|
synchronizeSingleMotionState(body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawWireframe)
|
if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawWireframe)
|
||||||
{
|
{
|
||||||
for ( int i=0;i<this->m_vehicles.size();i++)
|
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);
|
integrateTransforms(timeStep);
|
||||||
|
|
||||||
///update vehicle simulation
|
///update vehicle simulation
|
||||||
updateVehicles(timeStep);
|
updateActions(timeStep);
|
||||||
|
|
||||||
updateCharacters(timeStep);
|
|
||||||
|
|
||||||
updateActivationState( timeStep );
|
updateActivationState( timeStep );
|
||||||
|
|
||||||
if(0 != m_internalTickCallback) {
|
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];
|
m_actions[i]->updateAction( this, timeStep);
|
||||||
vehicle->updateVehicle( 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)
|
void btDiscreteDynamicsWorld::updateActivationState(btScalar timeStep)
|
||||||
@@ -572,24 +529,35 @@ void btDiscreteDynamicsWorld::removeConstraint(btTypedConstraint* constraint)
|
|||||||
constraint->getRigidBodyB().removeConstraintRef(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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,10 +23,8 @@ class btOverlappingPairCache;
|
|||||||
class btConstraintSolver;
|
class btConstraintSolver;
|
||||||
class btSimulationIslandManager;
|
class btSimulationIslandManager;
|
||||||
class btTypedConstraint;
|
class btTypedConstraint;
|
||||||
|
class btActionInterface;
|
||||||
|
|
||||||
|
|
||||||
class btRaycastVehicle;
|
|
||||||
class btCharacterControllerInterface;
|
|
||||||
class btIDebugDraw;
|
class btIDebugDraw;
|
||||||
#include "LinearMath/btAlignedObjectArray.h"
|
#include "LinearMath/btAlignedObjectArray.h"
|
||||||
|
|
||||||
@@ -52,12 +50,8 @@ protected:
|
|||||||
bool m_ownsIslandManager;
|
bool m_ownsIslandManager;
|
||||||
bool m_ownsConstraintSolver;
|
bool m_ownsConstraintSolver;
|
||||||
|
|
||||||
|
btAlignedObjectArray<btActionInterface*> m_actions;
|
||||||
|
|
||||||
btAlignedObjectArray<btRaycastVehicle*> m_vehicles;
|
|
||||||
|
|
||||||
btAlignedObjectArray<btCharacterControllerInterface*> m_characters;
|
|
||||||
|
|
||||||
|
|
||||||
int m_profileTimings;
|
int m_profileTimings;
|
||||||
|
|
||||||
virtual void predictUnconstraintMotion(btScalar timeStep);
|
virtual void predictUnconstraintMotion(btScalar timeStep);
|
||||||
@@ -70,9 +64,7 @@ protected:
|
|||||||
|
|
||||||
void updateActivationState(btScalar timeStep);
|
void updateActivationState(btScalar timeStep);
|
||||||
|
|
||||||
void updateVehicles(btScalar timeStep);
|
void updateActions(btScalar timeStep);
|
||||||
|
|
||||||
void updateCharacters(btScalar timeStep);
|
|
||||||
|
|
||||||
void startProfiling(btScalar timeStep);
|
void startProfiling(btScalar timeStep);
|
||||||
|
|
||||||
@@ -105,15 +97,10 @@ public:
|
|||||||
|
|
||||||
virtual void removeConstraint(btTypedConstraint* constraint);
|
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()
|
btSimulationIslandManager* getSimulationIslandManager()
|
||||||
{
|
{
|
||||||
return m_islandManager;
|
return m_islandManager;
|
||||||
@@ -130,6 +117,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void setGravity(const btVector3& gravity);
|
virtual void setGravity(const btVector3& gravity);
|
||||||
|
|
||||||
virtual btVector3 getGravity () const;
|
virtual btVector3 getGravity () const;
|
||||||
|
|
||||||
virtual void addRigidBody(btRigidBody* body);
|
virtual void addRigidBody(btRigidBody* body);
|
||||||
@@ -171,6 +159,15 @@ public:
|
|||||||
(void) numTasks;
|
(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
|
#endif //BT_DISCRETE_DYNAMICS_WORLD_H
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ subject to the following restrictions:
|
|||||||
#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h"
|
#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h"
|
||||||
|
|
||||||
class btTypedConstraint;
|
class btTypedConstraint;
|
||||||
class btRaycastVehicle;
|
class btActionInterface;
|
||||||
class btConstraintSolver;
|
class btConstraintSolver;
|
||||||
class btDynamicsWorld;
|
class btDynamicsWorld;
|
||||||
class btCharacterControllerInterface;
|
|
||||||
|
|
||||||
/// Type for the callback for each tick
|
/// Type for the callback for each tick
|
||||||
typedef void (*btInternalTickCallback)(btDynamicsWorld *world, btScalar timeStep);
|
typedef void (*btInternalTickCallback)(btDynamicsWorld *world, btScalar timeStep);
|
||||||
@@ -72,14 +72,9 @@ public:
|
|||||||
|
|
||||||
virtual void removeConstraint(btTypedConstraint* constraint) {(void)constraint;}
|
virtual void removeConstraint(btTypedConstraint* constraint) {(void)constraint;}
|
||||||
|
|
||||||
virtual void addVehicle(btRaycastVehicle* vehicle) {(void)vehicle;}
|
virtual void addAction(btActionInterface* action) = 0;
|
||||||
|
|
||||||
virtual void removeVehicle(btRaycastVehicle* vehicle) {(void)vehicle;}
|
|
||||||
|
|
||||||
virtual void addCharacter(btCharacterControllerInterface* character) {(void)character;}
|
|
||||||
|
|
||||||
virtual void removeCharacter(btCharacterControllerInterface* character) {(void)character;}
|
|
||||||
|
|
||||||
|
virtual void removeAction(btActionInterface* action) = 0;
|
||||||
|
|
||||||
//once a rigidbody is added to the dynamics world, it will get this gravity assigned
|
//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
|
//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
|
#endif //BT_DYNAMICS_WORLD_H
|
||||||
|
|||||||
@@ -19,15 +19,13 @@
|
|||||||
#include "btVehicleRaycaster.h"
|
#include "btVehicleRaycaster.h"
|
||||||
#include "btWheelInfo.h"
|
#include "btWheelInfo.h"
|
||||||
#include "LinearMath/btMinMax.h"
|
#include "LinearMath/btMinMax.h"
|
||||||
|
#include "LinearMath/btIDebugDraw.h"
|
||||||
|
|
||||||
#include "BulletDynamics/ConstraintSolver/btContactConstraint.h"
|
#include "BulletDynamics/ConstraintSolver/btContactConstraint.h"
|
||||||
|
|
||||||
static btRigidBody s_fixedObject( 0,0,0);
|
static btRigidBody s_fixedObject( 0,0,0);
|
||||||
|
|
||||||
btRaycastVehicle::btRaycastVehicle(const btVehicleTuning& tuning,btRigidBody* chassis, btVehicleRaycaster* raycaster )
|
btRaycastVehicle::btRaycastVehicle(const btVehicleTuning& tuning,btRigidBody* chassis, btVehicleRaycaster* raycaster )
|
||||||
: btTypedConstraint(VEHICLE_CONSTRAINT_TYPE),
|
:m_vehicleRaycaster(raycaster),
|
||||||
m_vehicleRaycaster(raycaster),
|
|
||||||
m_pitchControl(btScalar(0.))
|
m_pitchControl(btScalar(0.))
|
||||||
{
|
{
|
||||||
m_chassisBody = chassis;
|
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)
|
void* btDefaultVehicleRaycaster::castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result)
|
||||||
{
|
{
|
||||||
// RayResultCallback& resultCallback;
|
// RayResultCallback& resultCallback;
|
||||||
@@ -727,3 +755,4 @@ void* btDefaultVehicleRaycaster::castRay(const btVector3& from,const btVector3&
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,11 +17,12 @@
|
|||||||
class btDynamicsWorld;
|
class btDynamicsWorld;
|
||||||
#include "LinearMath/btAlignedObjectArray.h"
|
#include "LinearMath/btAlignedObjectArray.h"
|
||||||
#include "btWheelInfo.h"
|
#include "btWheelInfo.h"
|
||||||
|
#include "BulletDynamics/Dynamics/btActionInterface.h"
|
||||||
|
|
||||||
class btVehicleTuning;
|
class btVehicleTuning;
|
||||||
|
|
||||||
///rayCast vehicle, very special constraint that turn a rigidbody into a vehicle.
|
///rayCast vehicle, very special constraint that turn a rigidbody into a vehicle.
|
||||||
class btRaycastVehicle : public btTypedConstraint
|
class btRaycastVehicle : public btActionInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
btAlignedObjectArray<btVector3> m_forwardWS;
|
btAlignedObjectArray<btVector3> m_forwardWS;
|
||||||
@@ -73,13 +74,24 @@ public:
|
|||||||
|
|
||||||
virtual ~btRaycastVehicle() ;
|
virtual ~btRaycastVehicle() ;
|
||||||
|
|
||||||
|
|
||||||
|
///btActionInterface interface
|
||||||
|
virtual void updateAction( btCollisionWorld* collisionWorld, btScalar step)
|
||||||
|
{
|
||||||
|
updateVehicle(step);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///btActionInterface interface
|
||||||
|
void debugDraw(btIDebugDraw* debugDrawer);
|
||||||
|
|
||||||
const btTransform& getChassisWorldTransform() const;
|
const btTransform& getChassisWorldTransform() const;
|
||||||
|
|
||||||
btScalar rayCast(btWheelInfo& wheel);
|
btScalar rayCast(btWheelInfo& wheel);
|
||||||
|
|
||||||
virtual void updateVehicle(btScalar step);
|
virtual void updateVehicle(btScalar step);
|
||||||
|
|
||||||
|
|
||||||
void resetSuspension();
|
void resetSuspension();
|
||||||
|
|
||||||
btScalar getSteeringValue(int wheel) const;
|
btScalar getSteeringValue(int wheel) const;
|
||||||
@@ -175,27 +187,6 @@ public:
|
|||||||
m_indexForwardAxis = forwardIndex;
|
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
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user