max-mapper / voxel-engine

3D HTML5 voxel game engine
http://maxogden.github.com/voxel-engine
BSD 3-Clause "New" or "Revised" License
1.29k stars 220 forks source link

Large positions cause strange behavior, glitchly camera, falling through blocks, no rendering. #122

Closed mikkailmontgomery closed 8 years ago

mikkailmontgomery commented 8 years ago

Take the code below, it will function fine. However, if you were to change "largenumber" to -12345678 then dude falls through the world, or if you move while falling, and happen to not fall through the world, camera movement/movement in general is strange. if you change "largenumber" to -123456789 the world does not render at all.

var largenumber = -1234567 var createGame = require('voxel-engine') var game = createGame({ textures : './textures/', materials: [['grass', 'dirt', 'grass_dirt'], 'brick', 'dirt'], materialFlatColor: false, generate: function(x, y, z) { return y === 1 ? 1 : 0 }, worldOrigin: [largenumber, 0, 0], container : document.querySelector('#container') }) game.appendTo(container) game.createBlock([largenumber, 10, 0], 2) var createplayer = require('voxel-player')(game) var dude = createplayer() dude.possess() dude.yaw.position.set(largenumber, 100, 0)

deathcap commented 8 years ago

Same as https://github.com/maxogden/voxel-engine/issues/67 Camera is shaky when player coordinates are large?

mikkailmontgomery commented 8 years ago

Yes, I'm sorry, not sure how I missed that, I had looked through the list of open issues. Guess I shoulda looked closer, thanks. I'll close this as its a dup.