Planet gravity using Ageia
Planet gravity using Ageia
Does anyone know the best way of doing this using PhysX? I cant seem to find any examples.
Many thanks.
Many thanks.
what on earth do you mean by planet gravity?
something for a space game where you want objects to gravitate towards an object such as a planet?
i don't think ageia supports objects having gravity so you'd have to set it up yourself.
it's not too hard though. there's an example which shows you how to do explosions, which is objects being pushed away from the centre of an explosion, all you need to do is the opposite, drag objects towards the centre of your planet object. So basically just copy the explosion example but instead of pushing things out drag them in with the opposite force which the explosion uses.
something for a space game where you want objects to gravitate towards an object such as a planet?
i don't think ageia supports objects having gravity so you'd have to set it up yourself.
it's not too hard though. there's an example which shows you how to do explosions, which is objects being pushed away from the centre of an explosion, all you need to do is the opposite, drag objects towards the centre of your planet object. So basically just copy the explosion example but instead of pushing things out drag them in with the opposite force which the explosion uses.
LOL Sorry it was written very quickly, so it sounded childishJP wrote:what on earth do you mean by planet gravity?
something for a space game where you want objects to gravitate towards an object such as a planet?
i don't think ageia supports objects having gravity so you'd have to set it up yourself.
it's not too hard though. there's an example which shows you how to do explosions, which is objects being pushed away from the centre of an explosion, all you need to do is the opposite, drag objects towards the centre of your planet object. So basically just copy the explosion example but instead of pushing things out drag them in with the opposite force which the explosion uses.
Yeah funny you should say that, I started playing with that very idea, see how it goes
Thanks.
No I'm setting up interstellar gravity wells, as in a whole system of planets. I've done this before with an algorythm, but I couldn't get the orbits correct, they were always elliptical, is in only the far out bodies are elliptical, Earth and it's moon are pretty much round, just wondering if using a physics engine will help, probably not.Mirror wrote:if you want planetary gravity depending on where the player is ON the planet, just use as the gravity factor in the collision function, the player's position normalized ( assuming the center is at 0,0,0 ).
-
Dark_Kilauea
- Posts: 368
- Joined: Tue Aug 21, 2007 1:43 am
- Location: The Middle of Nowhere
Excellent! So does this method have gradual increasing gravity? As in as you get closer the gravity increases, well actually, is that something to do with velocity? I might be confusing the two.JP wrote:Incidentally i did something very similar in my game with Physx the other day. I'm working on a boss which can suck you towards him, which is obviously the same as gravity and i got it working exactly the way i described above, by copying the explosion example and inverting the force.
-
night_hawk
- Posts: 153
- Joined: Mon Mar 03, 2008 8:42 am
- Location: Suceava - Romania
- Contact:
A simpler way (similar to the Explosion demo, but without copy-pasting it) would be to get the relative position of each node to your planet (node.position - planet.position), invert it (planet.position - node.position
), maybe normalize it and use it as a force added to that node. That seems like cheap and easy, no?
-
night_hawk
- Posts: 153
- Joined: Mon Mar 03, 2008 8:42 am
- Location: Suceava - Romania
- Contact:
