-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPhysics.h
58 lines (47 loc) · 1.41 KB
/
Physics.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
55
56
57
58
#pragma once
#pragma warning(disable : 4305)
#include "btBulletDynamicsCommon.h"
#include "btBulletCollisionCommon.h"
#include "BulletSoftBody/btSoftRigidDynamicsWorld.h"
#include "BulletSoftBody/btDefaultSoftBodySolver.h"
#include "BulletSoftBody/btSoftBodyHelpers.h"
#include "BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.h"
#include <iostream>
#include <vector>
using namespace std;
struct Segment {
btVector3 max, min;
btCylinderShape* cs;
btVector3 dis;
btTransform frame;
btQuaternion rot;
btRigidBody* rb;
};
class Physics {
public:
static btScalar wirem;
static bool cur_select;
static Segment* prev_segment;
static btVector3 v_prev, v_cur;
static vector<Segment*> wires;
static btBroadphaseInterface* bp;
static btDefaultCollisionConfiguration* dcc;
static btCollisionDispatcher* cd;
static btSequentialImpulseConstraintSolver* sics;
static btSoftRigidDynamicsWorld* ddw;
static btDefaultSoftBodySolver* dsbs;
static btSphereShape* ball;
static btRigidBody** ballrb;
static btCollisionShape* floor;
static btBoxShape* brick;
static btBoxShape* anchor;
//static btBoxShape* rope;
//static btRigidBody** roperb;
static btRigidBody** brickrb;
//static vector<btFixedConstraint*> cons;
static vector<btGeneric6DofConstraint*> cons;
static void init();
static void deinit();
static void makeLine();
static void move(bool, bool, bool, bool, bool, bool);
};