Go to the source code of this file.
Namespaces | |
namespace | Gosu |
The library's main namespace. | |
Functions | |
long | Gosu::trunc (double value) |
Truncates the fractional part of a real value. | |
long | Gosu::round (double value) |
Rounds a real value towards the next integer. | |
double | Gosu::random (double min, double max) |
Returns a real value between min (inclusive) and max (exclusive). | |
double | Gosu::gosuToRadians (double angle) |
Translates between Gosu's angle system (where 0¡ is at the top) and radians (where 0 is at the right). | |
double | Gosu::radiansToGosu (double angle) |
Translates between Gosu's angle system (where 0¡ is at the top) and radians (where 0 is at the right). | |
double | Gosu::degreesToRadians (double angle) |
Translates between degrees (used by Gosu) and radians, i.e. | |
double | Gosu::radiansToDegrees (double angle) |
Translates between degrees (used by Gosu) and radians, i.e. | |
double | Gosu::offsetX (double angle, double radius) |
Returns the horizontal distance between the origin and the point to which you would get if you moved radius pixels in the direction specified by angle. | |
double | Gosu::offsetY (double angle, double radius) |
Returns the vertical distance between the origin and the point to which you would get if you moved radius pixels in the direction specified by angle. | |
double | Gosu::angle (double fromX, double fromY, double toX, double toY, double def=0) |
Returns the angle from point 1 to point 2 in degrees, where 0.0 means upwards. | |
double | Gosu::angleDiff (double angle1, double angle2) |
Returns the smallest angle that can be added to angle1 to get to angle2 (can be negative if counter-clockwise movement is shorter). | |
double | Gosu::normalizeAngle (double angle) |
Normalizes an angle to fit into the range [0; 360[. | |
template<typename T > | |
T | Gosu::square (T value) |
Returns value * value. | |
template<typename T > | |
T | Gosu::clamp (T value, T min, T max) |
Returns min if value is smaller than min, max if value is larger than max and value otherwise. | |
template<typename T > | |
T | Gosu::boundBy (T value, T min, T max) |
int | Gosu::wrap (int value, int min, int max) |
Returns (value-min) % (max-min) + min, where % always has a positive result for max > min. | |
float | Gosu::wrap (float value, float min, float max) |
Returns (value-min) % (max-min) + min, where % always has a positive result for max > min. | |
double | Gosu::wrap (double value, double min, double max) |
Returns (value-min) % (max-min) + min, where % always has a positive result for max > min. | |
double | Gosu::distanceSqr (double x1, double y1, double x2, double y2) |
Returns the square of the distance between two points. | |
double | Gosu::distance (double x1, double y1, double x2, double y2) |
Returns the distance between two points. | |
template<typename T > | |
T | Gosu::interpolate (T a, T b, double weight=0.5) |
Interpolates a value between a and b, weight being the bias towards the second value. | |
Variables | |
const double | Gosu::pi = 3.1415926536 |
Pi. |
Definition in file Math.hpp.