Fastest Physics Models?
jchmack
09-01-2007 15:58:55
Im trying to make a bullet curtain type shooter. Think Gradius/1942 Series (or ikaruga/espgaluda for those who keep up with the genre). Im planning to have alot of projectiles. I mean ALOT of them. Those who have seen Espgaluda/Ikaruga Know what i mean.
How would you guys recommend i model these projectiles. They just need to be points that can collide with the other objects. I just need them to be fast because of the sheer number that will be on the screen.
Im thinking of modeling them as particles but i have no idea on how they work or if they are applicable to my need. I can't find any documentation or tutorials on the NxOgre Particle system. I still havent switched to RC3 because im still using Dagon. Im planning to switch to both eihort and RC3 when eihort is finished. I hope its soon.
But anyways How should i do this?
betajaen
09-01-2007 16:55:55
I would use a mixture of Actors with CCD and Raycasting.
Raycasting for: Bullets, and high velocity "mass-less" projectiles
CCD for: Grenades, mass projectiles,etc. Doubling up with intersections to make sure collisions are happening properly.
I'd also make use of FXScenes for this, perhaps using a PPU card to put the projectile simulation on it, or at least have them run in a different thread, with different iterations and at a fixed time step.
jchmack
09-01-2007 17:48:43
I would use a mixture of Actors with CCD and Raycasting.
Raycasting for: Bullets, and high velocity "mass-less" projectiles
CCD for: Grenades, mass projectiles,etc. Doubling up with intersections to make sure collisions are happening properly.
I'd also make use of FXScenes for this, perhaps using a PPU card to put the projectile simulation on it, or at least have them run in a different thread, with different iterations and at a fixed time step.
Im not familiar with CCD but as for raycasting most of the actors are not going to be high velocity so thats out of the question. Any links on what CCD is? google doesnt help much with acronyms.
Im thinking of modeling them as small cubes then. Cubes to reduce the number of verts PhysX has to think of.
But about FXScenes... It looks great for somone with a PPU Card or a multi core processor, but I have neither. I have a p4 w/hyperthreading will this really affect me?
Nudel
09-01-2007 17:56:44
CCD means continuous collision detection. Youll find quite a lot of sites with the fully written name.
jchmack
09-01-2007 18:05:08
CCD means continuous collision detection. Youll find quite a lot of sites with the fully written name.
Thx a ton just what i was looking for
.
I guess this is why some of my objects will pass through each other at high speeds. But it seems as long as i keep my speeds low they work fine. Or is there a way i can improve this? On the PhysX support site they refer to tutorial 119 to turn on CCD.
But as for NXOgre Actors im assuming the cube is the simplest for the engine to handle. Right?
Nudel
09-01-2007 19:21:01
Or is there a way i can improve this?
NewtonSDK has the option to change the frame rate of the physical environment. From 60fps(i.e. 60 updates of the environment per second, fine for most purposes) up to 600(much slower but way more accurate).
Im pretty sure physx and nxogre got that too. Search for timing functions.
betajaen
09-01-2007 19:32:02
mScene->setTiming(scene::FIXED, 1.0f / 60.0f, 8);
jchmack
09-01-2007 19:35:34
I guess what im trying to ask is what basic actor shape(box sphere capsule) would be easiest(on physx) to have in large quantities.
betajaen
09-01-2007 19:45:30
I believe sphere is the most easiest and fastest, you should turn up the angular and linear sleeping so the projectiles don't move around once they fall or hit.
jchmack
09-01-2007 19:53:13
I believe sphere is the most easiest and fastest, you should turn up the angular and linear sleeping so the projectiles don't move around once they fall or hit.
thx as always. For some reason i thought spheres had alot of verts because of the curves but i guess PhysX models them like true spheres rather than a polygon sphere.
Also I dont really need these objecst to collide with each other and it would probably save alot of processing power if i were to keep this from being calculated. Is it possible to tell these "projectile objects" to only collide with objects other than each other?
As of now my projectiles are cubes. (ill switch to spheres in a second) Although it looks nice its not too nice on my processor.
On a sidenote PhysX must be awesome because im still getting pretty nice framerates with this many little cubes.
betajaen
09-01-2007 21:08:07
PhysX is always awesome.
It uses simple radius calculation than vertices, it's a lot faster and neater in code, well I'm guessing, that's what I did in Cake.
You can move those spheres/cubes into separate groups, or into the FXScene idea.
jchmack
10-01-2007 12:36:34
Is there not a way to set the velocity of a body? As of now im adding an initial force for my projectiles when they are created. But These forces are going to be extremely large if my projectiles get any bigger. Not to mention it would be easier to do this rather than guessing and testing to get the desired velocity.
betajaen
10-01-2007 13:15:11
Yep;
Via the body helper:
myCube->setLinearVeloctiy(<direction>, <force>);
Or through the Actor:
myCube->mActor->setLinearVelocity(NxTools::convert(<force and direction>));
Tell me, does Intellisense not work on your computer?
jchmack
10-01-2007 13:27:09
Yep;
Via the body helper:
myCube->setLinearVeloctiy(<direction>, <force>);
Or through the Actor:
myCube->mActor->setLinearVelocity(NxTools::convert(<force and direction>));
Tell me, does Intellisense not work on your computer?
it does but i was looking for it in the body class not the actor. Thx again.
betajaen
10-01-2007 13:28:28
I'd use the body method than the actors. It's more controllable and it works out the formula (force and direction to vector) for you.
jchmack
10-01-2007 13:38:16
I'd use the body method than the actors. It's more controllable and it works out the formula (force and direction to vector) for you.
Intellisense is not showing it for me in the body only in the actor.
edit: but i tried it and it works...