npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

voxel-chunks

v0.0.2

Published

detached voxel chunk geometries with independent matrix translations

Readme

voxel-chunks

detached voxel chunk geometry with independent matrix transforms on each chunk matrix collection

example

See the voxel-servo example for a more concrete use of this module.

methods

var voxelChunks = require('voxel-chunks')

var group = voxelChunks(game)

Given a voxel-engine game instance, return a new voxel chunk group. The chunk matricies in each group have their own matricies to independently transform their chunks.

group.createBlock(pos, val)

Create a block at world coordinates (pos.x, pos.y, pos.z) in the pos.direction direction from the existing block.

pos.chunkMatrix should be the chunk matrix instance to use to set the block to val, a block value integer.

group.setBlock(pos, val)

Set a block value to val at the woord coordinates (pos.x, pos.y, pos.z).

pos.chunkMatrix should be the chunk matrix instance to use

group.getBlock(pos)

Get the block at the world coordinates (pos.x, pos.y, pos.z) in the chunk matrix instance pos.chunkMatrix.

var ix = group.getIndex(pos)

Return an object with the chunk index ix.chunk and the voxel index ix.voxel at the world coordinates pos.

var cm = group.create(generate)

Create a new detached chunk matrix geometry to transform a collection of chunks.

The optional generate(x,y,z) function is used to generate blocks in the chunk as necessary. It defaults to return 0 (empty space).

cm.setBlock(pos, value)

Set the block at the chunk-local coordinates pos to value.

cm.getBlock(pos)

Get the block at the chunk-local coordinates pos.

attributes

group.meshes

An array of all the active chunk surface meshes in the scene. This array updates every time an 'add' or 'remove' event occurs.

This array is useful for computing ray intersections with blocks in the scene.

cm.rotation

chunk matrix rotation reference to the underlying rotation matrix

cm.position

chunk matrix position reference to the underlying translation matrix

events

cm.on('add', function (surface) {})

Emitted when a chunk mesh gets computed.

cm.on('remove', function (surface) {})

Emitted when a chunk mesh gets recomputed and the old surface mesh is no longer active.

install

With npm do:

npm install voxel-chunks

license

MIT