@ -3,18 +3,18 @@
MATRIX * RotMatrixQ ( SVECTOR * r , MATRIX * m ) ;
MATRIX * RotMatrixQ ( SVECTOR * r , MATRIX * m ) ;
INLINE shor t m_dot12s ( const SVECTOR a , const SVECTOR b )
INLINE in t m_dot12s ( const SVECTOR a , const SVECTOR b )
{
{
return ( short ) ( ( ( int ) a . vx * b . vx ) > > 12 ) + ( ( ( int ) a . vy * b . vy ) > > 12 ) + ( ( ( int ) a . vz * b . vz ) > > 12 ) ;
return ( ( ( int ) a . vx * b . vx ) > > 12 ) + ( ( ( int ) a . vy * b . vy ) > > 12 ) + ( ( ( int ) a . vz * b . vz ) > > 12 ) ;
}
}
/ / TODO : worth a benchmark : is it faster to copy these vectors and use them from the stack , or to do six pointer dereferences ?
/ / TODO : worth a benchmark : is it faster to copy these vectors and use them from the stack , or to do six pointer dereferences ?
INLINE shor t m_pointPlaneDist2 ( const VECTOR point2 , const SVECTOR normal12 , int dist2 )
INLINE in t m_pointPlaneDist2 ( const VECTOR point2 , const SVECTOR normal12 , int dist2 )
{
{
int x = ( ( int ) point2 . vx * normal12 . vx ) > > 12 ;
int x = ( ( int ) point2 . vx * normal12 . vx ) > > 12 ;
int y = ( ( int ) point2 . vy * normal12 . vy ) > > 12 ;
int y = ( ( int ) point2 . vy * normal12 . vy ) > > 12 ;
int z = ( ( int ) point2 . vz * normal12 . vz ) > > 12 ;
int z = ( ( int ) point2 . vz * normal12 . vz ) > > 12 ;
return ( short ) ( x + y + z - dist2 ) ;
return ( x + y + z - dist2 ) ;
}
}
# endif / / __QMATH_H__
# endif / / __QMATH_H__