all-is-cubes icon indicating copy to clipboard operation
all-is-cubes copied to clipboard

Implement physics bodies known to `Space`s

Open kpreid opened this issue 3 years ago • 1 comments

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:

  • Space's block manipulations being affected by the presence of characters (as obstacles or otherwise).
  • Objects, like moving dropped items, which are purely subordinate to the Space.
  • Rendering characters that aren't the player (NPCs or multiplayer PCs).
  • Particle systems that collide with the world. (I'm thinking that dropped items and particle systems might be very closely related things.)

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 avatar Oct 17 '22 04:10 kpreid

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.

kpreid avatar Dec 30 '22 06:12 kpreid