Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::reflection_probe_component Class Reference

Class that contains core reflection probe data, used for rendering and other purposes. More...

#include <reflection_probe_component.h>

Inheritance diagram for unravel::reflection_probe_component:
unravel::component_crtp< reflection_probe_component > unravel::basic_component

Public Member Functions

auto get_probe () const -> const reflection_probe &
 Gets the reflection probe object.
 
void set_probe (const reflection_probe &probe)
 Sets the reflection probe object.
 
auto get_bounds () const -> math::bbox
 Gets the bounding box of the probe object.
 
auto compute_projected_sphere_rect (irect32_t &rect, const math::vec3 &position, const math::vec3 &scale, const math::vec3 &view_origin, const math::transform &view, const math::transform &proj) const -> int
 Computes the projected sphere rectangle.
 
auto get_render_view (size_t idx) -> gfx::render_view &
 Gets the render view.
 
auto get_cubemap_prefiltered () -> const gfx::texture::ptr &
 Gets the cubemap texture.
 
auto get_cubemap () -> const gfx::texture::ptr &
 
auto get_cubemap_fbo (size_t face) -> const gfx::frame_buffer::ptr &
 Gets the cubemap frame buffer object (FBO).
 
void update ()
 Updates the reflection probe component.
 
auto already_generated () const -> bool
 Check if the cubemap was generated this frame.
 
auto already_generated (size_t face) const -> bool
 Check if the cubemap's face was generated this frame.
 
void set_generation_frame (size_t face, uint64_t frame)
 marks the genrerated face this frame
 
auto get_faces_per_frame () const -> size_t
 Gets the number of faces generated per frame.
 
void set_faces_per_frame (size_t faces)
 Sets the number of faces generated per frame.
 
auto get_apply_prefilter () const -> bool
 Gets whether prefiltering is applied.
 
void set_apply_prefilter (bool apply)
 Sets whether to apply prefiltering.
 
- Public Member Functions inherited from unravel::basic_component
void touch ()
 Marks the component as 'touched'.
 

Additional Inherited Members

- Public Types inherited from unravel::component_crtp< reflection_probe_component >
using base
 
- Public Attributes inherited from unravel::basic_component
bool eto {}
 Disable empty type optimizations.
 
- Static Public Attributes inherited from unravel::component_crtp< reflection_probe_component >
static constexpr bool in_place_delete
 Indicates if the component can be deleted in place.
 

Detailed Description

Class that contains core reflection probe data, used for rendering and other purposes.

Definition at line 18 of file reflection_probe_component.h.

Member Function Documentation

◆ already_generated() [1/2]

auto unravel::reflection_probe_component::already_generated ( ) const -> bool

Check if the cubemap was generated this frame.

Returns
A bool indicating whether the faces was already generated

Definition at line 179 of file reflection_probe_component.cpp.

◆ already_generated() [2/2]

auto unravel::reflection_probe_component::already_generated ( size_t face) const -> bool

Check if the cubemap's face was generated this frame.

Returns
A bool indicating whether the face was already generated.

Definition at line 190 of file reflection_probe_component.cpp.

◆ compute_projected_sphere_rect()

auto unravel::reflection_probe_component::compute_projected_sphere_rect ( irect32_t & rect,
const math::vec3 & position,
const math::vec3 & scale,
const math::vec3 & view_origin,
const math::transform & view,
const math::transform & proj ) const -> int

Computes the projected sphere rectangle.

Parameters
[out]rectReference to the rectangle to be computed.
[in]positionThe position of the reflection probe.
[in]view_originThe origin of the view.
[in]viewThe view transform.
[in]projThe projection transform.
Returns
An integer indicating the result of the computation.

Definition at line 26 of file reflection_probe_component.cpp.

◆ get_apply_prefilter()

auto unravel::reflection_probe_component::get_apply_prefilter ( ) const -> bool
inline

Gets whether prefiltering is applied.

Returns
True if prefiltering is applied, false otherwise.

Definition at line 113 of file reflection_probe_component.h.

◆ get_bounds()

auto unravel::reflection_probe_component::get_bounds ( ) const -> math::bbox

Gets the bounding box of the probe object.

Definition at line 6 of file reflection_probe_component.cpp.

◆ get_cubemap()

auto unravel::reflection_probe_component::get_cubemap ( ) -> const gfx::texture::ptr&

Definition at line 74 of file reflection_probe_component.cpp.

◆ get_cubemap_fbo()

auto unravel::reflection_probe_component::get_cubemap_fbo ( size_t face) -> const gfx::frame_buffer::ptr&

Gets the cubemap frame buffer object (FBO).

Returns
A shared pointer to the cubemap frame buffer object.

Definition at line 106 of file reflection_probe_component.cpp.

◆ get_cubemap_prefiltered()

auto unravel::reflection_probe_component::get_cubemap_prefiltered ( ) -> const gfx::texture::ptr&

Gets the cubemap texture.

Returns
A shared pointer to the cubemap texture.

Definition at line 90 of file reflection_probe_component.cpp.

◆ get_faces_per_frame()

auto unravel::reflection_probe_component::get_faces_per_frame ( ) const -> size_t
inline

Gets the number of faces generated per frame.

Returns
The number of faces generated per frame.

Definition at line 101 of file reflection_probe_component.h.

◆ get_probe()

auto unravel::reflection_probe_component::get_probe ( ) const -> const reflection_probe&

Gets the reflection probe object.

Returns
A constant reference to the reflection probe object.

Definition at line 162 of file reflection_probe_component.cpp.

◆ get_render_view()

auto unravel::reflection_probe_component::get_render_view ( size_t idx) -> gfx::render_view&

Gets the render view.

Parameters
[in]idxThe index of the render view to get.
Returns
A reference to the render view.

Definition at line 69 of file reflection_probe_component.cpp.

◆ set_apply_prefilter()

void unravel::reflection_probe_component::set_apply_prefilter ( bool apply)
inline

Sets whether to apply prefiltering.

Parameters
applyTrue to apply prefiltering, false otherwise.

Definition at line 119 of file reflection_probe_component.h.

◆ set_faces_per_frame()

void unravel::reflection_probe_component::set_faces_per_frame ( size_t faces)
inline

Sets the number of faces generated per frame.

Parameters
facesThe number of faces to generate per frame.

Definition at line 107 of file reflection_probe_component.h.

◆ set_generation_frame()

void unravel::reflection_probe_component::set_generation_frame ( size_t face,
uint64_t frame )

marks the genrerated face this frame

Definition at line 203 of file reflection_probe_component.cpp.

◆ set_probe()

void unravel::reflection_probe_component::set_probe ( const reflection_probe & probe)

Sets the reflection probe object.

Parameters
[in]probeThe reflection probe object to set.

Definition at line 167 of file reflection_probe_component.cpp.

◆ update()

void unravel::reflection_probe_component::update ( )

Updates the reflection probe component.

Definition at line 136 of file reflection_probe_component.cpp.


The documentation for this class was generated from the following files: