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

Function Obj_GetObjDist

scripts/aigame4.cpp:382–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380//============================================
381
382float Obj_GetObjDist(int me, int it, bool f_sub_rads) {
383 vector me_pos;
384 vector it_pos;
385 float dist;
386
387 Obj_Value(me, VF_GET, OBJV_V_POS, &me_pos);
388 Obj_Value(it, VF_GET, OBJV_V_POS, &it_pos);
389
390 dist = vm_VectorDistance(&me_pos, &it_pos);
391
392 if (f_sub_rads) {
393 float size;
394
395 Obj_Value(me, VF_GET, OBJV_F_SIZE, &size);
396 dist -= size;
397 Obj_Value(it, VF_GET, OBJV_F_SIZE, &size);
398 dist -= size;
399 }
400
401 return dist;
402}
403
404static inline void AIClearNonHPGoals(int handle) {
405 int i;

Callers

nothing calls this directly

Calls 2

Obj_ValueFunction · 0.85
vm_VectorDistanceFunction · 0.70

Tested by

no test coverage detected