-void VectorRotate (vec3_t vIn, vec3_t vRotation, vec3_t out)
-{
- vec3_t vWork, va;
- int nIndex[3][2];
- int i;
-
- VectorCopy(vIn, va);
- VectorCopy(va, vWork);
- nIndex[0][0] = 1; nIndex[0][1] = 2;
- nIndex[1][0] = 2; nIndex[1][1] = 0;
- nIndex[2][0] = 0; nIndex[2][1] = 1;
-
- for (i = 0; i < 3; i++)
- {
- if (vRotation[i] != 0)
- {
- float dAngle = vRotation[i] * Q_PI / 180.0f;
- float c = (vec_t)cos(dAngle);
- float s = (vec_t)sin(dAngle);
- vWork[nIndex[i][0]] = va[nIndex[i][0]] * c - va[nIndex[i][1]] * s;
- vWork[nIndex[i][1]] = va[nIndex[i][0]] * s + va[nIndex[i][1]] * c;
- }
- VectorCopy(vWork, va);
- }
- VectorCopy(vWork, out);
-}
-
-void VectorRotateOrigin (vec3_t vIn, vec3_t vRotation, vec3_t vOrigin, vec3_t out)
-{
- vec3_t vTemp, vTemp2;
-
- VectorSubtract(vIn, vOrigin, vTemp);
- VectorRotate(vTemp, vRotation, vTemp2);
- VectorAdd(vTemp2, vOrigin, out);
-}
-
-void VectorPolar(vec3_t v, float radius, float theta, float phi)
-{
- v[0]=(float)(radius * cos(theta) * cos(phi));
- v[1]=(float)(radius * sin(theta) * cos(phi));
- v[2]=(float)(radius * sin(phi));
-}
-
-void VectorSnap(vec3_t v)
-{
- int i;
- for (i = 0; i < 3; i++)
- {
- v[i] = (vec_t)floor (v[i] + 0.5);
- }
-}
-
-void VectorISnap(vec3_t point, int snap)
-{
- int i;
- for (i = 0 ;i < 3 ; i++)
+void VectorRotateOrigin( vec3_t vIn, vec3_t vRotation, vec3_t vOrigin, vec3_t out ){
+ vec3_t vTemp, vTemp2;
+
+ VectorSubtract( vIn, vOrigin, vTemp );
+ VectorRotate( vTemp, vRotation, vTemp2 );
+ VectorAdd( vTemp2, vOrigin, out );
+}
+
+void VectorPolar( vec3_t v, float radius, float theta, float phi ){
+ v[0] = (float)( radius * cos( theta ) * cos( phi ) );
+ v[1] = (float)( radius * sin( theta ) * cos( phi ) );
+ v[2] = (float)( radius * sin( phi ) );
+}
+
+void VectorSnap( vec3_t v ){
+ int i;
+ for ( i = 0; i < 3; i++ )