This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:orx:reference:math:snippets [2013/10/28 00:07 (12 years ago)] – OrxMath code snippet sausage | en:orx:reference:math:snippets [2018/01/19 08:45 (8 years ago)] (current) – Moved to examples. Deleted. sausage | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== 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 ===== | ||
- | |||
- | |||
- | {{section> | ||
- | |||