mirror of
https://github.com/zeldaret/tww.git
synced 2026-08-15 12:39:11 -04:00
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// Generated by dtk
|
||||
// Translation Unit: c_m2d_g_box.cpp
|
||||
//
|
||||
|
||||
#include "SSystem/SComponent/c_m2d_g_box.h"
|
||||
#include "MSL_C/math.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
/* 8024A0E0-8024A104 .text Set__8cM2dGBoxFR3cXyR3cXy */
|
||||
void cM2dGBox::Set(cXy& p0, cXy& p1) {
|
||||
mP0 = p0;
|
||||
mP1 = p1;
|
||||
}
|
||||
|
||||
/* 8024A104-8024A400 .text GetLen__8cM2dGBoxCFRC3cXy */
|
||||
f32 cM2dGBox::GetLen(const cXy& p) const {
|
||||
// inside the box
|
||||
if (p.x >= mP0.x && p.x <= mP1.x && p.y >= mP0.y && p.y <= mP1.y)
|
||||
return 0.0f;
|
||||
|
||||
// TODO: other checks
|
||||
|
||||
float distX = abs(mP0.x - p.x);
|
||||
float distY = abs(mP0.y - p.y);
|
||||
return distX < distY ? distX : distY;
|
||||
}
|
||||
Reference in New Issue
Block a user