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
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Include/GameClient/View.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class View : public Snapshot
virtual void shake( const Coord3D *epicenter, CameraShakeType shakeType ) { };

virtual Real getFXPitch( void ) const { return 1.0f; } ///< returns the FX pitch angle
virtual void forceCameraConstraintRecalc(void) {}
virtual void forceCameraAreaConstraintRecalc(void) {}
virtual void setGuardBandBias( const Coord2D *gb ) = 0;

protected:
Expand Down
5 changes: 2 additions & 3 deletions GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4342,9 +4342,8 @@ Bool InGameUI::areSelectedObjectsControllable() const
//------------------------------------------------------------------------------
void InGameUI::resetCamera()
{
ViewLocation currentView;
TheTacticalView->getLocation( &currentView );
TheTacticalView->resetCamera( &currentView.getPosition(), 1, 0.0f, 0.0f );
TheTacticalView->setAngleAndPitchToDefault();
TheTacticalView->setZoomToDefault();
}

//------------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion GeneralsMD/Code/GameEngine/Source/GameClient/View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ void View::init( void )
m_zoom = 1.0f;
m_maxHeightAboveGround = TheGlobalData->m_maxCameraHeight;
m_minHeightAboveGround = TheGlobalData->m_minCameraHeight;
m_okToAdjustHeight = FALSE;

m_defaultAngle = 0.0f;
m_defaultPitchAngle = 0.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2632,7 +2632,7 @@ void TerrainLogic::setActiveBoundary(Int newActiveBoundary)
// Don't do a newMap on the pathfinder - It uses the largest active boundary to start. jba.
//TheAI->pathfinder()->newMap();

TheTacticalView->forceCameraConstraintRecalc();
TheTacticalView->forceCameraAreaConstraintRecalc();
}

// ------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class W3DView : public View, public SubsystemInterface
virtual void set3DWireFrameMode(Bool enable); ///<enables custom wireframe rendering of 3D viewport

Bool updateCameraMovements(void);
virtual void forceCameraConstraintRecalc(void) { calcCameraConstraints(); }
virtual void forceCameraAreaConstraintRecalc(void) { m_cameraAreaConstraintsValid = false; }

virtual void setGuardBandBias( const Coord2D *gb ) { m_guardBandBias.x = gb->x; m_guardBandBias.y = gb->y; }

Expand Down Expand Up @@ -276,12 +276,20 @@ class W3DView : public View, public SubsystemInterface

Real m_groundLevel; ///< height of ground.

Region2D m_cameraConstraint; ///< m_pos should be constrained to be within this area
Bool m_cameraConstraintValid; ///< if f, recalc cam constraints
Region2D m_cameraAreaConstraints; ///< Camera should be constrained to be within this area
Bool m_cameraAreaConstraintsValid; ///< If false, recalculates the camera area constraints in the next render update
Bool m_clipIntoCameraConstraintsNow; ///< If true, clips the camera into the camera area constraints in the next render update
Bool m_recalcCameraConstraintsAfterScrolling; ///< Recalculates the camera area constraints after the user has moved the camera
Bool m_recalcCamera; ///< Recalculates the camera transform in the next render update

void setCameraTransform( void ); ///< set the transform matrix of m_3DCamera, based on m_pos & m_angle
void buildCameraTransform( Matrix3D *transform ) ; ///< calculate (but do not set) the transform matrix of m_3DCamera, based on m_pos & m_angle
void calcCameraConstraints() ; ///< recalc m_cameraConstraint
void buildCameraTransform( Matrix3D *transform ); ///< calculate (but do not set) the transform matrix of m_3DCamera, based on m_pos & m_angle
void updateCameraAreaConstraints();
void calcCameraAreaConstraints(); ///< Recalculates the camera area constraints
void moveCameraIntoAreaConstraints();
void clipCameraIntoAreaConstraints();
Bool isWithinCameraAreaConstraints() const;
Bool isWithinCameraHeightConstraints() const;
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.
Expand Down
Loading
Loading