+glm::vec3 Chunk::GravityAt(const ExactLocation &coords) const noexcept {
+ glm::vec3 grav;
+ for (int index : gravity) {
+ RoughLocation::Fine block_pos(ToPos(index));
+ ExactLocation block_coords(position, ToCoords(block_pos));
+ // trust that block type hasn't changed
+ grav += Type(index).gravity->GetGravity(
+ coords.Difference(block_coords).Absolute(),
+ ToTransform(block_pos, index));
+ }
+ return grav;
+}
+
+