Quake BSP renderer for PS1
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

19 lines
548 B

#ifndef __QMATH_H__
#define __QMATH_H__
MATRIX *RotMatrixQ(SVECTOR *r, MATRIX *m);
INLINE short m_dot12(const SVECTOR *a, const SVECTOR *b)
{
return ((a->vx * b->vx) >> 12) + ((a->vy * b->vy) >> 12) + ((a->vz * b->vz) >> 12);
}
INLINE short m_pointPlaneDist2(const VECTOR *point2, const SVECTOR *normal12, short dist2)
{
int x = ((int)point2->vx * normal12->vx) >> 12;
int y = ((int)point2->vy * normal12->vy) >> 12;
int z = ((int)point2->vz * normal12->vz) >> 12;
return (short)(x + y + z - dist2);
}
#endif // __QMATH_H__