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

@carbonenginejs/core-math

v0.1.5

Published

Browser-friendly gl-matrix based math containers and CarbonEngineJS mesh/tangent helpers.

Readme

@carbonenginejs/core-math

Browser-friendly gl-matrix based math containers for CarbonEngineJS packages. The package exposes small parent containers such as num, vec3, mat4, mesh, and tangent, and also supports subpath imports so callers do not need to import the full math surface.

CarbonEngine and Fenris Creations (CCP Games) are named for provenance and interoperability context. This package contains no CarbonEngine or Fenris Creations (CCP Games) source code, shader source, proprietary documentation, tools, or assets.

Package

Install

npm install @carbonenginejs/core-math

Public API

Prefer direct subpath imports when a package only needs a few math methods:

import { cross, normalize } from "@carbonenginejs/core-math/vec3";

const out = [0, 0, 0];
cross(out, edgeA, edgeB);
normalize(out, out);

Subpaths can also be imported as module namespaces:

import * as vec3 from "@carbonenginejs/core-math/vec3";

vec3.cross(out, edgeA, edgeB);
vec3.normalize(out, out);

Existing container exports remain available from subpaths while callers migrate:

import { vec3 } from "@carbonenginejs/core-math/vec3";
import { mesh } from "@carbonenginejs/core-math/mesh";
import { tangent } from "@carbonenginejs/core-math/tangent";

vec3.cross(out, edgeA, edgeB);
const n = mesh.generateNormals(positions, indices);
const t = mesh.generateTangents(positions, n, uvs, indices);
const b = mesh.generateBiNormals(n, t);
const packed = tangent.packTangentFrames(n, t, b);

Use root imports when several namespaces are needed:

import { num, vec3, mat4, mesh, tangent } from "@carbonenginejs/core-math";

num.clamp(value, 0, 1);
vec3.cross(out, a, b);
vec3.normalize(out, out);
mat4.identity(world);
const packed = tangent.packTangentFrames(normals, tangents, binormals);

vertex is a legacy compatibility container backed by the shared mesh/tangent helpers. Its tangent generation intentionally does not preserve the older ccpwgl vertex.js implementation.

Containers

  • num: scalar helpers and color/angle conversion helpers.
  • vec2, vec3, vec4, quat, mat3, mat4: gl-matrix containers with CarbonEngineJS additions.
  • box3, tri3, lne3, pln, ray3, sph3: spatial helper containers.
  • pool: typed-array buffer pool helper.
  • noise, curve: extracted ccpwgl math helpers.
  • mesh: shared mesh rebuild helpers used by format packages.
  • tangent: CarbonEngineJS/GR2 packed tangent-frame helpers.
  • vertex: compatibility names for mesh/tangent generation.
  • geometry: extracted procedural geometry helpers.

Browser Rules

Runtime source is plain ESM and must not depend on Node built-ins, filesystem helpers, CLI tools, webpack aliases, or ccpwgl application globals. Tests may run in Node, but package code must remain browser-safe.

Tests

npm test

Tests are self-contained and do not require local asset folders, network access, or game files.

License

MIT (see LICENSE, NOTICE, and THIRD-PARTY-NOTICES.md).