From 81c09eb33ae200f92f62f3fe61d06a5c90171b58 Mon Sep 17 00:00:00 2001 From: Jasper Date: Fri, 23 Jan 2015 12:59:28 +0100 Subject: [PATCH] constraints work. Why? because i said so! --- Levels/ObjectSetups/Compositions.xml | 12 +++- Levels/ObjectSetups/Level1.png | Bin 2121 -> 2160 bytes Levels/ObjectSetups/Level1.xcf | Bin 490851 -> 490944 bytes Levels/ObjectSetups/Level1.xml | 98 ++++++++++++++++++++++++++- physics.cc | 2 +- 5 files changed, 106 insertions(+), 6 deletions(-) diff --git a/Levels/ObjectSetups/Compositions.xml b/Levels/ObjectSetups/Compositions.xml index 0af3f5a..ecf35df 100644 --- a/Levels/ObjectSetups/Compositions.xml +++ b/Levels/ObjectSetups/Compositions.xml @@ -230,6 +230,9 @@ true SimpleWall.obj + 0.0 + 0.0 + 0.0 0.0 40.0 0.0 @@ -244,11 +247,14 @@ false block.obj - 0.0 - 5.0 + 0.0 + 20.0 0.0 + 0.0 + 0.0 + 0.0 1.5 - 1.0 + 2.0 diff --git a/Levels/ObjectSetups/Level1.png b/Levels/ObjectSetups/Level1.png index 279687c9c58da494bba53ab73f29fb0b6473d3b7..d36185a4beb20ed0817532ba64017ce9a1f4bd5d 100644 GIT binary patch delta 484 zcmX>p@IhdL3ZwZ()orY5Ry#8lxR?~QZhsVJ*|}k6?fuSFiv@lMrcYe)-EVDPq}*R` z#t;4+lMk{NO)g-KsL#FrufbX7tzVkOU+KQ`^v#y@A13+zz8Q0_z;yZRn|IC>STEmw z^UnDX2Fs7%v^o31X8H7+d(M3@TmJoK&6y9D%h%tmS^sy7!-=%WX2JjuI&SHlE;{kP?)K{0w>laXcouEyRXo5{?fHb=^Ld6QL;anotJN&O zX73bX$oFGlSj57h;Dw;h-Tl1&b@p#|hDCidZ{A}#(Db=cdj0F_-!mEhl%F~Cjg3JJ zY9A+q!H}=a3_#%N>gTe~DWM4f!RDp= delta 457 zcmew$a8h7`3ZuYA)orZxzqYN^;9%0w`tdcGW$%N%-}l-unehHeQGI85F+(jfw}|nF zItzn>7X!m0no#vLG#i`IeBt&9^6tAQOZxq9dwln1PWHL<9WyRJ%~_YWW8USnIeFf6u84tJf7M+K_wul{v$P1_lNf zP6mf5KB_CpEs6% z|9Vr7`@q{7GvCTHL?|#Y1TrxQr~;|y$oI6085YVrhDd9f?} Xe;eid91ieSG5~?6tDnm{r-UW|Q)rU~ diff --git a/Levels/ObjectSetups/Level1.xcf b/Levels/ObjectSetups/Level1.xcf index 4febd9b8ce4683a334e40427820c7d2e9ed3c6b3..8281711ea2469581fad71f5232539e65f3c79ab0 100644 GIT binary patch delta 976 zcmZwDT}TvB7zW_?%->mCO>LE=vNZ|~YS%D{Eh-hFBmxyG(~z>fh!Ro|lH7GPMMb16 zg_R2W)2L98cEJh-FNC~EGVH=2B(kU^unWmb+3B5v5OUy|^YOiNKF*x!U&+G@$^Eq= zssZ*RFFx*Q7GqH-fT(kHp`%2Z*s}|8xG0ATsFW(Hp03g?S^PSd+>}mPlxL3&RjL6c zG^4x4)-P6M)N)zo%0+7dmIccMTUfRgN|hzzpm=0&sj^?D$hIQ+T=rU#1j}?DXUPh!rmL82|G!U8no@83Bbv1aOuCXmM}!oPl$?ch?-J})*Og%55#i=V(cEo+)*g*15ol>q4?iG=^21B zz5|N+u@lOtA*il3P`%Yqi@TsU7ennYf;#1cI?sM&7TRVDT45hFGag#sYG|+Op)H1? zyB*Ne??B(54gKsO^rjoo?`A+Bnt}fQ77S4iBiaFDV=s)%?=W&xVVq8capftDXHKj& zCRG^oLy$3PkVzSk8y-Mz=dB!xY4A9kJx)Oisicuk#(>8uC(fIhe=p0vFbK$+!;pcS z#1Vn8-TaqJ|4B%H8J(eWs-P;WCO_3tBehT)wNoc`5oh{uQ#Wz8znA(UO@Elh6B?vp z8lh2oLF4qACh0A`qYw0%zS1|EqaU=$1A{bjP&CC+0wvKpN}){h(Qe9yM+Ww>$fZM+ zPj%EtE!0Ns)Ja`HFg_r?L3co=Eb~fS6}ujBmUoG`;5NTZPETIaS{g4`n=u7{HU+Z+ Ga?@`LaTZqq delta 890 zcmZ9~TSyd990u_3%}rgEyLd(=;(G)+G!#3v&u&Ut09O7$!4 zE-m;=j}atgjh;~VkJaFDeyrtpF!z< z0A*Z-vQP$Pu?1?>BGj~es23`rHl;xANrpP3LtSPb?uWK>6q>IVTKx>Pm*1dGoPri= zfWB=CdipKsM>ayg-VD9*D)cTJ`am!Axf?J<4h;7cjHDW*8++cvIQkn#`5cT#jWGH? z!T2~1W2FT$atSiVhD^K*naN!_`{jPAyQ$PINFkLp(#hy8b<4@ymRQ>?XG0+%>k=XT zd32n7PPpEe<}OGxgR&@xa_J!D(=j?pMRbnNQwfz(1zn??R7ISgSwntE%WPorkeaEL z+UPMop{LYE-SnJZ(QA53eKbJtXqZ0G7){U=eWtH8OAGX!e$omTCdf^j;FbO@EMh2@ t5-5pM$V=&zNqcF3$3;^P$9Y0f`D+4}XApVomCkBk$0bu{b#(gW_P?ts>v;eG diff --git a/Levels/ObjectSetups/Level1.xml b/Levels/ObjectSetups/Level1.xml index b0876d3..29323cf 100644 --- a/Levels/ObjectSetups/Level1.xml +++ b/Levels/ObjectSetups/Level1.xml @@ -8,7 +8,7 @@ 0.0 -220.500000 2 - 221 + 224 20 - @@ -37,7 +37,7 @@ 0.0 -220.500000 2 - 220 + 223 80 - @@ -56,6 +56,100 @@ + + 1.0 + 0.0 + 0.0 + 0.0 + false + 200.500000 + 0.0 + -222.500000 + 2 + 222 + 200 + + - + 0 + 0 + 0 + - + - + 1.0 + false + 0 + - + 0 + 0 + 0 + + + 0 + 200.5 + 30.0 + -222.5 + 20 + + + + + 1.0 + 0.0 + 0.0 + 0.0 + false + 198.500000 + 0.0 + -213.500000 + 2 + 221 + 200 + + - + 0 + 0 + 0 + - + - + 1.0 + false + 0 + - + 0 + 0 + 0 + + + + + 1.0 + 0.0 + 0.0 + 0.0 + false + 191.500000 + 0.0 + -213.500000 + 2 + 220 + 200 + + - + 0 + 0 + 0 + - + - + 1.0 + false + 0 + - + 0 + 0 + 0 + + + 1.0 0.0 diff --git a/physics.cc b/physics.cc index e990551..1139f97 100644 --- a/physics.cc +++ b/physics.cc @@ -25,7 +25,7 @@ void Physics::takeUpdateStep(float timeDiff) { if(allPositionConstraints[i].position != allPositionConstraints[i].body->getCenterOfMassPosition()) { - btVector3 dir = allPositionConstraints[i].body->getCenterOfMassPosition() - allPositionConstraints[i].position; + btVector3 dir = allPositionConstraints[i].position - allPositionConstraints[i].body->getCenterOfMassPosition(); allPositionConstraints[i].body->applyCentralForce(dir*allPositionConstraints[i].strength); } }