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 / [Dark Physics] Possible static rigid body box bug

Author
Message
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 2nd Aug 2006 21:29 Edited at: 2nd Aug 2006 21:30
I've been converting my current project to dark physics slowly today. The character controller and converting the level to a static mesh have all worked great with no noticable performance hit. However, some parts of my level are separate objects that are positioned, rotated and scaled. I've been trying to set them up as static rigid body boxes, but have come across what I think is a bug.

Here's the screeny:


The left column shows the transparent objects normally and the right column shows them after this command is applied:
phy make rigid body static box obj

If I simple position the objects, the physics implementation is fine. If I position and scale the objects, it works fine too. If I position and rotate the objects, it seems to be fine also. When I position, scale and rotate the objects before making the static box, then I get the problem.

I've tried positioning and scaling the objects, then making the rigid body and then using the phy set rigid body rotation command, but this has no effect. I'm assuming this command is only for dynamic rigid bodies and not static ones, so that would explain it.

One thing to note is all the errors in scale on the objects appear to be parellel with the z-axis. The one that is fine (the second one down) is flat on the z-axis and the 4th one down appears fine but it's "over scaling" is disappearing under the rest of the level geometry.

So basically, as soon as I run the phy make rigid body static box it somehow adjusts the size of my objects on the z-axis. Notice in the 1st and 3rd shots it seems to have made them larger, but on the 5th its shrunk it a little.

Any suggestions?

Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 2nd Aug 2006 21:37
Are you using fix object pivot in your code? This is not currently supported within Dark Physics and will cause your rigid bodies data to be incorrect.

Can you enable debugging in your program by making a call to phy enable debug at the start of your code. Now run the debugger tool from the start menu and then run your program. Go back to the debugger and press the stop button. Go to the view menu and adjust the camera mode. Take a look around and can you see if the rigid bodies look correct inside the simulation. This may help us to get a better idea of things.

If you can create a very small example program demonstrating this problem I can take a closer look and find out what is going wrong. It may well be some specific usage of code that is tripping things up and I need to change something in DP or I can tell you an alternative way to set things up.
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 2nd Aug 2006 21:42
No, there's no use of fix object pivot. I'll try the debug mode as you've suggested and report back ASAP.

Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 2nd Aug 2006 21:49 Edited at: 2nd Aug 2006 21:50
Arrghh. Forgot to mention something which is pretty key. As proven by looking at the debugger (hard to get your head around the inverted world btw! ), the physics structure is fine. I totally forgot to mention that. So the physics world is spot on, but the visual world gets screwed up. So those extra extensions on the platforms my character will fall through, because the physics world is correct, but the visual world has been distorted.

I'll try and see if I can replicate the problem in a little test program.

Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 2nd Aug 2006 21:57
Here you go. The red plain is not set as a physics object and the white plain is. As soon as you uncomment the rotation command, the white plain becomes larger than the red plain.



Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 2nd Aug 2006 22:01
Hmm, if you increase the scaling on the Z-axis, you'll see the white object (the rigid body) actually gets bigger. It's as though when an object is a rigid body, scaling occurs with regard to its new rotation, where as the non-rigid body doesnt scale on the z-axis because on it's original rotation it is flat on the z-axis.

.... if that makes any sense at all.

Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 2nd Aug 2006 22:06 Edited at: 2nd Aug 2006 22:06
Thanks for the code. Odd how it should work like this. Might be somehow missing some of the scaling / rotation data. Will get it fixed asap.
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 2nd Aug 2006 22:08
Nice one Mike, thank you. Seeing as the physics world is fine its not really a show stopper so I'll crack on with implementing the rest of it.

Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 2nd Aug 2006 22:35
I think this is sorted now. If you send me an email to mike@thegamecreators.com I will send you back a DLL to try out so we can see for certain if the problem is fixed.
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 3rd Aug 2006 00:05
Just to confirm Mike appears to have fixed this in record time.

Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 3rd Aug 2006 00:42
Good to know it's all working well for you now I'm interested in the screenshots you have posted for your project Do you have any more info on what you're doing and how you are using Dark Physics in it?
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 3rd Aug 2006 00:53
I'll drop you an email Mike. I'm keeping it quiet until WiP post time in a month or so.

monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 6th Aug 2006 16:31
Sorry to resurrect a thread, but fallout I'm just curious how you added your map model which I understand is created in 3DWS into DP, I mean I use brushes with properties like materials and when you export this into dbo all the faces of the brushes are created as separate limbs so to make a box object from a limb you have to extract six faces and add them all to one object and when I do this DP has trouble creating physics objects for them.

I know the voices aren't real, but they have good ideas!
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 6th Aug 2006 16:43
It's as simple as phy make rigid body static mesh

monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 6th Aug 2006 16:46
Yeah, but I'm using brushes as collision brushes and only adding collision to them, also I'm adding material properties to brushes from within 3DWS so each brush object needs to be pulled out then added to the system indiviualy and the limb extraction/adding commands seem to be borked or I'm just not using 'em correctly.

I know the voices aren't real, but they have good ideas!
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 6th Aug 2006 16:59 Edited at: 6th Aug 2006 16:59
Ahh, I think I see what you mean. Well my whole 3DWS object is used in collision. There are no individual collision brushes or anything. If you've made a lower poly collision version you could try just using the full model for collision, as I think the optimisation in DP might be quick enough to handle it. Alternatively I would suggest exporting the collision brushes you're talking about as a separate DBO and then just setting that up for collision. Once you've setup an object for collsion you can exclude it to avoid any performance problems.

Edit: The problems shown in this thread are objects I added separately later. They're not exported from 3DWS.

monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 6th Aug 2006 17:02
Yeah sounds like a good idea I'll give it a whirl, cheers

I know the voices aren't real, but they have good ideas!

Login to post a reply

Server time is: 2024-11-24 12:23:56
Your offset time is: 2024-11-24 12:23:56