reckfellENGINE

Game math: choose the right operation

Directions, coordinates, planes, smooth motion, randomness and paths: a task-based route.

On this page

Map the task to an operation

TaskUseGuide
Aim toward a targetTarget − origin; normalize when neededVectors
Test a side or project onto a planeA normal, Plane.DistanceTo, ProjectPlanes
Convert a local point to world spaceTransform × point, ToGlobal/ToLocalTransforms
Approach smoothly or move at a specified speedTime-weighted Lerp or MoveTowardInterpolation
Replay generation or resume a sequenceRandomNumberGenerator.Seed/StateRandom numbers
Follow a routeCurve2D, Path2D, PathFollow2DCurves and paths
Rotate a 3D object and understand parent scaleEntity3D, Basis, Quaternion3D transforms

Vector2/Vector3 hold numbers; you give them meaning: position, direction, velocity or normal. Position (10, 0) is a point; velocity (10, 0) is displacement per second. Sharing a type does not make these quantities interchangeable.

Reckfell conventions

Ordinary 2D uses X right and Y down. In 3D, Y points up and the standard forward direction is −Z. Rotation methods and Rotation use radians; RotationDegrees is for degrees. Vector3.One is not a unit direction: its length is √3.

An operation's operands must use matching spaces and units. Subtracting a player's local position from a target's world position does not produce a valid aim direction. Multiply speed by timestep once. Geometric plane projection does not replace a physics collision query.

Check understanding

Start with the example relevant to your task. Each specifies its root type, complete C# file and expected result. Images come from these examples on Windows 1.0.0, with RU/EN captions. Checks establish math conventions and engine object behavior, not physics simulation, performance or identical bits on every platform.

Compare floats with a tolerance appropriate to the task's scale. IsFinite rejects NaN/infinity but does not establish matrix invertibility or a unit normal. Check an operation's prerequisites before its result.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.