Fixes, README

master
Evert 2018-03-20 20:43:19 +02:00
parent 62465fd158
commit 95e56352cf
No known key found for this signature in database
GPG Key ID: 1688DA83D222D0B5
3 changed files with 32 additions and 7 deletions

View File

@ -1,3 +1,29 @@
Diamondtest
===========
This repository is a port of [spheretest](https://github.com/Jeija/spheretest) by [Jeija](https://github.com/Jeija) to the latest version of Minetest. There are bugs, help wanted!!
Original **`README`**:
In order to compile spheretest for your platform, follow the minetest-specific instructions below.
I also recommend you to get `minetest_game` and your favorite mods for the standard minetest experience.
Then, create a file `minetest.conf` and add the following lines to it:
```
planet_enable = true
planet_radius = 2
planet_keep_scale = true
planet_centrifugal_enable = true
planet_realistic_gravity = true
movement_gravity = 10
enable_clouds = 0
active_block_range = 4
active_object_send_range_blocks = 4
viewing_range = 400
```
You can tweak these settings and see how they affect the planet's appearance and behaviour.
In the game, create a new world with Mapgen "flat". The planet edges are very glitchy, so anything other than "flat" won't look good.
Keep in mind that this is only a technical demo and not intended to be a full-featured game.
Minetest
========

View File

@ -178,7 +178,6 @@ void ClientEnvironment::step(float dtime)
// the height will actually be the magnitude of the complex exponential function
if (g_settings->getBool("planet_keep_scale"))
height = planet_radius * exp(lplayer->getPosition().Y / planet_radius);
float blockwidth = height / planet_radius;
if (g_settings->getBool("planet_enable") && g_settings->getBool("planet_realistic_gravity")) {
if (lplayer->getPosition().Y < 0)
@ -187,13 +186,13 @@ void ClientEnvironment::step(float dtime)
gravity_coeff = (planet_radius * planet_radius) / (height * height);
}
if(lplayer->in_liquid == false)
if(lplayer->in_liquid == false)
speed.Y -= gravity_coeff * lplayer->movement_gravity * lplayer->physics_override_gravity * dtime_part * 2;
// Planet: Apply centrifugal force
// a_z = v^2 / height with v = (horizontal speed) * (block width at that height)
if (g_settings->getBool("planet_enable") && g_settings->getBool("planet_centrifugal_enable") && lplayer->in_liquid == false)
speed.Y += (speed.X * speed.X + speed.Z * speed.Z) * blockwidth * blockwidth / height * dtime_part * 2;
speed.Y += (speed.X * speed.X + speed.Z * speed.Z) / height * dtime_part * 2;
// Liquid floating / sinking
if(lplayer->in_liquid && !lplayer->swimming_vertical)

View File

@ -274,10 +274,10 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
int planet_circumference = ceil(g_settings->getU16("planet_radius") * M_PI) * 2 * MAP_BLOCKSIZE;
v3s16 p;
for (p.X = min.X; p.X <= max.X; p.X++)
for (p.Y = min.Y; p.Y <= max.Y; p.Y++)
for (p.Z = min.Z; p.Z <= max.Z; p.Z++) {
for (s16 x = min.X; x <= max.X; x++)
for (s16 y = min.Y; y <= max.Y; y++)
for (s16 z = min.Z; z <= max.Z; z++) {
v3s16 p(x,y,z);
if (g_settings->getBool("planet_enable")) {
if (p.X >= planet_circumference / 2) p.X -= planet_circumference;
if (p.Z >= planet_circumference / 2) p.Z -= planet_circumference;