View Issue Details

IDProjectCategoryView StatusLast Update
0005310DarkRadiantGeneralpublic05.02.2021 11:29
Reporterstgatilov Assigned Togreebo  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version2.8.0 
Target Version2.9.0Fixed in Version2.9.0 
Summary0005310: Add a way to teleport to coordinates (via Console Command or Python)
DescriptionThe TDM game has commands:
  getviewpos
  setviewpos x y z a b c
The first one prints coordinates and Euler angles, the second one teleports player to coordinates and orients by angles.
Note that angles are options, since in most cases user don't need them.

It would be great to have similar feature in DR, be it a separate dialog or just a scripting command.
TagsNo tags attached.

Activities

AluminumHaste

AluminumHaste

24.08.2020 17:55

updater   ~0012758

CTRL+MIDDLEMOUSE button can move the camera to a point in one of the ortho views
MIDDLEMOUSE button + move cursor changes the camera to look at the mouse in the ortho views

In DR they are called Drag Camera and Drag View

You should be able to get what you want using those two.
stgatilov

stgatilov

25.08.2020 04:37

administrator   ~0012759

With ortho view, I can only set two coordinates. How to set third coordinate?
And for it to happen, I have to monitor coordinates while moving mouse, which takes some time and effort.
greebo

greebo

02.10.2020 16:31

administrator   ~0012789

In the recent master branch, getting or setting the camera position via C++ code can be done like this:

// This might throw an std::runtime_error if no camera is present
auto& camera = GlobalCameraManager().getActiveView();

// Get the current position and angles
Vector3 orig = camera.getCameraOrigin();
Vector3 angles = camera.getCameraAngles();

// Set the current position and angles
camera.setCameraOrigin(orig);
camera.setCameraAngles(angles);

// Or set both at the same time
camera.setOriginAndAngles(orig, angles);

I'll have a look at exposing that functionality to the CommandSystem and Python scripts.
greebo

greebo

03.10.2020 03:17

administrator   ~0012790

New console commands available:

 SetActiveCameraPosition "100 40 50"
 SetActiveCameraAngles "30 10 20"

Camera angles are pitch,yaw,roll in degrees.

Related Changesets

DarkRadiant: master d8b7878d

02.10.2020 18:58

greebo


Details Diff
0005310: Add CameraInterface to python scripting module Affected Issues
0005310
mod - plugins/script/Makefile.am Diff File
mod - plugins/script/ScriptingSystem.cpp Diff File
add - plugins/script/interfaces/CameraInterface.cpp Diff File
add - plugins/script/interfaces/CameraInterface.h Diff File
mod - tools/msvc/script.vcxproj Diff File
mod - tools/msvc/script.vcxproj.filters Diff File

DarkRadiant: master bec4d2ad

02.10.2020 19:08

greebo


Details Diff
0005310: Fix test.py script Affected Issues
0005310
mod - install/scripts/test.py Diff File

DarkRadiant: master 41e3b4c8

03.10.2020 02:55

greebo


Details Diff
0005310: Add commands to set the camera's position and angles. Affected Issues
0005310
mod - radiantcore/camera/CameraManager.cpp Diff File
mod - radiantcore/camera/CameraManager.h Diff File

DarkRadiant: master debae722

03.10.2020 03:15

greebo


Details Diff
0005310: Add unit tests covering the commands SetActiveCameraPosition and SetActiveCameraAngles. Affected Issues
0005310
mod - test/CSG.cpp Diff File
add - test/Camera.cpp Diff File
mod - test/RadiantTest.h Diff File
mod - tools/msvc/Tests/Tests.vcxproj Diff File
mod - tools/msvc/Tests/Tests.vcxproj.filters Diff File

Issue History

Date Modified Username Field Change
28.07.2020 11:47 stgatilov New Issue
24.08.2020 17:55 AluminumHaste Note Added: 0012758
25.08.2020 04:37 stgatilov Note Added: 0012759
02.10.2020 16:31 greebo Note Added: 0012789
02.10.2020 16:31 greebo Status new => confirmed
02.10.2020 16:32 greebo Summary Add a way to teleport to coordinates => Add a way to teleport to coordinates (via Console Command or Python)
02.10.2020 16:32 greebo Target Version => 2.9.0
02.10.2020 19:08 greebo Changeset attached => DarkRadiant master d8b7878d
02.10.2020 19:08 greebo Changeset attached => DarkRadiant master bec4d2ad
03.10.2020 03:15 greebo Changeset attached => DarkRadiant master 41e3b4c8
03.10.2020 03:15 greebo Changeset attached => DarkRadiant master debae722
03.10.2020 03:15 greebo Assigned To => greebo
03.10.2020 03:16 greebo Status confirmed => assigned
03.10.2020 03:16 greebo Status assigned => resolved
03.10.2020 03:16 greebo Resolution open => fixed
03.10.2020 03:16 greebo Fixed in Version => 2.9.0
03.10.2020 03:17 greebo Note Added: 0012790
05.02.2021 11:29 greebo Status resolved => closed