Ywa Posted September 7, 2010 Share Posted September 7, 2010 Hello. I've been trying to understand how joints work in the engine, so I set myself a simple example: var Phys,Mesh, Phys2, Mesh2 : TEntity; //////////TEST/////////// Phys := CreateBodyBox( 1,1,1 ); Mesh := CreateCube( Phys ); EntityType( Phys, 1 ); PositionEntity( Phys, mCar.GetPos + Vec3( 0,2,0 ), 1 ); //mCar is another entity Phys2 := CreateBodyBox( 1,1,1 ); Mesh2 := CreateCube( Phys2 ); EntityType( Phys2, 1 ); PositionEntity( Phys2, mCar.GetPos + Vec3( 0,0.5,0 ), 1 ); SetBodyMass( Phys2, 1 ); CreateJointHinge( Phys, Phys2, mCar.GetPos + Vec3( 0,1,0 ), Vec3(1,0,0) ); Basically, I want to see how it works (just like in the wiki example), however when I run the above code, the second box (phys2/mesh2) falls to the ground, without hinge-ing or whatever. I even tried parenting before, but it makes it worse. What am I doing wrong? Thanks. Quote Link to comment Share on other sites More sharing options...
Ywa Posted September 8, 2010 Author Share Posted September 8, 2010 Bump. Quote Link to comment Share on other sites More sharing options...
Wchris Posted September 8, 2010 Share Posted September 8, 2010 Bump. i don't know, but i'll try your code, looks funny to play with joints Quote Windows 7 home - 32 bits Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM Link to comment Share on other sites More sharing options...
Wchris Posted September 8, 2010 Share Posted September 8, 2010 Bump. Boing ! what is mCar.GetPos supposed to return ? a Tvec3 ? and delphi does not complain when you use the + operator on two Tvec3 ? If you have overloaded the Tvec3 add operator, then maybe the problem is there ? This is what i get Quote Windows 7 home - 32 bits Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM Link to comment Share on other sites More sharing options...
Ywa Posted September 9, 2010 Author Share Posted September 9, 2010 mCar.GetPos returns a TVec3, yes. I also have an overloaded add operator (..but I haven't got problems using it). Anyways, I'll try your code and post results. Results: EDIT: I have no idea what's wrong. Also, there's some clipped code (on the CreateJointHinge line, can you write it, please). Thanks. Quote Link to comment Share on other sites More sharing options...
Wchris Posted September 9, 2010 Share Posted September 9, 2010 EDIT: I have no idea what's wrong. Also, there's some clipped code (on the CreateJointHinge line, can you write it, please). Thanks. Don't worry we will find out what's wrong. I'm currently at work, i'll come back this evening. Hey ! an overloaded add operator for Tvec3 is a good idea ! Why did i not have this one ? Will do this too ! EDIT : Your screenshot tells me your engine is not up to date, all those red lines in physics debugging mode is a bug that activates debugging on terrain. You'll need latest cray supercomputer to get decent fps when debugging physics with this version . please rerun LESDK updater for 2.40 and try again. Quote Windows 7 home - 32 bits Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM Link to comment Share on other sites More sharing options...
Ywa Posted September 9, 2010 Author Share Posted September 9, 2010 From my game engine log, it seems I already have LE 2.40. Leadwerks Engine 2.40 Initializing Renderer... PS: Seems like my engine.dll wasn't updated. Results: - Aside from the fact that the terrain physics aren't debugged anymore (which is a good thing), my problem is still there. Waiting for your reply, thanks Quote Link to comment Share on other sites More sharing options...
Wchris Posted September 9, 2010 Share Posted September 9, 2010 From my game engine log, it seems I already have LE 2.40. Leadwerks Engine 2.40 Initializing Renderer... PS: Seems like my engine.dll wasn't updated. Results: - Aside from the fact that the terrain physics aren't debugged anymore (which is a good thing), my problem is still there. Waiting for your reply, thanks Yes, i know you have 2.4, the physics debugging bug was a 2.4 bug. i just hoped josh fixed something else in latest engine.dll that would explain my 2.4 is working and your's is not my code is exactly the same as you, and it works ... Phys1 := CreateBodyBox( 1,1,1 ); Mesh1 := createcube(phys1); EntityType( Phys1, 1 ); PositionEntity( Phys1, Vec3( playerposition.X, playerposition.Y+2, playerposition.Z ), 1 ); Phys2 := CreateBodyBox( 1,1,1 ); Mesh2 := createcube(phys2); EntityType( Phys2, 1 ); PositionEntity( Phys2, Vec3( playerposition.X, playerposition.Y+0.5, playerposition.Z ), 1 ); SetBodyMass( Phys2, 1 ); CreateJointHinge( Phys1, Phys2, Vec3( playerposition.X, playerposition.Y+1, playerposition.Z ), Vec3(1, 0, 0) ); now i'm clueless how many newton.dll and jointlibrary.dll do you find on your system ? Quote Windows 7 home - 32 bits Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM Link to comment Share on other sites More sharing options...
Ywa Posted September 9, 2010 Author Share Posted September 9, 2010 how many newton.dll and jointlibrary.dll do you find on your system ? Many thanks, there was no joinlibrary.dll in the binary folder ... Silly me Quote 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.