diff options
author | dan miller | 2007-10-19 05:22:23 +0000 |
---|---|---|
committer | dan miller | 2007-10-19 05:22:23 +0000 |
commit | 1ec410ecd725f5a3ccb2d2fc16f48730d9d9fe43 (patch) | |
tree | 51bcae7a1b8381a6bf6fd8025a7de1e30fe0045d /libraries/ode-0.9/contrib/BreakableJoints/diff | |
parent | one more for the gipper (diff) | |
download | opensim-SC-1ec410ecd725f5a3ccb2d2fc16f48730d9d9fe43.zip opensim-SC-1ec410ecd725f5a3ccb2d2fc16f48730d9d9fe43.tar.gz opensim-SC-1ec410ecd725f5a3ccb2d2fc16f48730d9d9fe43.tar.bz2 opensim-SC-1ec410ecd725f5a3ccb2d2fc16f48730d9d9fe43.tar.xz |
trying to fix my screwup, please hold on
Diffstat (limited to 'libraries/ode-0.9/contrib/BreakableJoints/diff')
8 files changed, 0 insertions, 517 deletions
diff --git a/libraries/ode-0.9/contrib/BreakableJoints/diff/common.h.diff b/libraries/ode-0.9/contrib/BreakableJoints/diff/common.h.diff deleted file mode 100644 index 24415a1..0000000 --- a/libraries/ode-0.9/contrib/BreakableJoints/diff/common.h.diff +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | 208,227d207 | ||
2 | < /******************** breakable joint contribution ***********************/ | ||
3 | < /* joint break callback function */ | ||
4 | < typedef void dJointBreakCallback (dJointID joint); | ||
5 | < | ||
6 | < /* joint break modes */ | ||
7 | < enum { | ||
8 | < // if this flag is set, the joint wil break | ||
9 | < dJOINT_BROKEN = 0x0001, | ||
10 | < // if this flag is set, the joint wil be deleted when it breaks | ||
11 | < dJOINT_DELETE_ON_BREAK = 0x0002, | ||
12 | < // if this flag is set, the joint can break at a certain force on body 1 | ||
13 | < dJOINT_BREAK_AT_B1_FORCE = 0x0004, | ||
14 | < // if this flag is set, the joint can break at a certain torque on body 1 | ||
15 | < dJOINT_BREAK_AT_B1_TORQUE = 0x0008, | ||
16 | < // if this flag is set, the joint can break at a certain force on body 2 | ||
17 | < dJOINT_BREAK_AT_B2_FORCE = 0x0010, | ||
18 | < // if this flag is set, the joint can break at a certain torque on body 2 | ||
19 | < dJOINT_BREAK_AT_B2_TORQUE = 0x0020 | ||
20 | < }; | ||
21 | < /*************************************************************************/ | ||
diff --git a/libraries/ode-0.9/contrib/BreakableJoints/diff/joint.cpp.diff b/libraries/ode-0.9/contrib/BreakableJoints/diff/joint.cpp.diff deleted file mode 100644 index 80397f0..0000000 --- a/libraries/ode-0.9/contrib/BreakableJoints/diff/joint.cpp.diff +++ /dev/null | |||
@@ -1,148 +0,0 @@ | |||
1 | 2659,2804d2658 | ||
2 | < | ||
3 | < /******************** breakable joint contribution ***********************/ | ||
4 | < extern "C" void dJointSetBreakable (dxJoint *joint, int b) { | ||
5 | < dAASSERT(joint); | ||
6 | < if (b) { | ||
7 | < // we want this joint to be breakable but we must first check if it | ||
8 | < // was already breakable | ||
9 | < if (!joint->breakInfo) { | ||
10 | < // allocate a dxJointBreakInfo struct | ||
11 | < joint->breakInfo = new dxJointBreakInfo; | ||
12 | < joint->breakInfo->flags = 0; | ||
13 | < for (int i = 0; i < 3; i++) { | ||
14 | < joint->breakInfo->b1MaxF[0] = 0; | ||
15 | < joint->breakInfo->b1MaxT[0] = 0; | ||
16 | < joint->breakInfo->b2MaxF[0] = 0; | ||
17 | < joint->breakInfo->b2MaxT[0] = 0; | ||
18 | < } | ||
19 | < joint->breakInfo->callback = 0; | ||
20 | < } | ||
21 | < else { | ||
22 | < // the joint was already breakable | ||
23 | < return; | ||
24 | < } | ||
25 | < } | ||
26 | < else { | ||
27 | < // we want this joint to be unbreakable mut we must first check if | ||
28 | < // it is alreay unbreakable | ||
29 | < if (joint->breakInfo) { | ||
30 | < // deallocate the dxJointBreakInfo struct | ||
31 | < delete joint->breakInfo; | ||
32 | < joint->breakInfo = 0; | ||
33 | < } | ||
34 | < else { | ||
35 | < // the joint was already unbreakable | ||
36 | < return; | ||
37 | < } | ||
38 | < } | ||
39 | < } | ||
40 | < | ||
41 | < extern "C" void dJointSetBreakCallback (dxJoint *joint, dJointBreakCallback *callbackFunc) { | ||
42 | < dAASSERT(joint); | ||
43 | < # ifndef dNODEBUG | ||
44 | < // only works for a breakable joint | ||
45 | < if (!joint->breakInfo) { | ||
46 | < dDebug (0, "dJointSetBreakCallback called on unbreakable joint"); | ||
47 | < } | ||
48 | < # endif | ||
49 | < joint->breakInfo->callback = callbackFunc; | ||
50 | < } | ||
51 | < | ||
52 | < extern "C" void dJointSetBreakMode (dxJoint *joint, int mode) { | ||
53 | < dAASSERT(joint); | ||
54 | < # ifndef dNODEBUG | ||
55 | < // only works for a breakable joint | ||
56 | < if (!joint->breakInfo) { | ||
57 | < dDebug (0, "dJointSetBreakMode called on unbreakable joint"); | ||
58 | < } | ||
59 | < # endif | ||
60 | < joint->breakInfo->flags = mode; | ||
61 | < } | ||
62 | < | ||
63 | < extern "C" int dJointGetBreakMode (dxJoint *joint) { | ||
64 | < dAASSERT(joint); | ||
65 | < # ifndef dNODEBUG | ||
66 | < // only works for a breakable joint | ||
67 | < if (!joint->breakInfo) { | ||
68 | < dDebug (0, "dJointGetBreakMode called on unbreakable joint"); | ||
69 | < } | ||
70 | < # endif | ||
71 | < return joint->breakInfo->flags; | ||
72 | < } | ||
73 | < | ||
74 | < extern "C" void dJointSetBreakForce (dxJoint *joint, int body, dReal x, dReal y, dReal z) { | ||
75 | < dAASSERT(joint); | ||
76 | < # ifndef dNODEBUG | ||
77 | < // only works for a breakable joint | ||
78 | < if (!joint->breakInfo) { | ||
79 | < dDebug (0, "dJointSetBreakForce called on unbreakable joint"); | ||
80 | < } | ||
81 | < # endif | ||
82 | < if (body) { | ||
83 | < joint->breakInfo->b2MaxF[0] = x; | ||
84 | < joint->breakInfo->b2MaxF[1] = y; | ||
85 | < joint->breakInfo->b2MaxF[2] = z; | ||
86 | < } | ||
87 | < else { | ||
88 | < joint->breakInfo->b1MaxF[0] = x; | ||
89 | < joint->breakInfo->b1MaxF[1] = y; | ||
90 | < joint->breakInfo->b1MaxF[2] = z; | ||
91 | < } | ||
92 | < } | ||
93 | < | ||
94 | < extern "C" void dJointSetBreakTorque (dxJoint *joint, int body, dReal x, dReal y, dReal z) { | ||
95 | < dAASSERT(joint); | ||
96 | < # ifndef dNODEBUG | ||
97 | < // only works for a breakable joint | ||
98 | < if (!joint->breakInfo) { | ||
99 | < dDebug (0, "dJointSetBreakTorque called on unbreakable joint"); | ||
100 | < } | ||
101 | < # endif | ||
102 | < if (body) { | ||
103 | < joint->breakInfo->b2MaxT[0] = x; | ||
104 | < joint->breakInfo->b2MaxT[1] = y; | ||
105 | < joint->breakInfo->b2MaxT[2] = z; | ||
106 | < } | ||
107 | < else { | ||
108 | < joint->breakInfo->b1MaxT[0] = x; | ||
109 | < joint->breakInfo->b1MaxT[1] = y; | ||
110 | < joint->breakInfo->b1MaxT[2] = z; | ||
111 | < } | ||
112 | < } | ||
113 | < | ||
114 | < extern "C" int dJointIsBreakable (dxJoint *joint) { | ||
115 | < dAASSERT(joint); | ||
116 | < return joint->breakInfo != 0; | ||
117 | < } | ||
118 | < | ||
119 | < extern "C" void dJointGetBreakForce (dxJoint *joint, int body, dReal *force) { | ||
120 | < dAASSERT(joint); | ||
121 | < # ifndef dNODEBUG | ||
122 | < // only works for a breakable joint | ||
123 | < if (!joint->breakInfo) { | ||
124 | < dDebug (0, "dJointGetBreakForce called on unbreakable joint"); | ||
125 | < } | ||
126 | < # endif | ||
127 | < if (body) | ||
128 | < for (int i=0; i<3; i++) force[i]=joint->breakInfo->b2MaxF[i]; | ||
129 | < else | ||
130 | < for (int i=0; i<3; i++) force[i]=joint->breakInfo->b1MaxF[i]; | ||
131 | < } | ||
132 | < | ||
133 | < extern "C" void dJointGetBreakTorque (dxJoint *joint, int body, dReal *torque) { | ||
134 | < dAASSERT(joint); | ||
135 | < # ifndef dNODEBUG | ||
136 | < // only works for a breakable joint | ||
137 | < if (!joint->breakInfo) { | ||
138 | < dDebug (0, "dJointGetBreakTorque called on unbreakable joint"); | ||
139 | < } | ||
140 | < # endif | ||
141 | < if (body) | ||
142 | < for (int i=0; i<3; i++) torque[i]=joint->breakInfo->b2MaxT[i]; | ||
143 | < else | ||
144 | < for (int i=0; i<3; i++) torque[i]=joint->breakInfo->b1MaxT[i]; | ||
145 | < } | ||
146 | < /*************************************************************************/ | ||
147 | < | ||
148 | \ No newline at end of file | ||
diff --git a/libraries/ode-0.9/contrib/BreakableJoints/diff/joint.h.diff b/libraries/ode-0.9/contrib/BreakableJoints/diff/joint.h.diff deleted file mode 100644 index eed3c24..0000000 --- a/libraries/ode-0.9/contrib/BreakableJoints/diff/joint.h.diff +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | 61,70d60 | ||
2 | < /******************** breakable joint contribution ***********************/ | ||
3 | < struct dxJointBreakInfo : public dBase { | ||
4 | < int flags; | ||
5 | < dReal b1MaxF[3]; // maximum force on body 1 | ||
6 | < dReal b1MaxT[3]; // maximum torque on body 1 | ||
7 | < dReal b2MaxF[3]; // maximum force on body 2 | ||
8 | < dReal b2MaxT[3]; // maximum torque on body 2 | ||
9 | < dJointBreakCallback *callback; // function that is called when this joint breaks | ||
10 | < }; | ||
11 | < /*************************************************************************/ | ||
12 | 135,140d124 | ||
13 | < | ||
14 | < /******************** breakable joint contribution ***********************/ | ||
15 | < // optional break info structure. if this is not NULL the the joint is | ||
16 | < // breakable. | ||
17 | < dxJointBreakInfo *breakInfo; | ||
18 | < /*************************************************************************/ | ||
diff --git a/libraries/ode-0.9/contrib/BreakableJoints/diff/objects.h.diff b/libraries/ode-0.9/contrib/BreakableJoints/diff/objects.h.diff deleted file mode 100644 index fd2129e..0000000 --- a/libraries/ode-0.9/contrib/BreakableJoints/diff/objects.h.diff +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | 168,179d167 | ||
2 | < /******************** breakable joint contribution ***********************/ | ||
3 | < void dJointSetBreakable (dJointID, int b); | ||
4 | < void dJointSetBreakCallback (dJointID, dJointBreakCallback *callbackFunc); | ||
5 | < void dJointSetBreakMode (dJointID, int mode); | ||
6 | < int dJointGetBreakMode (dJointID); | ||
7 | < void dJointSetBreakForce (dJointID, int body, dReal x, dReal y, dReal z); | ||
8 | < void dJointSetBreakTorque (dJointID, int body, dReal x, dReal y, dReal z); | ||
9 | < int dJointIsBreakable (dJointID); | ||
10 | < void dJointGetBreakForce (dJointID, int body, dReal *force); | ||
11 | < void dJointGetBreakTorque (dJointID, int body, dReal *torque); | ||
12 | < /*************************************************************************/ | ||
13 | < | ||
diff --git a/libraries/ode-0.9/contrib/BreakableJoints/diff/ode.cpp.diff b/libraries/ode-0.9/contrib/BreakableJoints/diff/ode.cpp.diff deleted file mode 100644 index 761b7be..0000000 --- a/libraries/ode-0.9/contrib/BreakableJoints/diff/ode.cpp.diff +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | 212,230d211 | ||
2 | < /******************** breakable joint contribution ***********************/ | ||
3 | < dxJoint* nextJ; | ||
4 | < if (!world->firstjoint) | ||
5 | < nextJ = 0; | ||
6 | < else | ||
7 | < nextJ = (dxJoint*)world->firstjoint->next; | ||
8 | < for (j=world->firstjoint; j; j=nextJ) { | ||
9 | < nextJ = (dxJoint*)j->next; | ||
10 | < // check if joint is breakable and broken | ||
11 | < if (j->breakInfo && j->breakInfo->flags & dJOINT_BROKEN) { | ||
12 | < // detach (break) the joint | ||
13 | < dJointAttach (j, 0, 0); | ||
14 | < // call the callback function if it is set | ||
15 | < if (j->breakInfo->callback) j->breakInfo->callback (j); | ||
16 | < // finally destroy the joint if the dJOINT_DELETE_ON_BREAK is set | ||
17 | < if (j->breakInfo->flags & dJOINT_DELETE_ON_BREAK) dJointDestroy (j); | ||
18 | < } | ||
19 | < } | ||
20 | < /*************************************************************************/ | ||
21 | 931,933d911 | ||
22 | < /******************** breakable joint contribution ***********************/ | ||
23 | < j->breakInfo = 0; | ||
24 | < /*************************************************************************/ | ||
25 | 1011,1013d988 | ||
26 | < /******************** breakable joint contribution ***********************/ | ||
27 | < if (j->breakInfo) delete j->breakInfo; | ||
28 | < /*************************************************************************/ | ||
diff --git a/libraries/ode-0.9/contrib/BreakableJoints/diff/step.cpp.diff b/libraries/ode-0.9/contrib/BreakableJoints/diff/step.cpp.diff deleted file mode 100644 index dfc8c2f..0000000 --- a/libraries/ode-0.9/contrib/BreakableJoints/diff/step.cpp.diff +++ /dev/null | |||
@@ -1,130 +0,0 @@ | |||
1 | 966,1066c966,989 | ||
2 | < /******************** breakable joint contribution ***********************/ | ||
3 | < // this saves us a few dereferences | ||
4 | < dxJointBreakInfo *jBI = joint[i]->breakInfo; | ||
5 | < // we need joint feedback if the joint is breakable or if the user | ||
6 | < // requested feedback. | ||
7 | < if (jBI||fb) { | ||
8 | < // we need feedback on the amount of force that this joint is | ||
9 | < // applying to the bodies. we use a slightly slower computation | ||
10 | < // that splits out the force components and puts them in the | ||
11 | < // feedback structure. | ||
12 | < dJointFeedback temp_fb; // temporary storage for joint feedback | ||
13 | < dReal data1[8],data2[8]; | ||
14 | < Multiply1_8q1 (data1, JJ, lambda+ofs[i], info[i].m); | ||
15 | < dReal *cf1 = cforce + 8*b1->tag; | ||
16 | < cf1[0] += (temp_fb.f1[0] = data1[0]); | ||
17 | < cf1[1] += (temp_fb.f1[1] = data1[1]); | ||
18 | < cf1[2] += (temp_fb.f1[2] = data1[2]); | ||
19 | < cf1[4] += (temp_fb.t1[0] = data1[4]); | ||
20 | < cf1[5] += (temp_fb.t1[1] = data1[5]); | ||
21 | < cf1[6] += (temp_fb.t1[2] = data1[6]); | ||
22 | < if (b2) { | ||
23 | < Multiply1_8q1 (data2, JJ + 8*info[i].m, lambda+ofs[i], info[i].m); | ||
24 | < dReal *cf2 = cforce + 8*b2->tag; | ||
25 | < cf2[0] += (temp_fb.f2[0] = data2[0]); | ||
26 | < cf2[1] += (temp_fb.f2[1] = data2[1]); | ||
27 | < cf2[2] += (temp_fb.f2[2] = data2[2]); | ||
28 | < cf2[4] += (temp_fb.t2[0] = data2[4]); | ||
29 | < cf2[5] += (temp_fb.t2[1] = data2[5]); | ||
30 | < cf2[6] += (temp_fb.t2[2] = data2[6]); | ||
31 | < } | ||
32 | < // if the user requested so we must copy the feedback information to | ||
33 | < // the feedback struct that the user suplied. | ||
34 | < if (fb) { | ||
35 | < // copy temp_fb to fb | ||
36 | < fb->f1[0] = temp_fb.f1[0]; | ||
37 | < fb->f1[1] = temp_fb.f1[1]; | ||
38 | < fb->f1[2] = temp_fb.f1[2]; | ||
39 | < fb->t1[0] = temp_fb.t1[0]; | ||
40 | < fb->t1[1] = temp_fb.t1[1]; | ||
41 | < fb->t1[2] = temp_fb.t1[2]; | ||
42 | < if (b2) { | ||
43 | < fb->f2[0] = temp_fb.f2[0]; | ||
44 | < fb->f2[1] = temp_fb.f2[1]; | ||
45 | < fb->f2[2] = temp_fb.f2[2]; | ||
46 | < fb->t2[0] = temp_fb.t2[0]; | ||
47 | < fb->t2[1] = temp_fb.t2[1]; | ||
48 | < fb->t2[2] = temp_fb.t2[2]; | ||
49 | < } | ||
50 | < } | ||
51 | < // if the joint is breakable we need to check the breaking conditions | ||
52 | < if (jBI) { | ||
53 | < dReal relCF1[3]; | ||
54 | < dReal relCT1[3]; | ||
55 | < // multiply the force and torque vectors by the rotation matrix of body 1 | ||
56 | < dMULTIPLY1_331 (&relCF1[0],b1->R,&temp_fb.f1[0]); | ||
57 | < dMULTIPLY1_331 (&relCT1[0],b1->R,&temp_fb.t1[0]); | ||
58 | < if (jBI->flags & dJOINT_BREAK_AT_B1_FORCE) { | ||
59 | < // check if the force is to high | ||
60 | < for (int i = 0; i < 3; i++) { | ||
61 | < if (relCF1[i] > jBI->b1MaxF[i]) { | ||
62 | < jBI->flags |= dJOINT_BROKEN; | ||
63 | < goto doneCheckingBreaks; | ||
64 | < } | ||
65 | < } | ||
66 | < } | ||
67 | < if (jBI->flags & dJOINT_BREAK_AT_B1_TORQUE) { | ||
68 | < // check if the torque is to high | ||
69 | < for (int i = 0; i < 3; i++) { | ||
70 | < if (relCT1[i] > jBI->b1MaxT[i]) { | ||
71 | < jBI->flags |= dJOINT_BROKEN; | ||
72 | < goto doneCheckingBreaks; | ||
73 | < } | ||
74 | < } | ||
75 | < } | ||
76 | < if (b2) { | ||
77 | < dReal relCF2[3]; | ||
78 | < dReal relCT2[3]; | ||
79 | < // multiply the force and torque vectors by the rotation matrix of body 2 | ||
80 | < dMULTIPLY1_331 (&relCF2[0],b2->R,&temp_fb.f2[0]); | ||
81 | < dMULTIPLY1_331 (&relCT2[0],b2->R,&temp_fb.t2[0]); | ||
82 | < if (jBI->flags & dJOINT_BREAK_AT_B2_FORCE) { | ||
83 | < // check if the force is to high | ||
84 | < for (int i = 0; i < 3; i++) { | ||
85 | < if (relCF2[i] > jBI->b2MaxF[i]) { | ||
86 | < jBI->flags |= dJOINT_BROKEN; | ||
87 | < goto doneCheckingBreaks; | ||
88 | < } | ||
89 | < } | ||
90 | < } | ||
91 | < if (jBI->flags & dJOINT_BREAK_AT_B2_TORQUE) { | ||
92 | < // check if the torque is to high | ||
93 | < for (int i = 0; i < 3; i++) { | ||
94 | < if (relCT2[i] > jBI->b2MaxT[i]) { | ||
95 | < jBI->flags |= dJOINT_BROKEN; | ||
96 | < goto doneCheckingBreaks; | ||
97 | < } | ||
98 | < } | ||
99 | < } | ||
100 | < } | ||
101 | < doneCheckingBreaks: | ||
102 | < ; | ||
103 | --- | ||
104 | > if (fb) { | ||
105 | > // the user has requested feedback on the amount of force that this | ||
106 | > // joint is applying to the bodies. we use a slightly slower | ||
107 | > // computation that splits out the force components and puts them | ||
108 | > // in the feedback structure. | ||
109 | > dReal data1[8],data2[8]; | ||
110 | > Multiply1_8q1 (data1, JJ, lambda+ofs[i], info[i].m); | ||
111 | > dReal *cf1 = cforce + 8*b1->tag; | ||
112 | > cf1[0] += (fb->f1[0] = data1[0]); | ||
113 | > cf1[1] += (fb->f1[1] = data1[1]); | ||
114 | > cf1[2] += (fb->f1[2] = data1[2]); | ||
115 | > cf1[4] += (fb->t1[0] = data1[4]); | ||
116 | > cf1[5] += (fb->t1[1] = data1[5]); | ||
117 | > cf1[6] += (fb->t1[2] = data1[6]); | ||
118 | > if (b2){ | ||
119 | > Multiply1_8q1 (data2, JJ + 8*info[i].m, lambda+ofs[i], info[i].m); | ||
120 | > dReal *cf2 = cforce + 8*b2->tag; | ||
121 | > cf2[0] += (fb->f2[0] = data2[0]); | ||
122 | > cf2[1] += (fb->f2[1] = data2[1]); | ||
123 | > cf2[2] += (fb->f2[2] = data2[2]); | ||
124 | > cf2[4] += (fb->t2[0] = data2[4]); | ||
125 | > cf2[5] += (fb->t2[1] = data2[5]); | ||
126 | > cf2[6] += (fb->t2[2] = data2[6]); | ||
127 | > } | ||
128 | 1068,1069d990 | ||
129 | < } | ||
130 | < /*************************************************************************/ | ||
diff --git a/libraries/ode-0.9/contrib/BreakableJoints/diff/stepfast.cpp.diff b/libraries/ode-0.9/contrib/BreakableJoints/diff/stepfast.cpp.diff deleted file mode 100644 index ed64cba..0000000 --- a/libraries/ode-0.9/contrib/BreakableJoints/diff/stepfast.cpp.diff +++ /dev/null | |||
@@ -1,143 +0,0 @@ | |||
1 | 587,598c587,593 | ||
2 | < /******************** breakable joint contribution ***********************/ | ||
3 | < // this saves us a few dereferences | ||
4 | < dxJointBreakInfo *jBI = joint->breakInfo; | ||
5 | < // we need joint feedback if the joint is breakable or if the user | ||
6 | < // requested feedback. | ||
7 | < if (jBI||fb) { | ||
8 | < // we need feedback on the amount of force that this joint is | ||
9 | < // applying to the bodies. we use a slightly slower computation | ||
10 | < // that splits out the force components and puts them in the | ||
11 | < // feedback structure. | ||
12 | < dJointFeedback temp_fb; // temporary storage for joint feedback | ||
13 | < dReal data1[8],data2[8]; | ||
14 | --- | ||
15 | > if (fb) | ||
16 | > { | ||
17 | > // the user has requested feedback on the amount of force that this | ||
18 | > // joint is applying to the bodies. we use a slightly slower | ||
19 | > // computation that splits out the force components and puts them | ||
20 | > // in the feedback structure. | ||
21 | > dReal data1[8], data2[8]; | ||
22 | 603,608c598,603 | ||
23 | < cf1[0] = (temp_fb.f1[0] = data1[0]); | ||
24 | < cf1[1] = (temp_fb.f1[1] = data1[1]); | ||
25 | < cf1[2] = (temp_fb.f1[2] = data1[2]); | ||
26 | < cf1[4] = (temp_fb.t1[0] = data1[4]); | ||
27 | < cf1[5] = (temp_fb.t1[1] = data1[5]); | ||
28 | < cf1[6] = (temp_fb.t1[2] = data1[6]); | ||
29 | --- | ||
30 | > cf1[0] = (fb->f1[0] = data1[0]); | ||
31 | > cf1[1] = (fb->f1[1] = data1[1]); | ||
32 | > cf1[2] = (fb->f1[2] = data1[2]); | ||
33 | > cf1[4] = (fb->t1[0] = data1[4]); | ||
34 | > cf1[5] = (fb->t1[1] = data1[5]); | ||
35 | > cf1[6] = (fb->t1[2] = data1[6]); | ||
36 | 614,691c609,614 | ||
37 | < cf2[0] = (temp_fb.f2[0] = data2[0]); | ||
38 | < cf2[1] = (temp_fb.f2[1] = data2[1]); | ||
39 | < cf2[2] = (temp_fb.f2[2] = data2[2]); | ||
40 | < cf2[4] = (temp_fb.t2[0] = data2[4]); | ||
41 | < cf2[5] = (temp_fb.t2[1] = data2[5]); | ||
42 | < cf2[6] = (temp_fb.t2[2] = data2[6]); | ||
43 | < } | ||
44 | < // if the user requested so we must copy the feedback information to | ||
45 | < // the feedback struct that the user suplied. | ||
46 | < if (fb) { | ||
47 | < // copy temp_fb to fb | ||
48 | < fb->f1[0] = temp_fb.f1[0]; | ||
49 | < fb->f1[1] = temp_fb.f1[1]; | ||
50 | < fb->f1[2] = temp_fb.f1[2]; | ||
51 | < fb->t1[0] = temp_fb.t1[0]; | ||
52 | < fb->t1[1] = temp_fb.t1[1]; | ||
53 | < fb->t1[2] = temp_fb.t1[2]; | ||
54 | < if (body[1]) { | ||
55 | < fb->f2[0] = temp_fb.f2[0]; | ||
56 | < fb->f2[1] = temp_fb.f2[1]; | ||
57 | < fb->f2[2] = temp_fb.f2[2]; | ||
58 | < fb->t2[0] = temp_fb.t2[0]; | ||
59 | < fb->t2[1] = temp_fb.t2[1]; | ||
60 | < fb->t2[2] = temp_fb.t2[2]; | ||
61 | < } | ||
62 | < } | ||
63 | < // if the joint is breakable we need to check the breaking conditions | ||
64 | < if (jBI) { | ||
65 | < dReal relCF1[3]; | ||
66 | < dReal relCT1[3]; | ||
67 | < // multiply the force and torque vectors by the rotation matrix of body 1 | ||
68 | < dMULTIPLY1_331 (&relCF1[0],body[0]->R,&temp_fb.f1[0]); | ||
69 | < dMULTIPLY1_331 (&relCT1[0],body[0]->R,&temp_fb.t1[0]); | ||
70 | < if (jBI->flags & dJOINT_BREAK_AT_B1_FORCE) { | ||
71 | < // check if the force is to high | ||
72 | < for (int i = 0; i < 3; i++) { | ||
73 | < if (relCF1[i] > jBI->b1MaxF[i]) { | ||
74 | < jBI->flags |= dJOINT_BROKEN; | ||
75 | < goto doneCheckingBreaks; | ||
76 | < } | ||
77 | < } | ||
78 | < } | ||
79 | < if (jBI->flags & dJOINT_BREAK_AT_B1_TORQUE) { | ||
80 | < // check if the torque is to high | ||
81 | < for (int i = 0; i < 3; i++) { | ||
82 | < if (relCT1[i] > jBI->b1MaxT[i]) { | ||
83 | < jBI->flags |= dJOINT_BROKEN; | ||
84 | < goto doneCheckingBreaks; | ||
85 | < } | ||
86 | < } | ||
87 | < } | ||
88 | < if (body[1]) { | ||
89 | < dReal relCF2[3]; | ||
90 | < dReal relCT2[3]; | ||
91 | < // multiply the force and torque vectors by the rotation matrix of body 2 | ||
92 | < dMULTIPLY1_331 (&relCF2[0],body[1]->R,&temp_fb.f2[0]); | ||
93 | < dMULTIPLY1_331 (&relCT2[0],body[1]->R,&temp_fb.t2[0]); | ||
94 | < if (jBI->flags & dJOINT_BREAK_AT_B2_FORCE) { | ||
95 | < // check if the force is to high | ||
96 | < for (int i = 0; i < 3; i++) { | ||
97 | < if (relCF2[i] > jBI->b2MaxF[i]) { | ||
98 | < jBI->flags |= dJOINT_BROKEN; | ||
99 | < goto doneCheckingBreaks; | ||
100 | < } | ||
101 | < } | ||
102 | < } | ||
103 | < if (jBI->flags & dJOINT_BREAK_AT_B2_TORQUE) { | ||
104 | < // check if the torque is to high | ||
105 | < for (int i = 0; i < 3; i++) { | ||
106 | < if (relCT2[i] > jBI->b2MaxT[i]) { | ||
107 | < jBI->flags |= dJOINT_BROKEN; | ||
108 | < goto doneCheckingBreaks; | ||
109 | < } | ||
110 | < } | ||
111 | < } | ||
112 | < } | ||
113 | < doneCheckingBreaks: | ||
114 | < ; | ||
115 | --- | ||
116 | > cf2[0] = (fb->f2[0] = data2[0]); | ||
117 | > cf2[1] = (fb->f2[1] = data2[1]); | ||
118 | > cf2[2] = (fb->f2[2] = data2[2]); | ||
119 | > cf2[4] = (fb->t2[0] = data2[4]); | ||
120 | > cf2[5] = (fb->t2[1] = data2[5]); | ||
121 | > cf2[6] = (fb->t2[2] = data2[6]); | ||
122 | 694d616 | ||
123 | < /*************************************************************************/ | ||
124 | 1178,1196d1099 | ||
125 | < /******************** breakable joint contribution ***********************/ | ||
126 | < dxJoint* nextJ; | ||
127 | < if (!world->firstjoint) | ||
128 | < nextJ = 0; | ||
129 | < else | ||
130 | < nextJ = (dxJoint*)world->firstjoint->next; | ||
131 | < for (j=world->firstjoint; j; j=nextJ) { | ||
132 | < nextJ = (dxJoint*)j->next; | ||
133 | < // check if joint is breakable and broken | ||
134 | < if (j->breakInfo && j->breakInfo->flags & dJOINT_BROKEN) { | ||
135 | < // detach (break) the joint | ||
136 | < dJointAttach (j, 0, 0); | ||
137 | < // call the callback function if it is set | ||
138 | < if (j->breakInfo->callback) j->breakInfo->callback (j); | ||
139 | < // finally destroy the joint if the dJOINT_DELETE_ON_BREAK is set | ||
140 | < if (j->breakInfo->flags & dJOINT_DELETE_ON_BREAK) dJointDestroy (j); | ||
141 | < } | ||
142 | < } | ||
143 | < /*************************************************************************/ | ||
diff --git a/libraries/ode-0.9/contrib/BreakableJoints/diff/test_buggy.cpp.diff b/libraries/ode-0.9/contrib/BreakableJoints/diff/test_buggy.cpp.diff deleted file mode 100644 index 65770da..0000000 --- a/libraries/ode-0.9/contrib/BreakableJoints/diff/test_buggy.cpp.diff +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | 266,270d265 | ||
2 | < | ||
3 | < // breakable joints contribution | ||
4 | < dJointSetBreakable (joint[i], 1); | ||
5 | < dJointSetBreakMode (joint[i], dJOINT_BREAK_AT_FORCE); | ||
6 | < dJointSetBreakForce (joint[i], 0.5); | ||
7 | 298c293 | ||
8 | < ground_box = dCreateBox (space,2,1.5,5); | ||
9 | --- | ||
10 | > ground_box = dCreateBox (space,2,1.5,1); | ||
11 | 300,301c295,296 | ||
12 | < dRFromAxisAndAngle (R,0,1,0,-0.85); | ||
13 | < dGeomSetPosition (ground_box,5,0,-1); | ||
14 | --- | ||
15 | > dRFromAxisAndAngle (R,0,1,0,-0.15); | ||
16 | > dGeomSetPosition (ground_box,2,0,-0.34); | ||