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

Function HObjectMoveToViewer

editor/HObject.cpp:553–565  ·  view source on GitHub ↗

Move the object to in front of the viewer (where a new object would be placed)

Source from the content-addressed store, hash-verified

551
552// Move the object to in front of the viewer (where a new object would be placed)
553void HObjectMoveToViewer(object *objp) {
554 int objnum = OBJNUM(objp);
555 vector pos;
556
557 // First move player to viewer's position
558 ObjSetPos(objp, &Viewer_object->pos, Viewer_object->roomnum, NULL, false);
559
560 // Second try to move the player a little in front of the viewer
561 pos = Viewer_object->pos + Viewer_object->orient.fvec * OBJECT_PLACE_DIST;
562 MoveObject(objp, &pos);
563
564 World_changed = 1;
565}
566
567#define MOVE_EPSILON 0.1
568

Callers 1

OnObjectMovePlayerMethod · 0.85

Calls 2

ObjSetPosFunction · 0.85
MoveObjectFunction · 0.85

Tested by

no test coverage detected