Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Freecam Feature #42

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Freecam Feature #42

wants to merge 14 commits into from

Conversation

Krzyhau
Copy link
Contributor

@Krzyhau Krzyhau commented Apr 26, 2020

Adds a bunch of commands allowing you to freely control your view camera.

Basic Camera Control

Camera can be separated from a player using command sar_cam_control 1 (requires sv_cheats or demo player). Then it can be manipulated using drive mode or these commands:
sar_cam_setpos [x] [y] [z]
sar_cam_setang [pitch] [yaw] <roll>
sar_cam_setfov [fov]
sar_cam_reset

Drive Mode

Almost a literal copy of demo drive with a couple of new features.

  • Hold left mouse button to control the camera using mouse and keyboard. Required for all of inputs below.
  • Move mouse to look around.
  • Use WSAD keys to move around.
  • Hold Left Shift to speed up or Left Control to slow down
  • Hold right mouse button and move mouse left and right to change camera roll.
  • Hold right mouse button and move mouse up and down to change camera field of view.

Drive mode can be disabled in game by setting sar_cam_drive to 0.

Cinematic Mode

Demo player exclusive feature. Allows you to create a path for camera to follow during demo playback.
sar_camera_path_setkf <frame> <x> <y> <z> <pitch> <yaw> <roll> <fov> - creates a new path keyframe. All parameters are optional - current frame and position will be used.
sar_camera_remkf [frame] - removes keyframe at specified frame.
sar_camera_showkfs - displays a list of currently created keyframes.
sar_camera_control 2 - puts camera into Cinematic mode. It will follow predefined path.

TODO list

  • Feature implemented and tested only for Portal 2 on Windows. Support for other games/systems?
  • Couldn't figure out proper CViewSetup struct. Using wacky offsets for now, but it needs to be replaced.
  • A little bit more of testing would be appreciated.
  • Command auto-completion would be pretty poggers. Didn't really have balls to do it.

@NeKzor NeKzor added the feature PR tries to implement a new feature. label Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature PR tries to implement a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants