Toast Engine
Loading...
Searching...
No Matches
physics::DebrisSimulation Class Reference
Inheritance diagram for physics::DebrisSimulation:
Collaboration diagram for physics::DebrisSimulation:

Classes

struct  GpuParticle
struct  GpuMotion
struct  GpuSpawn
struct  GpuVolume

Public Member Functions

 DebrisSimulation (uint32_t capacity)
 DebrisSimulation (const DebrisSimulation &)=delete
auto operator= (const DebrisSimulation &) -> DebrisSimulation &=delete
 DebrisSimulation (DebrisSimulation &&)=delete
auto operator= (DebrisSimulation &&) -> DebrisSimulation &=delete
void spawn (std::span< const DebrisSpawn > spawns)
void step (uint32_t steps, double fixed_delta, std::shared_ptr< const renderer::VoxelCollisionWorld > world)
void setDisplayAlpha (float alpha, double fixed_delta)
void clear ()
auto capacity () const -> uint32_t
auto visible () const -> bool
auto extrapolation (uint64_t step) const -> float
auto frameDelta () const -> float
auto particlesId () const -> BufferId
auto drawListId () const -> BufferId
auto drawArgsId () const -> BufferId
Public Member Functions inherited from renderer::AsyncComputeTask
 AsyncComputeTask (const AsyncComputeTask &)=delete
auto operator= (const AsyncComputeTask &) -> AsyncComputeTask &=delete
 AsyncComputeTask (AsyncComputeTask &&)=delete
auto operator= (AsyncComputeTask &&) -> AsyncComputeTask &=delete
auto acquireForFrame (vk::CommandBuffer cmd, uint32_t frame_index, sync::Usage next) -> FrameView
auto read (BufferId id, std::span< std::byte > out) -> bool
 Newest finished CPU copy of a ring buffer added with cpu_readback and false until one exists.
template<typename T>
auto read (BufferId id, std::span< T > out) -> bool
auto finishedStep () const -> uint64_t
 Steps finished so far.
auto isReady () const -> bool

Static Public Member Functions

static auto get () -> DebrisSimulation *

Static Public Attributes

static constexpr uint32_t k_max_spawns_per_step = 4096
static constexpr uint32_t k_max_volumes = 512
static constexpr uint32_t k_voxels_per_particle = 8

Additional Inherited Members

Public Types inherited from renderer::AsyncComputeTask
enum class  Copy : uint8_t { current , previous }
 Which copy of a ring buffer a binding sees during a step. More...
using BufferId = uint32_t
Protected Member Functions inherited from renderer::AsyncComputeTask
 AsyncComputeTask (Config config)
auto addRingBuffer (vk::DeviceSize size, bool cpu_readback=false) -> BufferId
 Constructor only.
auto addPersistentBuffer (vk::DeviceSize size) -> BufferId
auto addHostBuffer (vk::DeviceSize size) -> BufferId
void bind (uint32_t binding, BufferId id, Copy copy=Copy::current)
void bindExternal (uint32_t set, uint32_t binding, std::function< vk::Buffer()> source)
void setAcquireUsage (BufferId id, sync::Usage usage)
void upload (BufferId id, std::span< const std::byte > data)
 Owner thread, blocks until the copy landed gpu side.
template<typename T>
void upload (BufferId id, std::span< const T > data)
auto step (const std::function< void(StepContext &)> &record, std::string_view debug_name={}, std::shared_ptr< const void > keep_alive={}) -> uint64_t
 Owner thread.

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