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

Function qObjGetDistance

scripts/DallasFuncs.cpp:6074–6086  ·  view source on GitHub ↗

$$QUERY Objects f:Distance between [o:Object1] and [o:Object2] qObjGetDistance Distance between two objects Gets the distance between two objects Parameters: Object1, Object2: the two objects $$END */

Source from the content-addressed store, hash-verified

6072$$END
6073*/
6074float qObjGetDistance(int objhandle0, int objhandle1) {
6075 msafe_struct mstruct;
6076 vector p0;
6077
6078 mstruct.objhandle = objhandle0;
6079 MSafe_GetValue(MSAFE_OBJECT_POS, &mstruct);
6080 p0 = mstruct.pos;
6081
6082 mstruct.objhandle = objhandle1;
6083 MSafe_GetValue(MSAFE_OBJECT_POS, &mstruct);
6084
6085 return vm_VectorDistance(&p0, &mstruct.pos);
6086}
6087
6088/*
6089$$QUERY

Callers 12

CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
cEndSequenceFrameFunction · 0.85
CallEventMethod · 0.85

Calls 1

vm_VectorDistanceFunction · 0.70

Tested by

no test coverage detected