Skip to content

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

@Gipson62

Description

@Gipson62

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,
}

Metadata

Metadata

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions