mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-21 18:09:46 +00:00
use double precision for particles, emitters and 3D texts
Positions of particles, of static emitters and of text notes are worldvec3. gfx.particles, gfx.text3d, gfx.blockwraps, pathfinding and generation.create_fragment read positions from Lua as doubles: a float can not hold an odd block coordinate above 16.7M, the object went to a neighbour block.
This commit is contained in:
parent
cb39ed464a
commit
d012f0530b
14 changed files with 44 additions and 43 deletions
|
|
@ -52,7 +52,7 @@ voxel& Chunks::require(int32_t x, int32_t y, int32_t z) const {
|
|||
return blocks_agent::require(*this, x, y, z);
|
||||
}
|
||||
|
||||
const AABB* Chunks::isObstacleAt(float x, float y, float z) const {
|
||||
const AABB* Chunks::isObstacleAt(double x, double y, double z) const {
|
||||
int ix = std::floor(x);
|
||||
int iy = std::floor(y);
|
||||
int iz = std::floor(z);
|
||||
|
|
|
|||
|
|
@ -123,9 +123,9 @@ public:
|
|||
const worldvec3& start, const glm::vec3& dir, float maxDist
|
||||
) const;
|
||||
|
||||
const AABB* isObstacleAt(float x, float y, float z) const;
|
||||
const AABB* isObstacleAt(double x, double y, double z) const;
|
||||
|
||||
const AABB* isObstacleAt(const glm::vec3& pos) const {
|
||||
const AABB* isObstacleAt(const worldvec3& pos) const {
|
||||
return isObstacleAt(pos.x, pos.y, pos.z);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue