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

Method OnObjectPlaceCameraAtCurrentFace

editor/MainFrm.cpp:3276–3301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3274 World_changed = 1;
3275}
3276
3277void CMainFrame::OnObjectPlaceCameraAtCurrentFace() {
3278 vector pos;
3279 matrix orient;
3280 int objnum;
3281 int roomnum;
3282
3283 ComputeCenterPointOnFace(&pos, Curroomp, Curface);
3284 vm_VectorAngleToMatrix(&orient, &Curroomp->faces[Curface].normal, 0);
3285
3286 if (Curroomp->flags & RF_EXTERNAL) {
3287 roomnum = GetTerrainRoomFromPos(&pos);
3288 } else {
3289 roomnum = ROOMNUM(Curroomp);
3290 }
3291
3292 objnum = ObjCreate(OBJ_CAMERA, 0, roomnum, &pos, &orient);
3293
3294 if (objnum == -1) {
3295 Int3();
3296 return;
3297 }
3298
3299 EditorStatus("Camera created as object %d\n", objnum);
3300
3301 World_changed = 1;
3302}
3303
3304void CMainFrame::OnObjectSetViewerFromCamera() {

Callers

nothing calls this directly

Calls 5

ComputeCenterPointOnFaceFunction · 0.85
GetTerrainRoomFromPosFunction · 0.85
ObjCreateFunction · 0.85
EditorStatusFunction · 0.85
vm_VectorAngleToMatrixFunction · 0.50

Tested by

no test coverage detected