Simplistic physics implementation in Minetest.

ABJ
Member
 
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.
GitHub: ABJ-MV
In-game: ABJ

Simplistic physics implementation in Minetest.

by ABJ » Sat Jul 08, 2017 16:57

Hi developers.
First of all, I'd like to say that I appreciate your immense work.
I wrote this because I just had the idea of quick physics system we could implement in Minetest.

Each node has 12 values. They are:-
-ma
-fx
-fy
-fz
-vx
-vy
-vz
-ax
-ay
-az
-at
-cp

-ma is the mass.
-fx, fy, and fz is the force applied on a node. By default, 0, 0, and 0. respectively.
fx = ax - vx
fy = ay - vy
fz = az - vz
-vx, vy, and vz define velocity in x, y, and z directions, respectively. By default 0, 0, and 0, respectively. Unit is m/s
vx = ax + vx
vy = ay + vy
vz = az + vz
-ax, ay, and az define acceleration x, y, and z directions, respectively. By default, 0, 9.81, 0, respectively. Unit is m/(s*s)
ax = fx / ma
ay = fy / ma
az = fz / ma
at is the attraction between nodes of the same type. Each block has force fields that extend into the 26 adjacent nodes near it. If the difference in velocities in the directions the field acts on are less than at, they both attract, with their velocities in those directions being divided by 4 and added to all 4 directions, with some velocities canceling out and others not, thus allowing rotation. I highly recommend you add a face rotate feature too, thus allowing for vehicles and the like. For things like dirt, sand, water. lava, gravel, etc, this can be 0. For things like steel, wood. etc, this must be high.
-ca is the pressure at which the node is destroyed. It is the sum of all forces applied on a node. Make high for strong materials, low for weak materials.

Feel free to point out mistakes and suggest improvements.
Developers, please give it a thought.
Last edited by ABJ on Sat Jul 08, 2017 17:51, edited 1 time in total.
 

User avatar
sorcerykid
Member
 
Posts: 1061
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
GitHub: sorcerykid
In-game: Nemo

Re: Simplistic physics implementation in Minetest.

by sorcerykid » Sat Jul 08, 2017 17:49

Interesting idea. I'm a bit confused, however, but your terminology. When you say "block", I presume you mean a mapblock (16x16x16 nodes cubic area)? Also how are nodes affected by velocity or acceleration when they are incapable of motion?
 

ABJ
Member
 
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.
GitHub: ABJ-MV
In-game: ABJ
 


Return to Feature Discussion



Who is online

Users browsing this forum: No registered users and 10 guests