core::data::geometry_t class

describes a stream of data that will be uploaded to the GPU as geometry data.

Unlike most engines, geometry data in paradigm is considered a collection of undescribed data, that has been keyed. There are some globally accepted keys defined for convenience at the core::data::geometry_t::constants namespace. Only 2 streams are mandatory (core::data::geometry_t::constants::POSITION and the indices stream), if those are not present, the data is considered invalid. All streams (except the index buffer stream) should have equally as many entries as the position buffer stream has. The index buffer stream should not reffer to positions larger than the size of the position buffer stream.

types

classes

constants
contains globally pre-defined keys for common streams that most engines have.

static variables

serialization_name
serialization name to be used by the serializer when writing and reading this container to and from disk.
constexprconstexprprivateprivatestaticstatic

member-functions

vertices
returns the stream reference for the given key.
const public
contains
verifies if the given stream is present in the data
const public noexcept
vertices
sets the stream data for the given key. If data was already present, then it gets replaced.
public
indices
gets all indices that are currently assigned to this model data.
const public
indices
sets the indices.
public
vertex_streams
returns all the streams of data and their keys.
const public
is_valid
helper method to check for validity of the model data in its current state.
const public noexcept
erase
erases the given stream if found
public noexcept
serialize<…>
serialization method to be used by the serializer when writing this container to the disk.
private

Function documentation

const core::vertex_stream_t& core::data::geometry_t::vertices(const psl::string_view name = constants::POSITION) const

Brief

returns the stream reference for the given key.

Returns the stream reference for the given key. \warn if you are uncertain the stream exists, run the contains method first. The vertices method will terminate if the stream isn't found.

bool core::data::geometry_t::contains(const psl::string_view name) const noexcept

Brief

verifies if the given stream is present in the data

Parameters
name stream name see constants::POSITION as example
Returns true if the stream exists

void core::data::geometry_t::vertices(const psl::string_view name, const core::vertex_stream_t& stream)

Brief

sets the stream data for the given key. If data was already present, then it gets replaced.

Details

const std::vector<index_size_t>& core::data::geometry_t::indices() const

Brief

gets all indices that are currently assigned to this model data.

Returns all indices that are currently assigned to this model data.

void core::data::geometry_t::indices(psl::array_view<index_size_t> indices)

Brief

sets the indices.

Details

const std::unordered_map<psl::string, core::vertex_stream_t>& core::data::geometry_t::vertex_streams() const

Brief

returns all the streams of data and their keys.

Returns all the streams of data and their keys.

bool core::data::geometry_t::is_valid() const noexcept

Brief

helper method to check for validity of the model data in its current state.

Returns true if the data passes all checks.

template<typename S>
void core::data::geometry_t::serialize(S& serializer) private

Brief

serialization method to be used by the serializer when writing this container to the disk.

Parameters
serializer in the serialization object, consult the serialization namespace for more information.