MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / PointSpeed

Function PointSpeed

physics/findintersection.cpp:3190–3211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3188*/
3189
3190vector PointSpeed(object *obj, vector *pos, matrix *orient, vector *rotvel, vector *velocity) {
3191 vector r1 = *pos - obj->pos;
3192 vector w1;
3193 vector n1;
3194 float temp1;
3195
3196 matrix o_t1 = *orient;
3197
3198 vm_TransposeMatrix(&o_t1);
3199 vector cmp1 = *rotvel * o_t1;
3200 ConvertEulerToAxisAmount(&cmp1, &n1, &temp1);
3201
3202 n1 *= temp1;
3203
3204 if (temp1 != 0.0f) {
3205 vm_CrossProduct(&w1, &n1, &r1);
3206 } else {
3207 w1 = Zero_vector;
3208 }
3209
3210 return *velocity + w1;
3211}
3212
3213// MTS: only used in this file.
3214// Hacked for some initial testing

Callers

nothing calls this directly

Calls 3

ConvertEulerToAxisAmountFunction · 0.85
vm_TransposeMatrixFunction · 0.50
vm_CrossProductFunction · 0.50

Tested by

no test coverage detected