-
Notifications
You must be signed in to change notification settings - Fork 0
/
SimpleDynamicsWorld.h
54 lines (42 loc) · 1.33 KB
/
SimpleDynamicsWorld.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#include "btBulletDynamicsCommon.h"
#include "BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.h"
#include "BulletSoftBody/btSoftMultiBodyDynamicsWorld.h"
class btBroadphaseInterface;
class btCollisionConfiguration;
class btCollisionDispatcher;
class btMultiBodyConstraintSolver;
class btSoftMultiBodyDynamicsWorld;
struct btSoftBodyWorldInfo;
struct btOverlapFilterCallback;
class btOverlappingPairCache;
class btIDebugDraw;
struct SimpleDynamicsWorld
{
struct Settings
{
btOverlapFilterCallback * filterCallback = nullptr;
};
btCollisionConfiguration * collisionConfiguration = nullptr;
btCollisionDispatcher * collisionDispatcher = nullptr;
btOverlappingPairCache * pairCache = nullptr;
btBroadphaseInterface * broadphase = nullptr;
btMultiBodyConstraintSolver * constraintSolver = nullptr;
btSoftMultiBodyDynamicsWorld * dynamicsWorld = nullptr;
btSoftBodyWorldInfo * softBodyWorldInfo = nullptr;
btIDebugDraw * debugDrawer = nullptr;
void init();
void init(Settings & settings);
void shut();
btRigidBody * createRigidBody(
const btTransform & transform,
float mass,
btCollisionShape * shape,
const btVector4 & color = btVector4(1, 0, 0, 1));
btSoftBody * connectWithRope(
btRigidBody * body1,
btRigidBody * body2,
const int numRopeSegments,
const float stiffness);
void debugDraw();
};