Skip to content

Commit 5f336d6

Browse files
committed
Merge pull request #87 from wraithan/readme-cleanup
cleaned up readme (spelling and example code)
2 parents b1b2d89 + baec25a commit 5f336d6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ shoots a ray and collides with voxels
162162

163163
`gameInstance.raycastVoxels(start, position, distance)`
164164

165-
if you just type `gameInstance.raycastVoxels()` it will default to using the current main camera position and direction, and default distance of 10, and epilson of `1e-8`
165+
if you just type `gameInstance.raycastVoxels()` it will default to using the current main camera position and direction, and default distance of 10, and epsilon of `1e-8`
166166

167167
you will get back an object with the precise position, voxel position, direction, face normal and voxel value of the voxel that you intersected, or `false` if there was no collision
168168

@@ -305,11 +305,11 @@ this should be generated by something like this:
305305
var length = 5, width = 5, depth = 5
306306
var start = [10, 10, 10]
307307
var voxels = new Int8Array(length * width * depth)
308-
var idx =
309-
for(var z = start[2]; z < depth[2]; ++z)
310-
for(var y = start[1]; y < height[1]; ++y)
311-
for(var x = start[0]; x < length[0]; ++x, ++idx) {
312-
voxels[idx] = getVoxelDataFor(x, y, z)
308+
var idx = 0
309+
for(var z = start[2]; z < depth; ++z)
310+
for(var y = start[1]; y < height; ++y)
311+
for(var x = start[0]; x < length; ++x, ++idx) {
312+
voxels[idx] = getVoxelDataFor(x+start[0], y+start[1], z+start[2])
313313
}
314314
return {voxels: voxels, dimensions: [length, width, height], position: start}
315315
```
@@ -336,7 +336,7 @@ var clearInterval = game.setInterval(function() {
336336
// later we can stop the interval by calling clearInterval()
337337
```
338338

339-
Will achieve the same thing although now when the game's frame rate drops the `jump()` funciton won't be called repeatedly and the object will jump at the desired frequency.
339+
Will achieve the same thing although now when the game's frame rate drops the `jump()` function won't be called repeatedly and the object will jump at the desired frequency.
340340

341341
## style guide
342342

0 commit comments

Comments
 (0)