kpreid / all-is-cubes

Yet another block/voxel game; in this one the blocks are made out of blocks. Runs in browsers on WebGL+WebAssembly.
https://kpreid.dreamwidth.org/tag/all+is+cubes
Apache License 2.0
167 stars 8 forks source link

Implement physics bodies known to `Space`s #301

Open kpreid opened 2 years ago

kpreid commented 2 years ago

Right now, the relationship between Character and its Space is one-directional: the Character defines a camera-position which is, by its own efforts, affected by gravity and collision with the Space.

Instead, the Space should have Behaviors which are attached physics bodies and optionally linked to Characters. This will enable:

The reason that these should be space Behaviors and not their own kind of thing is because Behaviors should in general be able to “occupy” certain regions of space and influence what happens in them. (On the other hand, we could also have a world where a Space contains Bodys in the same way it contains Blocks, and the Bodys can have Behaviors themselves.)

kpreid commented 1 year ago

Behaviors should in general be able to “occupy” certain regions of space and influence what happens in them.

This is now implemented; the "attachment" field stores a bounding box. No progress yet on making bodies into behaviors.