omi-eikyo/src/m_math.c

27 lines
570 B
C
Raw Permalink Normal View History

2017-09-26 13:58:44 -07:00
// Copyright © 2017 Project Golan, all rights reserved.
2017-10-04 17:14:46 -07:00
// See COPYING for more information.
2017-09-26 13:58:44 -07:00
#include "m_math.h"
2017-09-29 04:50:36 -07:00
#include <stdlib.h>
2017-09-26 13:58:44 -07:00
// Extern Functions ----------------------------------------------------------|
//
// M_AABBPoint
//
bool M_AABBPoint(fixed xl, fixed yl, fixed xu, fixed yu, fixed xp, fixed yp)
{
return xp > xl && yp > yl && xp < xu && yp < yu;
}
2017-09-29 04:50:36 -07:00
//
// M_Random_Float
//
float M_Random_Float(float min, float max)
{
if(max < min) {float min_ = min; min = max; max = min_;}
return (rand() / (double)RAND_MAX) * (max - min) + min;
}
2017-09-26 13:58:44 -07:00
// EOF