Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / [DP] Create solid body out of multiple objects?

Author
Message
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 3rd Jun 2008 20:28 Edited at: 3rd Jun 2008 20:36
HELLO! I make game!


In my game I want to be able to draw stuff and that stuff becomes a dynamic body. But it becomes a soft body instead. I use "Fixed Joint" to merge the different objects from the drawing of stuff.

I thought that would make the body stiff, but instead it becomes kind of like a ragdoll except the "limbs" aren't rotating (which they shouldn't).

I cleaned my code a bit so it's ready for this post.



I hope you know how to solve this issue because I've struggled with it for a day now.

You may want to have a look at the code and run it, to better understand what I am trying to explain but fail so miserably!


kthx.

PS:
Note that the drawing and converting is not PERFECT! I am sorry I suck at taht part.

I allways afraided from a clowns. aww..
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 3rd Jun 2008 22:02
You have the same sort of problem I'm having where the object acts like a bungee rope instead of begin stiff.

What you done so far is amazing hope the answer is find able.

Dark Physics makes any hot drink go cold.
Codger
22
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 4th Jun 2008 05:09
All I get is a black screen with FPS on it

System
MacBook Pro
Windows XP Home on Boot Camp
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Jun 2008 17:32
Lukas W just been messing about with a made up limb object and have seen it do something that I did not expect.

1. The visual you see in your game screen does not move but in the debug screen it has move to the position you movee it

2. and you should be able to move it in the debug screen but you can not.

thought you might like to know this.

Dark Physics makes any hot drink go cold.
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 4th Jun 2008 17:48
HowDo,
That is odd:S I tried to do what you described, but it wouldn't move at all either in the dbpro window nor the ageia debugger..
I wonder what's up with that.

Codger,
I am not sure why you get a black screen.
Do you have DBPro U68 and Ageia v8.0.425?
I was writing the code based on those two.

I allways afraided from a clowns. aww..
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Jun 2008 18:03
Lukas W was trying it on the little demo of flat rockers I just posted, in that I could see my object but it stayed put in the screen but debug had shown it to have moved when using mesh.

now if I can just find away of making fluid emitter and pulleys to work, be able to think about something else.

Dark Physics makes any hot drink go cold.
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 4th Jun 2008 22:14 Edited at: 4th Jun 2008 22:31
Do you think it would help if I joint all objects with all objects?

What I mean with this is:
obj1 -> obj2
obj1 -> obj3
obj1 -> obj4
obj2 -> obj3
obj2 -> obj4
obj3 -> obj4
etc.

Right now I use this method:
obj1 -> obj2
obj2 -> obj3
obj3 -> obj4
etc.


I would try it out, but I can't figure out how to implement this in order to make it automatic.

Edit,
this method should work:

But it is not creating a joint at all
(of course I am not using this exact code to make the joints, the code above is just a deomnstration)

Edit2,
Of course it will not create the joints, because if I use this code it will not find the rigid bodies; they are not created yet.

Edit3,
This would do it, gonna test:


I allways afraided from a clowns. aww..
Kendor
21
Years of Service
User Offline
Joined: 31st Jan 2003
Location: Malta
Posted: 4th Jun 2008 22:35
Quote: "Do you think it would help if I joint all objects with all objects?"


I've tried it with a simple example and it still didn't work, although the resultant object was more rigid.

The best way I've found to atleast make them stay together was to add a box in the middle and set a fixed joint between the middle box and all the parts. Still not perfect but more or less it works.



Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't know why.
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 4th Jun 2008 22:37 Edited at: 4th Jun 2008 22:51
Kendor,
Lol, that was a bit unstable but it still worked.
Thanks for the input!


However,
I tried what I wanted to try. And as Kendor said, it was more rigid. It still was a way better result than it used to be.
I think I will use this method for now until someone finds a better solution.

Edit,
As a sidenote I finally was ablo to restrict movement to only X,Y axis So now I'm getting somewhere.

I allways afraided from a clowns. aww..
Kendor
21
Years of Service
User Offline
Joined: 31st Jan 2003
Location: Malta
Posted: 5th Jun 2008 00:16 Edited at: 5th Jun 2008 00:18
Since you said my code was unstable, I've re-ran it and the thing went berserk

Originally, in order to make it more readable, I've changed the order of the commands, leaving the creation of the middle box to the end. Wrong move. If you create it first, it works beautifully:




Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't know why.
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 5th Jun 2008 02:07
Not bad! However that will only work well with spheres,cubes,triangles or anything which represents a round object.

In my game I have lines as well, among other things.

Both of our methods seem to work the same (at least from my eye).
The only difference is that you make just one extra joint, while I make extra joints depending on the nr. of objects in the entity (which can reach quite a lot).

Anyway I am going with my method for now, because here I know I can have lines and complex shapes as well.

I allways afraided from a clowns. aww..

Login to post a reply

Server time is: 2024-11-24 23:29:43
Your offset time is: 2024-11-24 23:29:43