cesium-unreal icon indicating copy to clipboard operation
cesium-unreal copied to clipboard

Investigate options for globe gravity

Open kring opened this issue 4 years ago • 4 comments

UE's gravity points in the -Z direction. It might be possible to change this, but even so it will point in just one direction. But on Earth, the direction of gravity is different depending on where on the globe you're located. Can we simulate this in UE?

Some starting points:

  • A custom gravity example: https://www.ue4resources.com/plugins
  • A thread about adjusting gravity direction: https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1702500-is-there-still-no-simple-solution-for-adjusting-gravity-direction
  • PhysX documentation talks about radial gravity: https://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/RigidBodyDynamics.html#gravity

kring avatar Dec 08 '20 11:12 kring

As suggested in the PhysX documentation, maybe we could disable gravity and apply an independently calculated psuedo-gravity force to the center of mass for each object. If a cartesian coordinate is readily available for the object with respect to the center of the earth, perhaps the pseudo-gravity vector direction could point from the object coordinate towards the origin; so something like gravity = 9.8 * normalize(-obj.pos).

I am curious / worried about the numerical stability of this approach, resting behavior at the surface, as well as how dependable cartesian coordinates for objects are that are far away from the player.

nithinp7 avatar Dec 10 '20 16:12 nithinp7

@nithinp7 There are a number of examples of how to do this on the Unreal Engine Marketplace. So the answer to "can we simulate this" is most definitely yes. You can check out the existing implementations if you want to see how stable various approaches to this are.

Free examples of implementing alternative "gravity" force vectors. (There are also more paid ones on the marketplace)

  • https://github.com/mhousse1247/UE4-CustomGravityPlugin
  • https://www.unrealengine.com/marketplace/en-US/product/directional-planet-gravity
  • https://www.unrealengine.com/marketplace/en-US/product/character-dynamic-gravity

techdragon avatar Apr 11 '21 06:04 techdragon

Is this still potentially being worked on or is the advice just to run a custom solution as @techdragon mentioned?

darcyvdd avatar Mar 04 '24 06:03 darcyvdd

We are not currently working on it.

kring avatar Mar 04 '24 06:03 kring