Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

27. May 2012, 12:18:44 am
Xith3D CommunityGeneral CategoryFeature Requests & Brilliant Ideas (Moderators: Marvin Fröhlich, 'n ddrylliog)XPAL: Gravity
Pages: [1]
Print
Author Topic: XPAL: Gravity  (Read 2040 times)
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« on: 25. August 2007, 09:28:55 pm »

I don't know, if it's already possible. But I could use gravity in XPAL to make the FPIH behave like a human. Gravity is needed to make jumping and falling work with the FPIH.

If it's already possible with XPAL, then how. And if it's not, is it hard to implement, Amos?

Marvin
Logged
hawkwind
Getting respectable
***
Offline Offline

Posts: 363



View Profile Email
« Reply #1 on: 26. August 2007, 03:04:19 am »

Needs to be configurable, at least on / off.  There are times I would like gravity and times the endless collisions with the floor would be a performance hit
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #2 on: 26. August 2007, 02:35:21 pm »

"That I'm on it".

That was that, Marvin ?  Cheesy

OK, more seriously I'm looking for a simple way to abstract "forces".

Should a "force" be represented as a class which is in fact a step listener, and which computes the force magnitude and direction each step, from various parameters ? Is that alright for you ?

(For those not seeing the connection with the gravity, yes the gravity is a force. Well, several, but one's sufficient for what we're doing.)
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #3 on: 26. August 2007, 02:43:17 pm »

Should a "force" be represented as a class which is in fact a step listener, and which computes the force magnitude and direction each step, from various parameters ? Is that alright for you ?

Well, if that's necessary...

My naive imagination of a solution was to just use some kind of setGravity() method and use an instance of "Gravity" (with an optional constructor parameter of 9.81f) to the SimulationEngine. All Collideables, that have a Body attached would then be influenced by that gravity force.

More general forces could be for a later time (as you say).

I don't know, if it makes sense to limit the gravity influence to a subset of the bodies in the SimulationEngine. I guess, it wouldn't, since if you want to have regions with differing gravity, you would simply use another instance of SimulationEngine or set the Gravity instance to something different.

Marvin
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #4 on: 26. August 2007, 03:11:53 pm »

Yeah, that could be easily implemented.

All Collideables, that have a Body attached would then be influenced by that gravity force.
Actually, it's the other way round. Bodies have attached Collideables.
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #5 on: 26. August 2007, 03:13:08 pm »

Yeah, that could be easily implemented.

All Collideables, that have a Body attached would then be influenced by that gravity force.
Actually, it's the other way round. Bodies have attached Collideables.

But my solution should work anyway, shouldn't it?
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #6 on: 26. August 2007, 03:39:37 pm »

Better : it will. No, it is. Check your SVN. ^^

You can look at the org.xith3d.physics.PhysicRotation example.

Enjoy !
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic