Godot-Voxel-Destruction
Allows dynamic voxel destruction with debris along with other voxel features. Allows importing .vox files and damaging…
Simple but physical engine for voxels. Demo:
git clone https://github.com/fenomas/voxel-physics-engine.gitfenomas/voxel-physics-engineAbstracted terrain physics for voxel game engines.
This implements reasonably realistic physics for voxel games. It was made to work with noa or voxel.js, but all it requires is abstracted (x,y,z) => boolean test functions for voxel properties, so it can be used with any engine.
This library replaces voxel-physical, though it works quite differently and behaves more physically. The engine can be seen in action in noa or projects using it.
Note: this simple engine only handles collisions between bodies and solid voxels. It does not handle collisions between rigid bodies, or non-cubic voxels.
(x,y,z) => boolean functions that return whether a given voxel is solid or liquid.var body = addBody(..)tick(dt) on the engine objectand the engine will update each body and handle voxel collisions.
import { Physics } from 'voxel-physics-engine'
var opts = { gravity: [0, -10, 0] }
var voxelIsSolid = (x, y, z) => (y < 0)
var voxelIsLiquid = (x, y, z) => (x > 5)
var phys = new Physics(opts, voxelIsSolid, voxelIsLiquid)
var body = phys.addBody( aabb, mass, friction, restitution, gravityMult, onCollide )
phys.tick( dt_in_miliseconds )
phys.removeBody( body )
resting[axis] property (-1,0,1 on each axis) to tell if it's currently touching a solid voxel.
E.g. body.resting[1] is 1 when the body is colliding with the ceiling.onCollide(impacts) callback.
The argument is a vec3 of the collision impulse on each axis.
(A body resting on the ground will produce a small impact each tick due to gravity.)autoStep property, the engine will cause it to
automatically "step" onto one-block obstructions.0.13.0 - minor fixes to typing and internals0.11.0 - export a named constructor function instead of a callback0.10.0
body.onCollide arg to be a correctly scaled impulse vectoronCollide now passed before bounces are resolved (allowing client to adjust body.restitution depending on the terrain)0.9.0
airDrag and fluidDrag, and now work equivalently (no drag at 0, large drag at 1)airDrag and fluidDrag override global settings if >= 00.8.0
.airFriction that overrides the global value (if nonzero)more like this
Allows dynamic voxel destruction with debris along with other voxel features. Allows importing .vox files and damaging…
Soft2D: A 2D multi-material continuum physics engine designed for real-time applications.
Voxel.Wiki is a website that is all about voxels: Values on regular grids in three-dimensional space!
search projects, people, and tags