User Tools

Site Tools


en:orx:reference:math:snippets

This is an old revision of the document!


Math: Code Snippets

OrxAABox

OrxMath

Convert an angle in degrees to a directional vector

Moved to Convert an angle in degrees to a directional vector

OrxOBox

Function to return an object within a boxed area:

Moved to: Return an Object within a boxed area

OrxVector

Some ways to initialise an empty orxVECTOR.

Avoid this:

  orxVECTOR position;

Rather, do one of these:

  orxVECTOR position = {0, 0, 0};
  orxVECTOR position = orxVECTOR_0;
  orxVECTOR position;
  position.fX = 0;
  position.fY = 0;
  position.fZ = 0;

Uninitialised orxVECTORs can create unintended consequences in your game.

You can also do:

en/orx/reference/math/snippets.1516351081.txt.gz ยท Last modified: 2025/09/30 17:26 (13 days ago) (external edit)