Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
DefaultPipeline::Resource::TransformGPUBuffer Class Reference

#include <TransformGPUBuffer.hpp>

Inheritance diagram for DefaultPipeline::Resource::TransformGPUBuffer:
Graphic::Resource::AGPUBuffer

Public Member Functions

 TransformGPUBuffer (Engine::Entity entity)
 ~TransformGPUBuffer () override
void Create (Engine::Core &core) override
void Destroy (Engine::Core &core) override
void Destroy ()
bool IsCreated (Engine::Core &core) const override
void Update (Engine::Core &core) override
const wgpu::Buffer & GetBuffer () const override
Public Member Functions inherited from Graphic::Resource::AGPUBuffer
virtual ~AGPUBuffer ()=default

Private Member Functions

wgpu::Buffer _CreateBuffer (const Graphic::Resource::DeviceContext &context)
void _UpdateBuffer (const Object::Component::Transform &transformComponent, const Graphic::Resource::Context &context)
 Update the GPU buffer with the entity's current model and normal matrices.

Private Attributes

wgpu::Buffer _buffer
bool _isCreated = false
Engine::Entity _entity

Constructor & Destructor Documentation

◆ TransformGPUBuffer()

DefaultPipeline::Resource::TransformGPUBuffer::TransformGPUBuffer ( Engine::Entity entity)
inlineexplicit

◆ ~TransformGPUBuffer()

DefaultPipeline::Resource::TransformGPUBuffer::~TransformGPUBuffer ( )
inlineoverride

Member Function Documentation

◆ _CreateBuffer()

wgpu::Buffer DefaultPipeline::Resource::TransformGPUBuffer::_CreateBuffer ( const Graphic::Resource::DeviceContext & context)
inlineprivate

◆ _UpdateBuffer()

void DefaultPipeline::Resource::TransformGPUBuffer::_UpdateBuffer ( const Object::Component::Transform & transformComponent,
const Graphic::Resource::Context & context )
inlineprivate

Update the GPU buffer with the entity's current model and normal matrices.

Computes the model matrix from the provided Transform component, derives the normal matrix as the transpose of the inverse of the model matrix, packs both into a TransformGPUData instance, and writes the data to the GPU buffer at offset 0 using the provided graphics context queue.

Parameters
transformComponentComponent used to compute the model transformation matrix.
contextGraphics context containing the queue used to write to the GPU buffer.

◆ Create()

void DefaultPipeline::Resource::TransformGPUBuffer::Create ( Engine::Core & core)
inlineoverridevirtual

◆ Destroy() [1/2]

void DefaultPipeline::Resource::TransformGPUBuffer::Destroy ( )
inline

◆ Destroy() [2/2]

void DefaultPipeline::Resource::TransformGPUBuffer::Destroy ( Engine::Core & core)
inlineoverridevirtual

◆ GetBuffer()

const wgpu::Buffer & DefaultPipeline::Resource::TransformGPUBuffer::GetBuffer ( ) const
inlineoverridevirtual

◆ IsCreated()

bool DefaultPipeline::Resource::TransformGPUBuffer::IsCreated ( Engine::Core & core) const
inlineoverridevirtual

◆ Update()

void DefaultPipeline::Resource::TransformGPUBuffer::Update ( Engine::Core & core)
inlineoverridevirtual

Member Data Documentation

◆ _buffer

wgpu::Buffer DefaultPipeline::Resource::TransformGPUBuffer::_buffer
private

◆ _entity

Engine::Entity DefaultPipeline::Resource::TransformGPUBuffer::_entity
private

◆ _isCreated

bool DefaultPipeline::Resource::TransformGPUBuffer::_isCreated = false
private

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