Skip to content

Commit

Permalink
renderer: Rename current hardcoded camera boundaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
heinezen committed Nov 7, 2024
1 parent 179e1ad commit 6d6a2dd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
12 changes: 6 additions & 6 deletions libopenage/presenter/presenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ void Presenter::init_graphics(bool debug) {
// TODO: Make boundaries dynamic based on map size.
this->camera_manager->set_camera_boundaries(
renderer::camera::CameraBoundaries{
renderer::camera::X_MIN,
renderer::camera::X_MAX,
renderer::camera::Y_MIN,
renderer::camera::Y_MAX,
renderer::camera::Z_MIN,
renderer::camera::Z_MAX});
renderer::camera::X_BOUND_MIN,
renderer::camera::X_BOUND_MAX,
renderer::camera::Y_BOUND_MIN,
renderer::camera::Y_BOUND_MAX,
renderer::camera::Z_BOUND_MIN,
renderer::camera::Z_BOUND_MAX});

// Skybox
this->skybox_renderer = std::make_shared<renderer::skybox::SkyboxRenderStage>(
Expand Down
9 changes: 7 additions & 2 deletions libopenage/renderer/camera/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ static constexpr CameraBoundaries DEFAULT_CAM_BOUNDARIES{
std::numeric_limits<float>::max()};

/**
* Constant values for the camera bounds.
* Constant values for the camera bounds (based on current fix terrain grid of 20x20).
* TODO: Make boundaries dynamic based on map size.
*/
static constexpr float X_MIN = 12.25f, X_MAX = 32.25f, Y_MIN = 0.0f, Y_MAX = 20.0f, Z_MIN = -8.25f, Z_MAX = 12.25f;
static constexpr float X_BOUND_MIN = 12.25f;
static constexpr float X_BOUND_MAX = 32.25f;
static constexpr float Y_BOUND_MIN = 0.0f;
static constexpr float Y_BOUND_MAX = 20.0f;
static constexpr float Z_BOUND_MIN = -8.25f;
static constexpr float Z_BOUND_MAX = 12.25f;

} // namespace openage::renderer::camera

0 comments on commit 6d6a2dd

Please sign in to comment.