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

Function Obj_GetObjDist

scripts/AIGame.cpp:2774–2794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2772//============================================
2773
2774static float Obj_GetObjDist(int me, int it, bool f_sub_rads) {
2775 vector me_pos;
2776 vector it_pos;
2777 float dist;
2778
2779 Obj_Value(me, VF_GET, OBJV_V_POS, &me_pos);
2780 Obj_Value(it, VF_GET, OBJV_V_POS, &it_pos);
2781
2782 dist = vm_VectorDistance(&me_pos, &it_pos);
2783
2784 if (f_sub_rads) {
2785 float size;
2786
2787 Obj_Value(me, VF_GET, OBJV_F_SIZE, &size);
2788 dist -= size;
2789 Obj_Value(it, VF_GET, OBJV_F_SIZE, &size);
2790 dist -= size;
2791 }
2792
2793 return dist;
2794}
2795
2796static inline void AIClearNonHPGoals(int handle) {
2797 int i;

Callers 1

DoFrameMethod · 0.70

Calls 2

Obj_ValueFunction · 0.85
vm_VectorDistanceFunction · 0.70

Tested by

no test coverage detected