xmath-usage

Community

Zero-allocation math for Defold performance.

Authorselimanac
Version1.0.0
Installs0

System Documentation

What problem does it solve?

In Lua-based Defold projects, hot-path math frequently allocates objects, triggering GC pauses. xmath enables in-place mutation and reuses pre-allocated scratch variables, eliminating per-frame allocations and reducing GC pressure.

Core Features & Use Cases

  • In-place mutation: all xmath operations write results into the first argument, enabling scratch buffers to be reused across frames.
  • Pre-allocated scratch variables: store transient vectors/quaternions at module scope or init to avoid per-frame allocations.
  • Type support: xmath handles vector3, vector4, and quaternion operations with a consistent first-argument output convention.
  • Integration pattern: pair xmath with vmath to initialize scratch objects, then apply a sequence of operations to compute final results.
  • Use cases: physics nudges, animation tweaks, and other hot-path math in gameplay loops.

Quick Start

Pre-allocate scratch buffers and rewrite hot math paths to mutate outputs in place using xmath.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: xmath-usage
Download link: https://github.com/selimanac/defold-daabbcc3d/archive/main.zip#xmath-usage

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 510,000+ vetted skills library on demand.