Toast Engine
Loading...
Searching...
No Matches
assets::Curve Class Reference
Inheritance diagram for assets::Curve:
Collaboration diagram for assets::Curve:

Public Types

using Points = std::vector<float>

Public Member Functions

 Curve (std::vector< Points > channels, SplineType type, float t_scale=1.0f)
auto type () const -> std::string_view override
auto serialize (SaveMode mode) const -> std::vector< uint8_t > override
auto eval1D (float t) const -> float
auto eval2D (float t) const -> glm::vec2
auto eval3D (float t) const -> glm::vec3
auto evalChannel (size_t channel, float t) const -> float
auto evalAtX (float x) const -> float
auto xRange () const noexcept -> glm::vec2
auto dimension () const noexcept -> CurveDimension
auto splineType () const noexcept -> SplineType
auto tScale () const noexcept -> float
auto numPoints (size_t channel=0) const noexcept -> size_t
void setPoints (size_t channel, Points points)
void reload (const toml::table &tbl)
 Throws and keeps the old curve when the table is not a curve, nothing may sample it while this runs.
Public Member Functions inherited from assets::Asset
 Asset (const Asset &)=delete
auto operator= (const Asset &) -> Asset &=delete
auto refCount () const noexcept -> uint32_t

Static Public Member Functions

static auto fromToml (const toml::table &tbl) -> std::unique_ptr< Curve >

Additional Inherited Members

Protected Member Functions inherited from assets::Asset
void addRef () noexcept
void release () noexcept

Member Function Documentation

◆ serialize()

auto assets::Curve::serialize ( SaveMode mode) const -> std::vector< uint8_t >
nodiscardoverridevirtual

Implements assets::ISaveable.

◆ type()

auto assets::Curve::type ( ) const -> std::string_view
inlinenodiscardoverridevirtual

Implements assets::Asset.


The documentation for this class was generated from the following files:
  • engine/src/toast/assets/curve.hpp
  • engine/src/toast/assets/curve.cpp