Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DView.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ typedef struct
typedef struct
{
Int numFrames; ///< Number of frames to rotate.
Int curFrame; ///< Current frame.
Real curFrame; ///< Progress in frames, advanced by elapsed logic time.
Int startTimeMultiplier;
Int endTimeMultiplier;
Int numHoldFrames; ///< Number of frames to hold the camera before finishing the movement
Expand All @@ -101,7 +101,7 @@ typedef struct
typedef struct
{
Int numFrames; ///< Number of frames to pitch.
Int curFrame; ///< Current frame.
Real curFrame; ///< Progress in frames, advanced by elapsed logic time.
Real angle;
Real startPitch;
Real endPitch;
Expand All @@ -115,7 +115,7 @@ typedef struct
typedef struct
{
Int numFrames; ///< Number of frames to zoom.
Int curFrame; ///< Current frame.
Real curFrame; ///< Progress in frames, advanced by elapsed logic time.
Real startZoom;
Real endZoom;
Int startTimeMultiplier;
Expand Down Expand Up @@ -325,9 +325,9 @@ class W3DView : public View, public SubsystemInterface
void moveAlongWaypointPath(Real milliseconds); ///< Move camera along path.
void getPickRay(const ICoord2D *screen, Vector3 *rayStart, Vector3 *rayEnd); ///<returns a line segment (ray) originating at the given screen position
void setupWaypointPath(Bool orient); ///< Calculates distances & angles for moving along a waypoint path.
void rotateCameraOneFrame(); ///< Do one frame of a rotate camera movement.
void zoomCameraOneFrame(); ///< Do one frame of a zoom camera movement.
void pitchCameraOneFrame(); ///< Do one frame of a pitch camera movement.
void rotateCameraOneFrame(Real milliseconds); ///< Do one frame of a rotate camera movement.
void zoomCameraOneFrame(Real milliseconds); ///< Do one frame of a zoom camera movement.
void pitchCameraOneFrame(Real milliseconds); ///< Do one frame of a pitch camera movement.
void getAxisAlignedViewRegion(Region3D &axisAlignedRegion); ///< Find 3D Region enclosing all possible drawables.
void calcDeltaScroll(Coord2D &screenDelta);
bool getDesiredTerrainDrawSize(ICoord2D &dimensions) const;
Expand Down
21 changes: 12 additions & 9 deletions Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1289,18 +1289,18 @@ Bool W3DView::updateCameraMovements()

if (hasScriptedState(Scripted_Zoom))
{
zoomCameraOneFrame();
zoomCameraOneFrame(TheFramePacer->getLogicTimeStepMilliseconds(FramePacer::IgnoreFrozenTime));
didUpdate = true;
}
if (hasScriptedState(Scripted_Pitch))
{
pitchCameraOneFrame();
pitchCameraOneFrame(TheFramePacer->getLogicTimeStepMilliseconds(FramePacer::IgnoreFrozenTime));
didUpdate = true;
}
if (hasScriptedState(Scripted_Rotate))
{
m_previousLookAtPosition = getPosition();
rotateCameraOneFrame();
rotateCameraOneFrame(TheFramePacer->getLogicTimeStepMilliseconds(FramePacer::IgnoreFrozenTime));
didUpdate = true;
}
else if (hasScriptedState(Scripted_MoveOnWaypointPath))
Expand Down Expand Up @@ -3268,9 +3268,12 @@ static Real makeQuadraticS(Real t)

// ------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------
void W3DView::rotateCameraOneFrame()
void W3DView::rotateCameraOneFrame(Real milliseconds)
{
m_rcInfo.curFrame++;
// TheSuperHackers @bugfix bobtista 14/08/2026 Advance the scripted camera by the elapsed logic
// time rather than by one render frame, so the movement takes the authored duration at any
// render frame rate. This mirrors moveAlongWaypointPath, which was decoupled the same way.
m_rcInfo.curFrame += milliseconds / TheW3DFrameLengthInMsec;
if (TheGlobalData->m_disableCameraMovement) {
if (m_rcInfo.curFrame >= m_rcInfo.numFrames + m_rcInfo.numHoldFrames) {
removeScriptedState(Scripted_Rotate);
Expand Down Expand Up @@ -3339,9 +3342,9 @@ void W3DView::rotateCameraOneFrame()

// ------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------
void W3DView::zoomCameraOneFrame()
void W3DView::zoomCameraOneFrame(Real milliseconds)
{
m_zcInfo.curFrame++;
m_zcInfo.curFrame += milliseconds / TheW3DFrameLengthInMsec;
if (TheGlobalData->m_disableCameraMovement) {
if (m_zcInfo.curFrame >= m_zcInfo.numFrames) {
removeScriptedState(Scripted_Zoom);
Expand All @@ -3365,9 +3368,9 @@ void W3DView::zoomCameraOneFrame()

// ------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------
void W3DView::pitchCameraOneFrame()
void W3DView::pitchCameraOneFrame(Real milliseconds)
{
m_pcInfo.curFrame++;
m_pcInfo.curFrame += milliseconds / TheW3DFrameLengthInMsec;
if (TheGlobalData->m_disableCameraMovement) {
if (m_pcInfo.curFrame >= m_pcInfo.numFrames) {
removeScriptedState(Scripted_Pitch);
Expand Down
Loading