Closed Ashetf2 closed 1 year ago
The function bool ClientModeCSNormal::GetIdealCameraPosForPlayer( int playerindex )
in clientmode_csnormal
seems important (and contains spec_lerpto too)
set lerp to 0
if ( m_bIsSpecLerping )
from void CBasePlayer::CheckObserverSettings()
in player.cpp
checks the following functions: m_bIsSpecLerping
, m_vecSpecLerpIdealPos
, m_angSpecLerpIdealAng
, m_flSpecLerpEndTime
, m_flSpecLerpTime
. They all appear in:
game\client\hltvcamera.cpp
,game\client\hltvcamera.h
, game\server\player.cpp
, game\server\player.h
and game\shared\baseplayer_shared.cpp
Edit: They may not be important after all
I expect that with VScript something similar or even better can be achieved. See: https://github.com/samisalreadytaken/keyframes. Closing
Description
spec_lerpto is a command in CS:GO that lerps the camera from one point to other. Porting this to TF2 would be a nice touch for content creators to create cinematic cameras in TF2.
My knowledge in programing is limited, but from what I've been investigating, my conclusions are: According to the CS:GO code, spec_lerpto is defined in
game\client\cstrike15\clientmode_csnormal.cpp
,game\server\player.cpp
, andengine\hltvclient.cpp
The function that defines this command in player.cpp is
Several of the functions and variables used in this are already defined, and some other aren't.
player.cpp
m_iObserverMode
doesn't output anything in TF2. In CS:GO:player.cpp
void C_HLTVCamera::CalcRoamingView
andC_HLTVCamera::CalcFixedView
in game/client/hltvcamera.cpp have more checks forif ( m_bIsSpecLerping )
in CS:GO. It would be necessary in CalcRoamingView to uncomment//fov = m_flFOV;
and comment the next line, since it uses a csgo only command ("fov_cs_debug").̶A̶l̶s̶o̶,̶ ̶I̶'̶m̶ ̶n̶o̶t̶ ̶s̶u̶r̶e̶ ̶w̶h̶a̶t̶ ̶c̶o̶u̶l̶d̶ ̶b̶e̶ ̶t̶h̶e̶ ̶c̶o̶u̶n̶t̶e̶r̶p̶a̶r̶t̶ ̶o̶f̶ ̶c̶l̶i̶e̶n̶t̶m̶o̶d̶e̶̶c̶s̶n̶o̶r̶m̶a̶l̶.̶c̶p̶p̶ ̶i̶n̶ ̶T̶F̶2̶.̶ ̶I̶ ̶d̶o̶n̶'̶t̶ ̶t̶h̶i̶n̶k̶ ̶i̶t̶ ̶i̶s̶ ̶c̶s̶t̶r̶i̶k̶e̶\̶c̶l̶i̶e̶n̶t̶m̶o̶d̶e̶̶c̶s̶n̶o̶r̶m̶a̶l̶.̶c̶p̶p̶
EDIT: The counterpart of
clientmode_csnormal.cpp
for TF2 would begame\client\tf\clientmode_tf.cpp
. Both files share this function:void ClientModeCSNormal::OnScreenshotRequested( ScreenshotRequested_t *pParam )
I'll update this when I do more research.
Checklist
Screenshots
https://user-images.githubusercontent.com/63692647/200708534-5f4dd85f-4ea3-4b90-97aa-85e13e53dc9d.mp4
Alternatives