core::data::geometry 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::constants namespace. Only 2 streams are mandatory (core::data::geometry::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

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

member-functions

vertices
returns the stream reference (if any found) for the given key.
const public
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
serialize<…>
serialization method to be used by the serializer when writing this container to the disk.
private

Function documentation

std::optional<std::reference_wrapper<const core::stream>> core::data::geometry::vertices(const psl::string_view name = constants::POSITION) const

Brief

returns the stream reference (if any found) for the given key.

Returns the stream reference (if any found) for the given key.

void core::data::geometry::vertices(const psl::string_view name, const core::stream& 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::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::indices(const std::vector<index_size_t>& indices)

Brief

sets the indices.

Details

const std::unordered_map<psl::string, core::stream>& core::data::geometry::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::is_valid() const

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::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.