1 |
mr_bones_ 14/09/01 01:00:55 |
2 |
|
3 |
Added: vdrift-20120722-bullet.patch |
4 |
Log: |
5 |
add patch from Peter Asplund to allow building against newer versions of sci-physics/bullet |
6 |
|
7 |
(Portage version: 2.2.8-r1/cvs/Linux x86_64, unsigned Manifest commit) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 games-sports/vdrift/files/vdrift-20120722-bullet.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-sports/vdrift/files/vdrift-20120722-bullet.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-sports/vdrift/files/vdrift-20120722-bullet.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: vdrift-20120722-bullet.patch |
16 |
=================================================================== |
17 |
--- src/cardynamics.cpp Mon Jan 19 23:26:36 1970 |
18 |
+++ src/cardynamics.cpp Mon Jan 19 23:26:36 1970 |
19 |
@@ -1791,23 +1791,29 @@ |
20 |
|
21 |
bool CARDYNAMICS::WheelContactCallback( |
22 |
btManifoldPoint& cp, |
23 |
- const btCollisionObject* colObj0, |
24 |
- int partId0, |
25 |
+ const btCollisionObjectWrapper* col0, |
26 |
+ int part0, |
27 |
int index0, |
28 |
- const btCollisionObject* colObj1, |
29 |
- int partId1, |
30 |
+ const btCollisionObjectWrapper* col1, |
31 |
+ int part1, |
32 |
int index1) |
33 |
{ |
34 |
- // cars are fracture bodies, wheel is a cylinder shape |
35 |
- const btCollisionShape* shape = colObj0->getCollisionShape(); |
36 |
- if ((colObj0->getInternalType() & CO_FRACTURE_TYPE) && |
37 |
+#if (BT_BULLET_VERSION < 281) |
38 |
+ const btCollisionObject* obj = col0; |
39 |
+ const btCollisionShape* shape = obj->getCollisionShape(); |
40 |
+ const btCollisionShape* rootshape = obj->getRootCollisionShape(); |
41 |
+#else |
42 |
+ const btCollisionObject* obj = col0->getCollisionObject(); |
43 |
+ const btCollisionShape* shape = col0->getCollisionShape(); |
44 |
+ const btCollisionShape* rootshape = obj->getCollisionShape(); |
45 |
+#endif |
46 |
+ if ((obj->getInternalType() & CO_FRACTURE_TYPE) && |
47 |
(shape->getShapeType() == CYLINDER_SHAPE_PROXYTYPE)) |
48 |
{ |
49 |
- // is contact within contact patch? |
50 |
- const btCompoundShape* car = static_cast<const btCompoundShape*>(colObj0->getRootCollisionShape()); |
51 |
- const btCylinderShapeX* wheel = static_cast<const btCylinderShapeX*>(shape); |
52 |
- btVector3 contactPoint = cp.m_localPointA - car->getChildTransform(cp.m_index0).getOrigin(); |
53 |
- if (-direction::up.dot(contactPoint) > 0.5 * wheel->getRadius()) |
54 |
+ const btCompoundShape* carshape = static_cast<const btCompoundShape*>(rootshape); |
55 |
+ const btCylinderShapeX* wheelshape = static_cast<const btCylinderShapeX*>(shape); |
56 |
+ btVector3 contactPoint = cp.m_localPointA - carshape->getChildTransform(cp.m_index0).getOrigin(); |
57 |
+ if (-direction::up.dot(contactPoint) > 0.5 * wheelshape->getRadius()) |
58 |
{ |
59 |
// break contact (hack) |
60 |
cp.m_normalWorldOnB = btVector3(0, 0, 0); |
61 |
--- src/cardynamics.h Mon Jan 19 23:26:36 1970 |
62 |
+++ src/cardynamics.h Mon Jan 19 23:26:36 1970 |
63 |
@@ -25,6 +25,12 @@ |
64 |
class FractureBody; |
65 |
class PTree; |
66 |
|
67 |
+#if (BT_BULLET_VERSION < 281) |
68 |
+#define btCollisionObjectWrapper btCollisionObject |
69 |
+#else |
70 |
+struct btCollisionObjectWrapper; |
71 |
+#endif |
72 |
+ |
73 |
class CARDYNAMICS : public btActionInterface |
74 |
{ |
75 |
friend class PERFORMANCE_TESTING; |
76 |
@@ -151,11 +157,11 @@ |
77 |
|
78 |
static bool WheelContactCallback( |
79 |
btManifoldPoint& cp, |
80 |
- const btCollisionObject* colObj0, |
81 |
- int partId0, |
82 |
+ const btCollisionObjectWrapper* col0, |
83 |
+ int part0, |
84 |
int index0, |
85 |
- const btCollisionObject* colObj1, |
86 |
- int partId1, |
87 |
+ const btCollisionObjectWrapper* col1, |
88 |
+ int part1, |
89 |
int index1); |
90 |
|
91 |
protected: |
92 |
--- src/dynamicsworld.cpp Mon Jan 19 23:26:36 1970 |
93 |
+++ src/dynamicsworld.cpp Mon Jan 19 23:26:36 1970 |
94 |
@@ -105,7 +105,7 @@ |
95 |
int patch_id = -1; |
96 |
const BEZIER * b = 0; |
97 |
const TRACKSURFACE * s = TRACKSURFACE::None(); |
98 |
- btCollisionObject * c = 0; |
99 |
+ const btCollisionObject * c = 0; |
100 |
|
101 |
MyRayResultCallback ray(origin, p, caster); |
102 |
rayTest(origin, p, ray); |
103 |
@@ -221,6 +221,7 @@ |
104 |
|
105 |
void DynamicsWorld::fractureCallback() |
106 |
{ |
107 |
+#if (BT_BULLET_VERSION < 281) |
108 |
m_activeConnections.resize(0); |
109 |
|
110 |
int numManifolds = getDispatcher()->getNumManifolds(); |
111 |
@@ -268,4 +269,5 @@ |
112 |
btRigidBody* child = body->updateConnection(con_id); |
113 |
if (child) addRigidBody(child); |
114 |
} |
115 |
+#endif |
116 |
} |