| 261 | } |
| 262 | |
| 263 | void vm_CrossProduct(vector *dest, vector *u, vector *v) { |
| 264 | // Computes a cross product between u and v, returns the result |
| 265 | // in Normal. Dest cannot equal source. |
| 266 | |
| 267 | dest->x = (u->y * v->z) - (u->z * v->y); |
| 268 | dest->y = (u->z * v->x) - (u->x * v->z); |
| 269 | dest->z = (u->x * v->y) - (u->y * v->x); |
| 270 | } |
| 271 | |
| 272 | // Normalize a vector. |
| 273 | // Returns: the magnitude before normalization |
no outgoing calls
no test coverage detected