MCPcopy Create free account
hub / github.com/esengine/esengine / nextDirection2D

Method nextDirection2D

packages/procgen/src/random/SeededRandom.ts:177–183  ·  view source on GitHub ↗

* @zh 生成随机方向向量 * @en Generate random direction vector

()

Source from the content-addressed store, hash-verified

175 * @en Generate random direction vector
176 */
177 nextDirection2D(): { x: number; y: number } {
178 const theta = this.next() * 2 * Math.PI;
179 return {
180 x: Math.cos(theta),
181 y: Math.sin(theta)
182 };
183 }
184}
185
186/**

Callers

nothing calls this directly

Calls 1

nextMethod · 0.95

Tested by

no test coverage detected