Cogs.Core
|
Public Member Functions | |
BasicOceanSystem (Memory::Allocator *allocator, SizeType capacity) | |
void | initialize (Context *context) override |
Initialize the system. | |
void | cleanup (Context *context) override |
Provided for custom cleanup logic in derived systems. | |
void | update (Context *context) override |
Provided for custom update logic in derived systems. | |
void | postUpdate (Context *context) override |
Provided for custom post update logic in derived systems. | |
TextureHandle | getRealTex () const |
TextureHandle | getImagTex () const |
TextureHandle | getTangentTex () const |
float | getTileScale () const |
float | getSignificantWaveHeight () const |
![]() | |
ComponentSystemWithDataPool (Memory::Allocator *allocator, SizeType size=1024) | |
BasicOceanData & | getData (const BasicOceanComponent *component) |
const BasicOceanData & | getData (const BasicOceanComponent *component) const |
![]() | |
ComponentSystemWithDataPools (Memory::Allocator *allocator, SizeType size=1024, MemBlockType componentMemType=MemBlockType::Component, MemBlockType dataMemType=MemBlockType::ComponentData) | |
ComponentHandle | createComponent () override |
void | destroyComponent (ComponentHandle component) override |
template<typename T > | |
T & | getData (const ComponentType *component) |
Get the data stored for the given component from the data pool storing objects of the specified template type. | |
template<typename T > | |
const T & | getData (const ComponentType *component) const |
Get the const data stored for the given component from the data pool storing objects of the specified template type. | |
![]() | |
ComponentSystem (Memory::Allocator *allocator, SizeType size=16384, MemBlockType componentMemType=MemBlockType::Component) | |
void | instrumentedPreUpdate () override |
Provided for tagged engine instrumentation. | |
void | instrumentedUpdate () override |
Provided for tagged engine instrumentation. | |
void | instrumentedPostUpdate () override |
Provided for tagged engine instrumentation. | |
ComponentHandle | createComponent () override |
Create a new component instance. | |
void | destroyComponent (ComponentHandle component) override |
Destroy the component held by the given handle. | |
SizeType | getComponentIndex (const Component *component) const |
Get the index of the given component in the component pool. | |
size_t | size () |
Returns the number of active components. | |
void | clearCarryFlags () |
Clear carry flags of all active components. | |
void | resetFlags () |
Reset the flags of all active components. | |
void | prepareUpdate (Context *) override |
void | postUpdate (Context *) override |
ComponentHandle | getHandle (const ComponentType *component) |
Get a handle to the given Component instance. | |
virtual void | addEntitiesWithComponent (std::vector< EntityId > &entities, Reflection::TypeId componentTypeId) override |
Return all entities with a given. | |
![]() | |
virtual | ~ComponentSystemBase () |
Provided for destruction via pointer to base. | |
ComponentSystemBase (Reflection::TypeId componentType) | |
Constructs a ComponentSystemBase to manage components of the given componentType. | |
virtual void | initialize (Context *context) |
Initialize the system. | |
void | preUpdate () |
Run the pre-update method of the system. | |
void | update () |
Updates the system state to that of the current frame. | |
void | postUpdate () |
Perform post update logic in the system. | |
virtual void | preUpdate (Context *) |
Provided for custom pre update logic in derived systems. | |
virtual void | prepareUpdate (Context *) |
Provided for custom update preparation logic in derived systems. | |
virtual void | update (Context *) |
Provided for custom update logic in derived systems. | |
virtual void | postUpdate (Context *) |
Provided for custom post update logic in derived systems. | |
virtual void | instrumentedPreUpdate () |
Provided for tagged engine instrumentation. | |
virtual void | instrumentedUpdate () |
Provided for tagged engine instrumentation. | |
virtual void | instrumentedPostUpdate () |
Provided for tagged engine instrumentation. | |
virtual void | addEntitiesWithComponent (std::vector< EntityId > &, Reflection::TypeId) |
Return all entities with a given. | |
virtual void | cleanup (Context *) |
Provided for custom cleanup logic in derived systems. | |
virtual ComponentHandle | createComponent () |
Create a new component instance. | |
virtual void | destroyComponent (ComponentHandle) |
Destroy the component held by the given handle. | |
Reflection::TypeId | getComponentType () const |
Get the reflected type of the components managed by this system. | |
Private Member Functions | |
void | setupMaterial () |
void | updateTextureResolution (BasicOceanComponent *oceanComp) |
void | setupWaveSpectrum () |
void | updateTextures (const float magnitudeIn0, const float magnitudeIn1) |
void | updateTileMaterialInstances (const BasicOceanData &oceanData, class AdaptivePlanarGridComponent *gridComp, struct AdaptivePlanarGridData &gridData, const glm::mat4 &viewToWorld, const glm::vec2 &viewPortSize) |
Additional Inherited Members | |
![]() | |
typedef ComponentType | component_type |
![]() | |
static Reflection::TypeId | getTypeId () |
Get the type id of the component type used by the system. | |
![]() | |
ComponentPool< ComponentType > | pool |
Pool of components managed by the system. | |
![]() | |
Reflection::TypeId | componentType |
The type of components managed by this instance. | |
Context * | context = nullptr |
Pointer to the Context instance the system lives in. | |
Definition at line 110 of file BasicOceanSystem.h.
|
inline |
Definition at line 113 of file BasicOceanSystem.h.
|
overridevirtual |
Provided for custom cleanup logic in derived systems.
Cleanup is performed during shutdown of the system, and all entities and related data should have been deleted.
All system services are available during the execution of cleanup().
Reimplemented from Cogs::Core::ComponentSystemBase.
Definition at line 940 of file BasicOceanSystem.cpp.
References Cogs::Core::Context::taskManager.
|
inline |
Definition at line 121 of file BasicOceanSystem.h.
|
inline |
Definition at line 120 of file BasicOceanSystem.h.
|
inline |
Definition at line 125 of file BasicOceanSystem.h.
|
inline |
Definition at line 122 of file BasicOceanSystem.h.
|
inline |
Definition at line 124 of file BasicOceanSystem.h.
|
overridevirtual |
Initialize the system.
Initialization is performed after all systems are created and a renderer initialized, but before the first time anything is rendered.
context | Pointer to the context the system lives in. |
Reimplemented from Cogs::Core::ComponentSystemBase.
Definition at line 913 of file BasicOceanSystem.cpp.
References Cogs::Core::ComponentSystemBase::context, Cogs::Core::TaskManager::GlobalQueue, Cogs::Core::ComponentSystemBase::initialize(), Cogs::Core::ResourceBase::setName(), Cogs::Core::Context::taskManager, and Cogs::Core::Context::variables.
|
overridevirtual |
Provided for custom post update logic in derived systems.
Reimplemented from Cogs::Core::ComponentSystemBase.
Definition at line 1465 of file BasicOceanSystem.cpp.
References Cogs::ComponentModel::Component::getComponent(), Cogs::Core::ComponentSystemBase::postUpdate(), and Cogs::Core::Context::taskManager.
|
private |
Definition at line 954 of file BasicOceanSystem.cpp.
|
private |
Definition at line 1018 of file BasicOceanSystem.cpp.
|
overridevirtual |
Provided for custom update logic in derived systems.
Reimplemented from Cogs::Core::ComponentSystemBase.
Definition at line 1221 of file BasicOceanSystem.cpp.
References Cogs::Core::BasicOceanComponent::color, Cogs::Core::EntityStore::createChildEntity(), Cogs::Core::EntityStore::destroyEntity(), Cogs::Core::EnableRender, Cogs::Core::Context::engine, Cogs::Core::CameraComponent::flags, Cogs::ComponentModel::Component::getComponent(), Cogs::Core::TaskManager::GlobalQueue, Cogs::ComponentModel::Component::hasChanged(), Cogs::Core::BasicOceanComponent::reflectionBrightness, Cogs::Core::BasicOceanComponent::seaLevel, Cogs::ComponentModel::Component::setChanged(), Cogs::Core::Context::store, Cogs::Core::Context::taskManager, Cogs::Core::Context::time, Cogs::Core::BasicOceanComponent::transparency, Cogs::Core::Context::variables, and Cogs::Core::CameraComponent::viewportSize.
|
private |
Definition at line 997 of file BasicOceanSystem.cpp.
|
private |
Definition at line 1050 of file BasicOceanSystem.cpp.
|
private |
Definition at line 1175 of file BasicOceanSystem.cpp.
|
private |
Definition at line 144 of file BasicOceanSystem.h.
|
private |
Definition at line 193 of file BasicOceanSystem.h.
|
private |
Definition at line 187 of file BasicOceanSystem.h.
|
private |
Definition at line 192 of file BasicOceanSystem.h.
float Cogs::Core::BasicOceanSystem::channel0 = std::numeric_limits<float>::quiet_NaN() |
Definition at line 139 of file BasicOceanSystem.h.
float Cogs::Core::BasicOceanSystem::channel1 = std::numeric_limits<float>::quiet_NaN() |
Definition at line 140 of file BasicOceanSystem.h.
|
private |
Definition at line 182 of file BasicOceanSystem.h.
|
private |
Definition at line 175 of file BasicOceanSystem.h.
|
private |
Definition at line 131 of file BasicOceanSystem.h.
|
private |
Use eight bit texture format for wave displacement.
Definition at line 147 of file BasicOceanSystem.h.
|
private |
Definition at line 148 of file BasicOceanSystem.h.
|
private |
Definition at line 173 of file BasicOceanSystem.h.
|
private |
Definition at line 167 of file BasicOceanSystem.h.
|
private |
Definition at line 168 of file BasicOceanSystem.h.
|
private |
Definition at line 169 of file BasicOceanSystem.h.
|
private |
Definition at line 170 of file BasicOceanSystem.h.
|
private |
Definition at line 171 of file BasicOceanSystem.h.
|
private |
Size of FFT-tile in meters, set up setupWaveSpectrum.
Definition at line 128 of file BasicOceanSystem.h.
|
private |
Definition at line 129 of file BasicOceanSystem.h.
|
private |
Definition at line 191 of file BasicOceanSystem.h.
|
private |
Definition at line 158 of file BasicOceanSystem.h.
|
private |
Definition at line 159 of file BasicOceanSystem.h.
|
private |
Definition at line 156 of file BasicOceanSystem.h.
|
private |
Definition at line 157 of file BasicOceanSystem.h.
|
private |
Definition at line 155 of file BasicOceanSystem.h.
|
private |
Definition at line 154 of file BasicOceanSystem.h.
|
private |
Definition at line 183 of file BasicOceanSystem.h.
|
private |
Definition at line 176 of file BasicOceanSystem.h.
|
private |
Definition at line 180 of file BasicOceanSystem.h.
|
private |
Definition at line 181 of file BasicOceanSystem.h.
|
private |
Definition at line 150 of file BasicOceanSystem.h.
|
private |
Definition at line 152 of file BasicOceanSystem.h.
|
private |
Frequency of phase shift noise wrt FFT tile size.
Definition at line 134 of file BasicOceanSystem.h.
|
private |
Definition at line 195 of file BasicOceanSystem.h.
|
private |
Definition at line 196 of file BasicOceanSystem.h.
|
private |
Definition at line 186 of file BasicOceanSystem.h.
|
private |
Definition at line 197 of file BasicOceanSystem.h.
|
private |
Definition at line 178 of file BasicOceanSystem.h.
|
private |
Definition at line 194 of file BasicOceanSystem.h.
|
private |
Definition at line 130 of file BasicOceanSystem.h.
|
private |
Definition at line 190 of file BasicOceanSystem.h.
|
private |
Definition at line 185 of file BasicOceanSystem.h.
|
private |
Definition at line 164 of file BasicOceanSystem.h.
|
private |
Definition at line 165 of file BasicOceanSystem.h.
|
private |
Definition at line 162 of file BasicOceanSystem.h.
|
private |
Definition at line 163 of file BasicOceanSystem.h.
|
private |
Definition at line 161 of file BasicOceanSystem.h.
|
private |
Definition at line 145 of file BasicOceanSystem.h.
|
private |
Definition at line 184 of file BasicOceanSystem.h.
|
private |
Definition at line 177 of file BasicOceanSystem.h.
|
private |
Number of FFT-tiles before ocean repeats itself.
Definition at line 135 of file BasicOceanSystem.h.
|
private |
Definition at line 188 of file BasicOceanSystem.h.
|
private |
Definition at line 189 of file BasicOceanSystem.h.
|
private |
Definition at line 136 of file BasicOceanSystem.h.
|
private |
Definition at line 133 of file BasicOceanSystem.h.
|
private |
Definition at line 132 of file BasicOceanSystem.h.