AnniXa Posted August 21, 2011 Share Posted August 21, 2011 Hello, i just try to make some bodys with joints together, so i was very lucky to found this example: http://www.leadwerks.com/wiki/index.php?title=CreateJointBall but for any reason even the sample wont work: the cubes are all falling down B) Maybe this is out of date? What do i need to do, for joining the balls together like a chain in the screenshot? Quote Whuts wroong? Link to comment Share on other sites More sharing options...
Canardia Posted August 21, 2011 Share Posted August 21, 2011 The C++ example works fine: http://www.leadwerks.com/werkspace/page/Documentation/le2/_/command-reference/joints/createjointball-r252 Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
AnniXa Posted August 21, 2011 Author Share Posted August 21, 2011 ty for your help, i was not able to find any relevant difference between the cpp and the bmx sample. maybe i need to call some init function or something when using joints in bmx? Quote Whuts wroong? Link to comment Share on other sites More sharing options...
Canardia Posted August 21, 2011 Share Posted August 21, 2011 I used LEBuilder to make the CodeBlocks example for Rotating Cube, and replaced the code by pasting the BallJoint example there, and it worked. I didn't try the BlitzMax example, because I don't use BlitzMax anymore. But maybe the LEBuilder BlitzMax cube example will work too. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
AnniXa Posted August 21, 2011 Author Share Posted August 21, 2011 ty, that was worth a try B) i did the same, used the sample with the rotating cube, and just pasted the code from the bmx joint sample in. thats what i get: LW and stuff seems to work fine, also the physics stuff, the cubes falling down, but they are not chained together with joints, like they should, they just fall down, instead of hanging on the "crane" thingie. Quote Whuts wroong? Link to comment Share on other sites More sharing options...
klepto2 Posted August 21, 2011 Share Posted August 21, 2011 Hi, this is the result if you didn't copy the "JointLibrary.dll" into your application folder. Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
Canardia Posted August 21, 2011 Share Posted August 21, 2011 I tried the BlitzMax example too, and it works fine also. I had to fix these lines though, because someone who made the example made it only for vsync hardcoded PCs, and mine is vsync free (like most hardcore gamer's PCs are), so this vsync free code works on all PCs: If KeyHit(KEY_SPACE) AddBodyForce(cubePhy[Rand(9)],Vec3(10000,0,10000),0)' apply force End If UpdateAppTime() UpdateWorld(AppSpeed()) Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Josh Posted August 21, 2011 Share Posted August 21, 2011 I just tried this, and the ball joints are holding the chain together: SuperStrict Framework leadwerks.ENGINE Graphics 640,480 RegisterAbstractPath "C:\Leadwerks Engine SDK" RegisterAbstractPath AppDir If Not CreateWorld() RuntimeError "Failed to create world." Local camera:TCamera=CreateCamera() Local buffer0:tbuffer=CreateBuffer(640,480,BUFFER_COLOR0|BUFFER_DEPTH|BUFFER_NORMAL) MoveEntity Camera, Vec3(0,40,-30) RotateEntity Camera, Vec3(45,0,0),0 SetShadowQuality(1) Local light:tlight=CreateDirectionalLight()' Create light MoveEntity (Light, Vec3(0,10,0) ) RotateEntity (Light, Vec3(45,45,0) ,0) EntityColor(Light, Vec4(1)) AmbientLight (Vec3(.2,.2,.3)) Local ground:tentity= CreateCube()' Ground Local groundphy:tbody = CreateBodyBox(100,100,100) EntityParent (ground,groundphy) ScaleEntity(ground,Vec3(100,100,100)) MoveEntity (groundphy, Vec3(0,-50,0)) SetBodyMass(groundphy, 0); EntityType (groundphy, 1, 1); Local crane:TEntity= CreateCube() Local cranephy:tbody = CreateBodyBox(100,2,2) EntityParent (crane,cranephy,0) ScaleEntity(crane,Vec3(100,2,2)) MoveEntity (cranephy, Vec3(0,30,0)) SetBodyMass(cranephy, 0) EntityType (cranephy, 1, 1) Local cubePhy:tbody[10] Local cube:tentity Local joint:tjoint For Local i:Int=1 To 10 cube= CreateCube()'boxes cubePhy[i-1]= CreateBodyBox(1,1,1) EntityParent (cube,cubePhy[i-1],1) ScaleEntity(cube,Vec3(2,2,2)) SweptCollision (cubePhy[i-1], 1) MoveEntity (cubePhy[i-1], Vec3(0,i*2-1+10,0)) SetBodyMass(cubePhy[i-1], 1) EntityType (cubePhy[i-1], 1,0) If i=10 Joint:tjoint = CreateJointBall( cranephy,cubePhy[i-1], Vec3(0,29,0)) End If If i>1 Joint:tjoint = CreateJointBall( cubePhy[i-1],cubePhy[i-2], Vec3(0,i*2-2+10,0)) End If Next Collisions(1,1,1)' Important! Enable collision between bodys of Type 1 While Not KeyHit(KEY_ESCAPE) If KeyHit(KEY_SPACE) AddBodyForce(cubePhy[Rand(9)],Vec3(10000,0,10000),0)' apply force End If UpdateWorld(1) SetBuffer(Buffer0) RenderWorld() SetBuffer(BackBuffer()) RenderLights(Buffer0) DrawText ("Press SPACE to apply force to one of the boxes!",0,0) Flip 1 Wend Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Canardia Posted August 21, 2011 Share Posted August 21, 2011 Yeah, but if you delete JointLibrary.dll then the joints don't hold together, and there is no error message either of a missing dll. But this is kinda not really a bug, since it's obviously designed so that if JointLibrary.dll was not found, then joints just don't work. It might be useful sometimes that way, instead of simply crashing the app. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Josh Posted August 21, 2011 Share Posted August 21, 2011 Yep, that is true. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
AnniXa Posted August 21, 2011 Author Share Posted August 21, 2011 Ah cool thank you very much! this explains all =) Quote Whuts wroong? Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.