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 / DarkPhysics Rigid Body Generation Problem

Author
Message
Lucy
17
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Roanoke, VA USA
Posted: 20th Oct 2008 03:55 Edited at: 20th Oct 2008 05:44
I'm trying to do multiple things that involve creating many new dynamic rigid bodies objects in realtime.

One of them is a weapon that fires out a burst of particles in all directions.

Another is throwing out pickups and debri using physx so that the pickups and debri collide with objects and whatnot.

The problem is that even the PHY MAKE RIGID BODY DYNAMIC SPHERE is too slow to allow this. I would go and clone or instance the existing collision data. Compute it ONCE and then use the same data every time. However, that's not exactly possible.

You see, you have two options.
1: Have DarkPhysics generate the rigid body's data on every instance
2: Load a collision mesh from harddisk and use that instead

The problem with this is that neither option allows you to take an existing collision mesh and apply it. Why is that?

The only way I can see making this work without framerate drops every time something explodes or a burst weapon is used is to generate a bunch of these objects in the start and hie them until they're needed. However, that's too much of a hack and I'd really rather avoid doing it because to be honest, the game I'm making is essentially a sandbox with an unknown number of maximum "particles" that can pop out.

(edit)
Is there any better way of doing this? Seriously, I realize that too much physics is a bad thing, but spawning merely 12 objects isn't exactly heavy and my system isn't exactly slow. If my monster machine craps out for a quarter of a second, anyone's machine will.

Here's the code I'm using just so you can see how tight the code is:


the function, btAddParticle is:


Everything I needed to know about trigonometry, I learned by becoming a game programmer.

Login to post a reply

Server time is: 2024-09-19 17:03:49
Your offset time is: 2024-09-19 17:03:49