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 / Two "joined" rigid bodies passing through each other

Author
Message
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Jan 2010 22:25 Edited at: 13th Jan 2010 22:25
When I add a revolute joint near the edge if a rigid body I sometimes get a strange result...

Here is what two "hinged" bodies look like when they work:


...and here is what they look like sometimes:


Both work in the simulation as rigid bodies I can fire stuff at them and they move so I know they work but they can still pass through each other... has anyone experienced this or maybe knows what is causing it?

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Jan 2010 10:36 Edited at: 14th Jan 2010 10:36
This is really confusing...

Let me explain a little further:
1-I have made a working "hinge" connection (the objects do not pass through each other).

2-I am saving the position and rotation of the two physics objects and the position and rotation of the "hinge" object (which gives me the position and rotation of the revolute joint).

3-I am making an exact copy of the two physics objects and the "hinge" object and putting them all in the same positions and rotation (EDIT: after deleting the originals).

4-I am making the revolute joint in the same way and in the same place.

Result-A working revolute joint which successfully connects the two working physics objects which interact with any other physics objects in the scene EXCEPT each other... How can this be?

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th Jan 2010 13:08
what do your two local anchor command set look like?

opps
Quote: "(EDIT: after deleting the originals)."
, can't remember if the delete physx object is work correctly.

do you delete both DBPro objects and physX objects?

Dark Physics makes any hot drink go cold.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Jan 2010 13:36
Quote: "what do your two local anchor command set look like?"

That gets complicated because there's a lot of stuff in arrays...

You can tell the anchors are in the right place though as the objects rotate perfectly around the hinge object.

Quote: "do you delete both DBPro objects and physX objects?"

Yes I delete both but save position and rotation data in a text file example attached.

In the example the first line is the number of objects.
The second line is the object type (9 is a rectangular block).
The third line is the "Mode" (texturing style).
Lines 4 to 6 are X,Y,Z positions.
Lines 7 to 9 are X,Y,Z rotation.
Line 10 is 0 for a dynamic object and 1 for static.
...then lines 11 to 19 are a repeat for the second object.
Lines 20 onwards are for the Joint...

Line 20 is the number of joints.
Line 21 is the type (1 is a hinge).
Line 22 to 24 are the position of one end of the hinge (relative to the local position/rotation of the parent object).
Line 25 to 27 are the position of the other end of the hinge (relative to the local position/rotation of the parent object).
Lines 28 and 29 are the object numbers of the two objects to be connected.

Sorry if that's confusing!!

Attachments

Login to view attachments
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th Jan 2010 14:02
any chance that you can just make a quick demo that tries to do what your main code is doing so we can see what might be going on, plus if you can't get the demo to do it then you may have found your answer.

Dark Physics makes any hot drink go cold.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Jan 2010 14:10
I'll try but the code is complex. I have a feeling this might be caused by the two objects not having been run through the "phy update" before adding the joint so I'm going to add that in now first as an experiment...

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th Jan 2010 14:16
do you use the visual debug when working out whats happening.

Dark Physics makes any hot drink go cold.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Jan 2010 14:40
I never got round to working out how to get it working...
I have a link to it somewhere, is it complicated?

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th Jan 2010 14:56
No just make sure the the visual debugger is running then put this line at the top of your code

phy enable debug

run your program then stop it, and then watch what the debugger as captured.

here a link to the newest one they have visual debugger

Dark Physics makes any hot drink go cold.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Jan 2010 15:04 Edited at: 14th Jan 2010 15:11
OK so I downloaded the debugger and added PHY ENABLE DEBUG to my code and guess what? It works now... made the same connections and now they work!! When I disable it though it still works... Aaaagh! I hate not knowing how I did something!!!!

Does the debugger update the physx system somehow? Did pixies go inside the computer and fix it like the tale of the shoemaker? I don't know but if they did "Thank you pixies!!!".

I'm going to UNDO and see what else might have done it...

EDIT: It was elves not pixies, sorry elves!!

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th Jan 2010 15:16
Yes that maddening when it starts to work and your dam sure you did not change anything.

the above debugger comes with the view as right handed as defualt DBPro use left, so you may want to change that later on.

Well done with whatever you may have done at least you can move on to the next error.

Dark Physics makes any hot drink go cold.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Jan 2010 15:43
Quote: "Well done with whatever you may have done at least you can move on to the next error."

There will always be another one to move on to won't there?

Thanks for your help again!

BTW this game is nearly finished now. Just adding a few extras in and trying to fix and find bugs as I play! Check out the thread (click on my signature) and download the Beta[s] if you get time, I'm very pleased with it so far and your help will be noted in the credits!!

Duke E
15
Years of Service
User Offline
Joined: 10th Mar 2009
Location:
Posted: 15th Jan 2010 01:29
Test setting "Phy Set Controlled Filtering State" to false. That turns on collision between jointed bodies.

The help says the default is true. I see some differences in my games breakable scenery objects as they wont jitter and go crazy before breaking apart.

Regards
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Jan 2010 10:38
I never saw that one before! Thanks Duke E!!

I've set it now anyway, that'll certainly stop it! Maybe using debug sets this state to true?

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 15th Jan 2010 16:50
The visual debugger really helps a lot. When I was learning how to get vehicles working with Dark Physics, I got fed up and ran the debugger. Turns out (no clue why), when specifying vehicle dimensions, you need to divide them by two. So when I ran the debugger I hadn't done that yet, and saw this gigantic vehicle body with four small wheels. Even stranger is, it turns out the radius for the wheels doesn't have to be divided by two. Go figure. Theres some really serious problems with the entire Dark Physics package. I usually support TGC, but they really let this one go into the deep end. The help files are really sloppy, half of them just get cut off for the vehicles, half of them describe function parameters using the parameter in the description (so if a parameter was set whatchyacallit vector, they would describe it as "this sets the watchyacallit vector").

Definitely going to switch over when Xarshi finishes his Havok wrapper, especially since thats what they seem to be using in all the major titles today anyways. Dark Physics is great if you want to make a pile of boxes getting hit by a giant ball, but anything more advanced takes ages to work out (proved by your post).

<rant over>
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Jan 2010 12:43
I have to agree RUCCUS, I'll be keeping a close eye on Xarshi's post too...

Login to post a reply

Server time is: 2024-04-20 16:36:27
Your offset time is: 2024-04-20 16:36:27