Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
ChompChainSupport.inc.c File Reference

Go to the source code of this file.

Macros

#define NUM_CHAIN_LINKS   (1 + CHOMP_CHAIN_LAST_PART_IDX - CHOMP_CHAIN_FIRST_PART_IDX)
 

Functions

void N ChompChainAddPolarPos (ChompChain *script, f32 magnitude, f32 angleDeg)
 
void N ChompChainGetPolarX (f32 *x, f32 magnitude, f32 angleDeg)
 

Macro Definition Documentation

◆ NUM_CHAIN_LINKS

#define NUM_CHAIN_LINKS   (1 + CHOMP_CHAIN_LAST_PART_IDX - CHOMP_CHAIN_FIRST_PART_IDX)

Definition at line 29 of file ChompChainSupport.inc.c.

Function Documentation

◆ ChompChainAddPolarPos()

void N ChompChainAddPolarPos ( ChompChain * script,
f32 magnitude,
f32 angleDeg )

Definition at line 65 of file ChompChainSupport.inc.c.

65 {
66 f32 angle = DEG_TO_RAD(angleDeg);
67 f32 dirX = sin_rad(angle);
68 f32 dirY = cos_rad(angle);
69
70 script->curPos.x += -magnitude * dirX;
71 script->curPos.y += magnitude * dirY;
72}
f32 cos_rad(f32 x)
Definition 43F0.c:717
f32 sin_rad(f32 x)
Definition 43F0.c:713
#define DEG_TO_RAD(deg)
Definition macros.h:134

◆ ChompChainGetPolarX()

void N ChompChainGetPolarX ( f32 * x,
f32 magnitude,
f32 angleDeg )

Definition at line 74 of file ChompChainSupport.inc.c.

74 {
75 f32 angle = DEG_TO_RAD(angleDeg);
76 f32 dirX = sin_rad(angle);
77 f32 dirY = cos_rad(angle);
78
79 *x = magnitude * dirY;
80}