Camera::resolution is of type (f32, f32), why? #89

Closed
opened 2025-01-11 21:36:57 +00:00 by Gipson62 · 0 comments
Gipson62 commented 2025-01-11 21:36:57 +00:00 (Migrated from github.com)

In header::Camera the resolution fields is of type (f32, f32) which doesn't really make sense, it should be either a nalgebra::VecI32 (or U32 for that matters) or a custom type Vector2i like the other vectors types

/// Container for the camera feature. The settings here are needed for
/// algebra equations needed for camera vision and movement. Please leave it to the renderer to handle
#[derive(Debug)]
pub struct Camera {
    /// The position of the camera in 3D space
    pub position: Vector3,
    /// The target at which the camera should be looking
    pub target: Vector3,
    /// The up vector of the camera. This defines the elevation of the camera
    pub up: Vector3,
    /// The resolution of the camera view
    pub resolution: (f32, f32), //maybe this should be a Vector2i
    /// The projection of the camera
    pub projection: Projection,
    /// The closest view of camera
    pub near: f32,
    /// The furthest view of camera
    pub far: f32,
    /// The final data that will be sent to GPU
    pub view_data: nalgebra_glm::Mat4,
    // For checking and rebuilding it's uniform buffer
    pub(crate) changed: bool,
    /// The uniform data of the camera to be sent to the gpu
    pub uniform_data: UniformBuffers,
    /// The position and target of the camera
    pub(crate) add_position_and_target: bool,
}
In `header::Camera` the resolution fields is of type `(f32, f32)` which doesn't really make sense, it should be either a `nalgebra::VecI32` (or `U32` for that matters) or a custom type `Vector2i` like the other vectors types ```rs /// Container for the camera feature. The settings here are needed for /// algebra equations needed for camera vision and movement. Please leave it to the renderer to handle #[derive(Debug)] pub struct Camera { /// The position of the camera in 3D space pub position: Vector3, /// The target at which the camera should be looking pub target: Vector3, /// The up vector of the camera. This defines the elevation of the camera pub up: Vector3, /// The resolution of the camera view pub resolution: (f32, f32), //maybe this should be a Vector2i /// The projection of the camera pub projection: Projection, /// The closest view of camera pub near: f32, /// The furthest view of camera pub far: f32, /// The final data that will be sent to GPU pub view_data: nalgebra_glm::Mat4, // For checking and rebuilding it's uniform buffer pub(crate) changed: bool, /// The uniform data of the camera to be sent to the gpu pub uniform_data: UniformBuffers, /// The position and target of the camera pub(crate) add_position_and_target: bool, } ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ArkForgeLabs/BlueEngine#89
No description provided.