Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::EnvironmentProbeComponent Class Referencefinal

#include <EnvironmentProbeComponent.h>

+ Inheritance diagram for Divide::EnvironmentProbeComponent:

Classes

struct  Names
 

Public Types

enum class  ProbeType : U8 { TYPE_INFINITE = 0 , TYPE_LOCAL , COUNT }
 
enum class  UpdateType : U8 {
  ALWAYS = 0 , ON_DIRTY , ON_RATE , ONCE ,
  COUNT
}
 

Public Member Functions

 EnvironmentProbeComponent (SceneGraphNode *sgn, PlatformContext &context)
 
 ~EnvironmentProbeComponent () override
 
bool refresh (GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
 Returns true if the probe was updated, false if skipped.
 
bool checkCollisionAndQueueUpdate (const BoundingSphere &sphere) noexcept
 Checks if the given bounding sphere has collided with the probe's AABB and if so, mark it for update if required.
 
void updateType (UpdateType type)
 
void setBounds (const vec3< F32 > &min, const vec3< F32 > &max) noexcept
 
void setBounds (const vec3< F32 > &center, F32 radius) noexcept
 
void loadFromXML (const boost::property_tree::ptree &pt) override
 
F32 distanceSqTo (const vec3< F32 > &pos) const noexcept
 
void queueRefresh () noexcept
 
bool enabled () const override
 
void enabled (bool state) override
 
 PROPERTY_R_IW (U16, rtLayerIndex, 0u)
 
 PROPERTY_RW (bool, showParallaxAABB, false)
 
 PROPERTY_RW (bool, dirty, true)
 
 PROPERTY_RW (U8, updateRate, 1u)
 
 PROPERTY_R (UpdateType, updateType, UpdateType::ON_DIRTY)
 
 PROPERTY_R (U16, poolIndex, 0u)
 
const BoundingBoxgetBounds () const noexcept
 
- Public Member Functions inherited from Divide::GUIDWrapper
 GUIDWrapper () noexcept
 
 GUIDWrapper (const GUIDWrapper &old) noexcept
 
 GUIDWrapper (GUIDWrapper &&old) noexcept
 
virtual ~GUIDWrapper ()=default
 
FORCE_INLINE I64 getGUID () const noexcept
 
GUIDWrapperoperator= (const GUIDWrapper &old)=delete
 
GUIDWrapperoperator= (GUIDWrapper &&other)=delete
 

Protected Member Functions

void poolIndex (U16 index) noexcept
 
void OnData (const ECS::CustomEvent &data) override
 
SceneGraphNodefindNodeToIgnore () const noexcept
 
void updateProbeData () const noexcept
 

Protected Attributes

BoundingBox _aabb { vec3<F32>(-1), vec3<F32>(1) }
 
BoundingBox _refaabb { vec3<F32>(-1), vec3<F32>(1) }
 
U8 _currentUpdateCall = 0u
 
ProbeType _probeType = ProbeType::TYPE_LOCAL
 
- Protected Attributes inherited from Divide::GUIDWrapper
const I64 _guid
 

Private Types

using Parent = BaseComponentType< EnvironmentProbeComponent, ComponentType::ENVIRONMENT_PROBE >
 

Private Attributes

bool _queueRefresh = true
 
bool _drawImpostor = false
 

Friends

class EnvironmentProbeSystem
 
class SceneEnvironmentProbePool
 

Additional Inherited Members

- Static Public Member Functions inherited from Divide::GUIDWrapper
static I64 generateGUID () noexcept
 

Detailed Description

Definition at line 54 of file EnvironmentProbeComponent.h.

Member Typedef Documentation

◆ Parent

Member Enumeration Documentation

◆ ProbeType

Enumerator
TYPE_INFINITE 
TYPE_LOCAL 
COUNT 

Definition at line 57 of file EnvironmentProbeComponent.h.

◆ UpdateType

Enumerator
ALWAYS 
ON_DIRTY 
ON_RATE 
ONCE 
COUNT 

Definition at line 63 of file EnvironmentProbeComponent.h.

Constructor & Destructor Documentation

◆ EnvironmentProbeComponent()

Divide::EnvironmentProbeComponent::EnvironmentProbeComponent ( SceneGraphNode sgn,
PlatformContext context 
)
explicit

Definition at line 37 of file EnvironmentProbeComponent.cpp.

◆ ~EnvironmentProbeComponent()

Divide::EnvironmentProbeComponent::~EnvironmentProbeComponent ( )
override

Definition at line 133 of file EnvironmentProbeComponent.cpp.

Member Function Documentation

◆ checkCollisionAndQueueUpdate()

bool Divide::EnvironmentProbeComponent::checkCollisionAndQueueUpdate ( const BoundingSphere sphere)
noexcept

Checks if the given bounding sphere has collided with the probe's AABB and if so, mark it for update if required.

Definition at line 160 of file EnvironmentProbeComponent.cpp.

◆ distanceSqTo()

F32 Divide::EnvironmentProbeComponent::distanceSqTo ( const vec3< F32 > &  pos) const
noexcept

Definition at line 299 of file EnvironmentProbeComponent.cpp.

◆ enabled() [1/2]

bool Divide::EnvironmentProbeComponent::enabled ( ) const
override

Definition at line 232 of file EnvironmentProbeComponent.cpp.

◆ enabled() [2/2]

void Divide::EnvironmentProbeComponent::enabled ( bool  state)
override

Definition at line 237 of file EnvironmentProbeComponent.cpp.

◆ findNodeToIgnore()

SceneGraphNode * Divide::EnvironmentProbeComponent::findNodeToIgnore ( ) const
protectednoexcept

Definition at line 139 of file EnvironmentProbeComponent.cpp.

◆ getBounds()

const BoundingBox & Divide::EnvironmentProbeComponent::getBounds ( ) const
inlinenoexcept

Definition at line 110 of file EnvironmentProbeComponent.h.

◆ loadFromXML()

void Divide::EnvironmentProbeComponent::loadFromXML ( const boost::property_tree::ptree &  pt)
override

Definition at line 317 of file EnvironmentProbeComponent.cpp.

◆ OnData()

void Divide::EnvironmentProbeComponent::OnData ( const ECS::CustomEvent data)
overrideprotected

Definition at line 303 of file EnvironmentProbeComponent.cpp.

◆ poolIndex()

void Divide::EnvironmentProbeComponent::poolIndex ( U16  index)
protectednoexcept

Definition at line 252 of file EnvironmentProbeComponent.cpp.

◆ PROPERTY_R() [1/2]

Divide::EnvironmentProbeComponent::PROPERTY_R ( U16  ,
poolIndex  ,
0u   
)

◆ PROPERTY_R() [2/2]

Divide::EnvironmentProbeComponent::PROPERTY_R ( UpdateType  ,
updateType  ,
UpdateType::ON_DIRTY   
)

◆ PROPERTY_R_IW()

Divide::EnvironmentProbeComponent::PROPERTY_R_IW ( U16  ,
rtLayerIndex  ,
0u   
)

◆ PROPERTY_RW() [1/3]

Divide::EnvironmentProbeComponent::PROPERTY_RW ( bool  ,
dirty  ,
true   
)

◆ PROPERTY_RW() [2/3]

Divide::EnvironmentProbeComponent::PROPERTY_RW ( bool  ,
showParallaxAABB  ,
false   
)

◆ PROPERTY_RW() [3/3]

Divide::EnvironmentProbeComponent::PROPERTY_RW ( U8  ,
updateRate  ,
1u   
)

◆ queueRefresh()

void Divide::EnvironmentProbeComponent::queueRefresh ( )
inlinenoexcept

Definition at line 97 of file EnvironmentProbeComponent.h.

◆ refresh()

bool Divide::EnvironmentProbeComponent::refresh ( GFX::CommandBuffer bufferInOut,
GFX::MemoryBarrierCommand memCmdInOut 
)

Returns true if the probe was updated, false if skipped.

Definition at line 168 of file EnvironmentProbeComponent.cpp.

◆ setBounds() [1/2]

void Divide::EnvironmentProbeComponent::setBounds ( const vec3< F32 > &  center,
F32  radius 
)
noexcept

Definition at line 262 of file EnvironmentProbeComponent.cpp.

◆ setBounds() [2/2]

void Divide::EnvironmentProbeComponent::setBounds ( const vec3< F32 > &  min,
const vec3< F32 > &  max 
)
noexcept

Definition at line 257 of file EnvironmentProbeComponent.cpp.

◆ updateProbeData()

void Divide::EnvironmentProbeComponent::updateProbeData ( ) const
protectednoexcept

Definition at line 247 of file EnvironmentProbeComponent.cpp.

◆ updateType()

void Divide::EnvironmentProbeComponent::updateType ( UpdateType  type)

Definition at line 267 of file EnvironmentProbeComponent.cpp.

Friends And Related Function Documentation

◆ EnvironmentProbeSystem

friend class EnvironmentProbeSystem
friend

Definition at line 54 of file EnvironmentProbeComponent.h.

◆ SceneEnvironmentProbePool

friend class SceneEnvironmentProbePool
friend

Definition at line 112 of file EnvironmentProbeComponent.h.

Member Data Documentation

◆ _aabb

BoundingBox Divide::EnvironmentProbeComponent::_aabb { vec3<F32>(-1), vec3<F32>(1) }
protected

Definition at line 121 of file EnvironmentProbeComponent.h.

◆ _currentUpdateCall

U8 Divide::EnvironmentProbeComponent::_currentUpdateCall = 0u
protected

Definition at line 124 of file EnvironmentProbeComponent.h.

◆ _drawImpostor

bool Divide::EnvironmentProbeComponent::_drawImpostor = false
private

Definition at line 129 of file EnvironmentProbeComponent.h.

◆ _probeType

ProbeType Divide::EnvironmentProbeComponent::_probeType = ProbeType::TYPE_LOCAL
protected

Definition at line 125 of file EnvironmentProbeComponent.h.

◆ _queueRefresh

bool Divide::EnvironmentProbeComponent::_queueRefresh = true
private

Definition at line 128 of file EnvironmentProbeComponent.h.

◆ _refaabb

BoundingBox Divide::EnvironmentProbeComponent::_refaabb { vec3<F32>(-1), vec3<F32>(1) }
protected

Definition at line 122 of file EnvironmentProbeComponent.h.


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