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

orxFLOAT degRotation = 45;			
orxFLOAT radRotation = degRotation * orxMATH_KF_DEG_TO_RAD;

orxFLOAT x = orxMath_Cos(radRotation);
orxFLOAT y = orxMath_Sin(radRotation);
			
orxVECTOR directionVector = {x, y, 0};

OrxOBox

OrxOBox_2DIsInside

Example code :)

OrxVector

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