Nuclide
Software Development Kit for id Tech
math.h File Reference

Vector Math Helper Functions. More...

#include "math_vector.h"

Go to the source code of this file.

#define MATH_PI   3.1415926
 Approximation of Pi. More...
 
#define vectoangles   vectoangles2
 
noref const vector g_vec_null = [0.0f, 0.0f, 0.0f]
 
vector v_forward
 
vector v_up
 
vector v_right
 
vector vectoangles2 (vector fwd, optional vector up)
 
void rotatevectorsbyangle (vector angle)
 
void makevectors (vector angles)
 
float lerpAngle (float startAngle, float endAngle, float lerpAmount)
 Euler-angle lerping function that accounts for negative degrees. More...
 
float lerp (float startValue, float endValue, float lerpAmount)
 Linear lerp function. More...
 
float fixAngleDelta (float angleValue)
 Tecursive function that fixes an euler angle. More...
 
vector fixAngle (vector inputAngle)
 Recursive function that fixes euler angles. More...
 
vector reflect (vector hitDirection, vector planeNormal)
 Takes a direction and a plane normal, returns a new trajectory. More...
 
vector randomVector (bool flyUp)
 Calculates a random Vector, with every axis being a value between -1.0 and 1.0, unless flyUp is true. More...
 
vector rotateAroundPoint (vector pos, vector pivot, float degr)
 Takes a position and a pivot point and rotates point by N degrees around the pivot (YAW) More...
 
vector angleDifference (vector angle1, vector angle2)
 Calculates the difference between two angles. More...
 
vector hsvToRGB (float h, float s, float v)
 Converts a Hue-Saturation-Value pair to an RGB vector. More...
 

Detailed Description

Vector Math Helper Functions.

Math Helper Functions.

Helper functions for various mathematical operations. This header can be included in other libraries and projects to help deal with these sorts of issues. It is usually included by default in a library project. If you want to include this file into your own progs, you can include math.h from src/shared/.