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

Function EBNode_Move

editor/ebnode.cpp:1324–1361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1322}
1323
1324void EBNode_Move(bool f_offset, int roomnum, int pnt, vector *pos) {
1325 bn_list *nlist;
1326 nlist = BNode_GetBNListPtr(roomnum);
1327
1328 int i;
1329 vector npos = *pos;
1330
1331 if (f_offset) {
1332 npos += nlist->nodes[pnt].pos;
1333
1334 fvi_info hit_info;
1335 fvi_query fq;
1336
1337 // check to make sure it is still in the room and valid
1338 fq.p0 = &nlist->nodes[pnt].pos;
1339 fq.p1 = &npos;
1340 fq.startroom = (roomnum > Highest_room_index && roomnum <= Highest_room_index + 8)
1341 ? GetTerrainRoomFromPos(&nlist->nodes[pnt].pos)
1342 : roomnum;
1343
1344 fq.rad = 0.25f;
1345 fq.flags =
1346 FQ_SOLID_PORTALS | FQ_NO_RELINK; // chrishack -- Might want to make FQ_IGNORE_MOVING_OBJECTS into a passed arg
1347 fq.thisobjnum = -1;
1348 fq.ignore_obj_list = NULL;
1349
1350 fvi_FindIntersection(&fq, &hit_info);
1351
1352 npos = hit_info.hit_pnt;
1353 }
1354
1355 nlist->nodes[pnt].pos = npos;
1356
1357 for (i = 0; i < nlist->nodes[pnt].num_edges; i++) {
1358 EBNode_ComputeEdgeCosts(roomnum, pnt, nlist->nodes[pnt].edges[i].end_room, nlist->nodes[pnt].edges[i].end_index);
1359 EBNode_ComputeEdgeCosts(nlist->nodes[pnt].edges[i].end_room, nlist->nodes[pnt].edges[i].end_index, roomnum, pnt);
1360 }
1361}
1362
1363void EBNode_Draw(char draw_type, grViewport *vp, vector *viewer_eye, matrix *viewer_orient, float zoom) {
1364 int i;

Callers 8

OnAinBackMethod · 0.85
OnAinDownMethod · 0.85
OnAinForwardMethod · 0.85
OnAinLeftMethod · 0.85
OnAinMoveNodeToViewerMethod · 0.85
OnAinRightMethod · 0.85
OnAinUpMethod · 0.85
OnIenavButtonMethod · 0.85

Calls 4

BNode_GetBNListPtrFunction · 0.85
GetTerrainRoomFromPosFunction · 0.85
fvi_FindIntersectionFunction · 0.85
EBNode_ComputeEdgeCostsFunction · 0.85

Tested by

no test coverage detected