This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
en:orx:reference:math:snippets [2018/01/19 08:38 (8 years ago)] – [OrxOBox] 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 | ||
- | |||
- | Moved to [[examples: | ||
- | |||
- | ===== OrxOBox ===== | ||
- | |||
- | Function to return an object within a boxed area: | ||
- | |||
- | Moved to: [[examples: | ||
- | |||
- | |||
- | ===== 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: | ||
- | |||
- | {{section> | ||
- | |||