Skip to content
Open
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
4 changes: 3 additions & 1 deletion Core/GameEngine/Include/GameClient/View.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ class View : public Snapshot
virtual void forceRedraw() = 0;

virtual void lookAt( const Coord3D *o ); ///< Center the view on the given coordinate
virtual void initHeightForMap() {}; ///< Init the camera height for the map at the current position.
virtual void initHeightForMap() {}; ///< Init the camera height for the map at the current position.
virtual void resetPivotToGround() {}; ///< Set the camera pivot to the terrain height at the current position.
virtual void scrollBy( const Coord2D *delta ); ///< Shift the view by the given delta

virtual void moveCameraTo(const Coord3D *o, Int frames, Int shutter, Bool orient, Real easeIn=0.0f, Real easeOut=0.0f) { lookAt( o ); }
Expand Down Expand Up @@ -204,6 +205,7 @@ class View : public Snapshot
Bool userSetZoomToDefault() { return doUserAction(&View::setZoomToDefault); }
Bool userSetFieldOfView(Real angle) { return doUserAction(&View::setFieldOfView, angle); }
Bool userLookAt(const Coord3D *o) { return doUserAction(&View::lookAt, o); }
Bool userResetPivotToGround() { return doUserAction(&View::resetPivotToGround); }
Bool userScrollBy(const Coord2D *delta) { return doUserAction(&View::scrollBy, delta); }
Bool userSetLocation(const ViewLocation *location) { return doUserAction(&View::setLocation, location); }
Bool userSetCameraLock(ObjectID id) { return doUserAction(&View::setCameraLock, id); }
Expand Down
13 changes: 10 additions & 3 deletions Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DView.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ class W3DView : public View, public SubsystemInterface
virtual void setPitchToDefault() override; ///< Set the view pitch back to default

virtual void lookAt( const Coord3D *o ) override; ///< Center the view on the given coordinate
virtual void initHeightForMap() override; ///< Init the camera height for the map at the current position.
virtual void initHeightForMap() override; ///< Init the camera height for the map at the current position.
virtual void resetPivotToGround() override; ///< Set the camera pivot to the terrain height at the current position.
virtual void moveCameraTo(const Coord3D *o, Int milliseconds, Int shutter, Bool orient, Real easeIn, Real easeOut) override;
virtual void moveCameraAlongWaypointPath(Waypoint *pWay, Int frames, Int shutter, Bool orient, Real easeIn, Real easeOut) override;
virtual Bool isCameraMovementFinished() override;
Expand Down Expand Up @@ -238,7 +239,7 @@ class W3DView : public View, public SubsystemInterface
virtual void set3DWireFrameMode(Bool enable) override; ///<enables custom wireframe rendering of 3D viewport

Bool updateCameraMovements();
virtual void forceCameraAreaConstraintRecalc() override { calcCameraAreaConstraints(); }
virtual void forceCameraAreaConstraintRecalc() override { m_cameraAreaConstraintsValid = false; }

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

Expand Down Expand Up @@ -283,13 +284,19 @@ class W3DView : public View, public SubsystemInterface

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_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(); ///< set the transform matrix of m_3DCamera, based on m_pos & m_angle
void buildCameraPosition(Vector3 &sourcePos, Vector3 &targetPos);
void buildCameraTransform(Matrix3D *transform, const Vector3 &sourcePos, const Vector3 &targetPos); ///< calculate (but do not set) the transform matrix of m_3DCamera, based on m_pos & m_angle
Bool zoomCameraToDesiredHeight();
Bool movePivotToGround();
void updateCameraAreaConstraints();
void calcCameraAreaConstraints(); ///< Recalculates the camera area constraints
Real calcCameraAreaOffset(Real maxEdgeZ);
Real calcCameraAreaOffset(Real maxEdgeZ, Bool isLookingDown);
void clipCameraIntoAreaConstraints();
Bool isWithinCameraAreaConstraints() const;
Bool isWithinCameraHeightConstraints() const;
virtual void setUserControlled(Bool value);
Bool hasScriptedState(ScriptedState state) const;
Expand Down
Loading
Loading