Docs / API / Modules / math
Math
Platform @s2script/sdk/math
Vector and QAngle value types plus helpers like forwardVector.
3 exports
Import
import { Vector } from "@s2script/sdk/math";
Author-time types ship in the npm package; the engine injects the runtime at plugin load.
Add @s2script/sdk to your plugin's dependencies.
API reference
Generated from the shipped type definitions.
A 3-component vector value (a copied snapshot; never a live pointer).
import { Vector } from "@s2script/sdk/math";
const start = new Vector(0, 0, 100);
console.log(start.length());
A Source 2 Euler angle value (x=pitch, y=yaw, z=roll), a copied snapshot.
fn forwardVector(a: QAngle): Vector
The unit forward-direction vector for a Euler angle (pitch=a.x, yaw=a.y; ignores roll).