CesiumGS / cesium-unreal

Bringing the 3D geospatial ecosystem to Unreal Engine
https://cesium.com/platform/cesium-for-unreal/
Apache License 2.0
956 stars 297 forks source link

Investigate options for globe gravity #101

Open kring opened 3 years ago

kring commented 3 years ago

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:

nithinp7 commented 3 years ago

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.

techdragon commented 3 years ago

@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)

darcyvdd commented 9 months ago

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

kring commented 9 months ago

We are not currently working on it.