Cogs.Core
|
Meshes contain streams of vertex data in addition to index data and options defining geometry used for rendering and picking. More...
#include <Mesh.h>
Classes | |
struct | StreamReference |
Utility structure containing reference to a data stream in a mesh. More... | |
Public Member Functions | |
Mesh () | |
Construct a default mesh instance. | |
Mesh (const Mesh &other)=delete | |
Disabled copy constructor since copying Mesh resources naively might incur a performance penalty. | |
Mesh & | operator= (const Mesh &other) noexcept=delete |
Disabled copy assign since copying Mesh resources naively might incur a performance penalty. | |
Mesh (Mesh &&other) noexcept=default | |
Move construct a Mesh from other. | |
Mesh & | operator= (Mesh &&other) noexcept=default |
Move assign from other. | |
void | setBounds (Geometry::BoundingBox box) |
Set custom bounds for the mesh. | |
void | setPositions (std::span< const glm::vec3 > positions) |
Set the position data of the Mesh. | |
void | setColors (std::span< const glm::vec4 > colors) |
void | setInstancePositions (std::span< const glm::vec3 > positions) |
void | setInstanceColors (std::span< const glm::vec4 > colors) |
template<typename Iterator > | |
void | setPositions (Iterator begin, Iterator end) |
Set the position data of the mesh. | |
MappedStream< glm::vec3 > | mapPositions (const size_t start, const size_t end) |
Map the position stream for write access, range between start and end. | |
MappedStreamReadOnly< glm::vec3 > | mapPositionsReadOnly (const size_t start, const size_t end) |
Map the position stream for read access, range between start and end. | |
void | setNormals (std::span< const glm::vec3 > normals) |
Set the normal data of the Mesh. | |
template<typename Iterator > | |
void | setNormals (Iterator begin, Iterator end) |
Set the normal data of the mesh. | |
MappedStream< glm::vec3 > | mapNormals (const size_t start, const size_t end) |
Map the normal stream for write access, range between start and end. | |
MappedStreamReadOnly< glm::vec3 > | mapNormalsReadOnly (const size_t start, const size_t end) |
Map the normal stream for read access, range between start and end. | |
void | setTangents (std::span< const glm::vec3 > tangents) |
Set the tangent data of the Mesh. | |
template<typename Iterator > | |
void | setTangents (Iterator begin, Iterator end) |
Set the tangent data of the mesh. | |
MappedStream< glm::vec3 > | mapTangents (const size_t start, const size_t end) |
Map the tangent stream for write access, range between start and end. | |
MappedStreamReadOnly< glm::vec3 > | mapTangentsReadOnly (const size_t start, const size_t end) |
Map the tangent stream for read access, range between start and end. | |
void | setTexCoords (std::span< const glm::vec2 > texCoords) |
Set the texture coordinate data of the Mesh. | |
template<typename Iterator > | |
void | setTexCoords (Iterator begin, Iterator end) |
Set the texture coordinate data of the mesh. | |
MappedStream< glm::vec2 > | mapTexCoords (const size_t start, const size_t end) |
Map the texture coordinate stream for write access, range between start and end. | |
MappedStreamReadOnly< glm::vec2 > | mapTexCoordsReadOnly (const size_t start, const size_t end) |
Map the texture coordinate stream for read access, range between start and end. | |
template<typename Element > | |
MappedStream< Element > | map (const VertexDataType::EVertexDataType type, VertexFormatHandle format, const size_t count) |
Maps the data stream corresponding to the given type with the given format and count. | |
void | setIndexes (std::span< const uint32_t > collection) |
Set the index data to the collection given. | |
void | clearIndexes () |
Clear all index data, also clearing all sub-meshes. | |
void | addSubMesh (std::span< uint32_t > collection, PrimitiveType::EPrimitiveType primitiveType) |
Add a sub-mesh to the Mesh. | |
void | setBufferStream (VertexDataType::EVertexDataType type, ResourceBufferHandle buffer, VertexFormatHandle format, uint32_t numElements, uint32_t offset, uint32_t stride) |
void | clearStream (DataStream &stream) |
void | clear () |
Clear all data from the Mesh, returning it to its initial non-indexed state with no streams and no sub-meshes defined. | |
void | setMeshFlag (MeshFlags::EMeshFlags flag) |
Set the given mesh flag. | |
void | unsetMeshFlag (MeshFlags::EMeshFlags flag) |
Unset the given mesh flag. | |
constexpr bool | isMeshFlagSet (MeshFlags::EMeshFlags flag) const |
Check if the given mesh flag(s) is set. | |
bool | boundsDirty () const |
Gets if the mesh bounds need to be updated before use. | |
void | setIndexData (const uint32_t *data, size_t count) |
Convenience method for setting index data from a raw pointer to data and count number of elements. | |
void | setIndexData (const uint16_t *data, size_t count) |
void | setIndexData (std::span< const uint32_t > data) |
Convenience method for setting index data from a vector of source data. | |
template<typename Element > | |
void | setVertexData (Element *elements, size_t count) |
Set vertex data. | |
template<typename Element > | |
void | setVertexData (Element *elements, size_t count, VertexFormatHandle format) |
Set vertex data. | |
template<typename Element > | |
void | set (const VertexDataType::EVertexDataType type, VertexFormatHandle format, Element *begin, Element *end) |
Set the data of the vertex stream indexed by type. | |
template<typename Collection > | |
void | set (const VertexDataType::EVertexDataType type, VertexFormatHandle format, const Collection &collection) |
Convenience method for setting vertex data to the stream given by type. | |
template<typename Element > | |
MappedStream< Element > | map (const VertexDataType::EVertexDataType type, VertexFormatHandle format, const size_t start, const size_t count, bool resize=false) |
Maps the data stream corresponding to the given type. | |
template<typename Element > | |
MappedStreamReadOnly< Element > | mapReadOnly (const VertexDataType::EVertexDataType type, VertexFormatHandle format, const size_t start, const size_t count) |
Maps the data stream corresponding to the given type for read-only access. | |
uint8_t * | mapStream (const VertexDataType::EVertexDataType type, VertexFormatHandle format, const size_t start, const size_t count, const size_t elementSize, bool resize=false) |
Raw stream mapping method. | |
uint8_t * | mapStream (const VertexDataType::EVertexDataType type, const size_t start, const size_t count, const size_t stride, bool resize=false) |
Raw stream mapping method. | |
void | unmap (VertexDataType::EVertexDataType type) |
Unmap the stream with the given vertex data type index. | |
void | markStreamChanged (VertexDataType::EVertexDataType type) |
Mark stream with the given vertex data type index as changed. | |
DataStream & | getStream (const VertexDataType::EVertexDataType dataType) |
Get the stream corresponding to the given dataType. | |
const DataStream & | getStream (const VertexDataType::EVertexDataType dataType) const |
DataStream * | getAllocatedStream (const VertexDataType::EVertexDataType dataType) |
const DataStream * | getAllocatedStream (const VertexDataType::EVertexDataType dataType) const |
bool | hasStream (VertexDataType::EVertexDataType type) const |
Check if the Mesh has a DataStream for the given type. | |
bool | isCCW () const |
If triangles in the mesh are specified counter-clockwise, which is the default. | |
bool | isIndexed () const |
If the mesh uses indexed geometry. | |
StreamReference | getPositionStream () |
Get the data of the stream containing positions. | |
StreamReference | getSemanticStream (ElementSemantic semantic, DataFormat format) |
Get the data of the stream containing data with the given semantic, format and minimum element size. | |
MeshStreamsLayout | getStreamsLayout () const |
uint32_t | getCount () const |
Get the vertex count of the mesh. | |
void | setCount (size_t count) |
Explicitly set the vertex count of the mesh. | |
uint32_t | getInstanceCount () const |
Get the number of instances in this mesh. | |
void | setInstanceCount (size_t count) |
Set the number of instances in this mesh. | |
template<typename Datatype > | |
Cogs::Memory::TypedBuffer< Datatype > | copyData (Cogs::ElementSemantic semantic, DataFormat format) |
Return a vector with all elements of the given semantic data as a continous buffer. | |
template<typename Datatype > | |
void | copyData (Cogs::Memory::TypedBuffer< Datatype > &output, Cogs::ElementSemantic semantic, DataFormat format) |
class MeshManager * | getManager () const |
std::span< uint32_t > | mapPoseIndexes (uint32_t count) |
std::span< const uint32_t > | getPoseIndexes () const |
std::span< SubMesh > | mapSubMeshes (uint32_t count) |
std::span< SubMesh > | getSubMeshes () |
std::span< const uint32_t > | getIndexes () const |
std::span< const uint16_t > | getIndexesU16 () const |
bool | hasIndexesU16 () const |
![]() | |
ResourceBase ()=default | |
Constructs a new resource base. | |
ResourceBase (const ResourceBase &other)=delete | |
Disable trivial copies of resources. | |
ResourceBase & | operator= (const ResourceBase &other)=delete |
Disable copy-assignment of resources. | |
ResourceBase (ResourceBase &&other) | |
Move constructs a resource base from other. | |
ResourceBase & | operator= (ResourceBase &&other) |
Move assign the resource from the given ResourceBase other. | |
~ResourceBase () | |
Destructs the resource. | |
void | setInitialized () |
void | setChanged () |
bool | hasChanged () const |
void | setLoading () |
void | setLoaded () |
void | setFailedLoad () |
void | setActive () |
void | setResident () |
void | setProxy () |
void | setKeepStorage () |
bool | isInitialized () const |
bool | isLoaded () const |
bool | isActive () const |
bool | isResident () const |
bool | isDependency () const |
bool | isDeleted () const |
bool | isOrphaned () const |
bool | isProxy () const |
bool | hasFailedLoad () const |
bool | hasFailedActivation () const |
bool | keepStorage () const |
void | setType (ResourceTypes type) |
Set the type enumeration of the resource. | |
ResourceTypes | getType () const |
Gets the type enumeration of the resource. | |
void | setId (ResourceId resourceId) |
Set the resource id of the resource. | |
ResourceId | getId () const |
Get the resource id of this instance. | |
void | setFlag (ResourceFlags flags) |
Set the given resource flag. | |
void | setFlags (ResourceFlags flags) |
void | unsetFlag (ResourceFlags flag) |
Unset the given flag. | |
bool | isSet (ResourceFlags flag) const |
Check if the given flag is currently set. | |
ResourceFlags | getFlags () const |
Get the current flags of the resource. | |
void | attachResource (RenderResource *attachment) |
Attach the given GPU resource to the resource. | |
bool | hasAttachedResource () const |
Check if the resource has an attachment. | |
RenderResource * | getAttachedResource () const |
Get the attached resource. | |
void | setOwner (IResourceManager *owner) |
Sets the owner of this resource instance. | |
IResourceManager * | getOwner () const |
void | setName (const StringView &name) |
Set the user friendly name of the resource. | |
StringView | getName () const |
Get the name of the resource. | |
void | setSource (const StringView &source) |
StringView | getSource () const |
void | increment () |
Increments the reference count of the resource. | |
void | decrement () |
Decrement the reference count of the resource. | |
uint32_t | referenceCount () const |
Get the current reference count. | |
void | incrementGeneration () |
Increment the generation count. | |
uint32_t | getGeneration () const |
Get the generation count. | |
void | setSlot (uint32_t slot) |
Sets the slot at which the resource is internally tracked. | |
uint32_t | getSlot () const |
Gets the slot where the resource is tracked internally. | |
Static Public Member Functions | |
static constexpr uint16_t | toFlag (VertexDataType::EVertexDataType type) |
Convert the given type index to a flag. | |
Static Public Attributes | |
static constexpr size_t | MaxStreams = 16 |
Maximum number of data streams contained in a single Mesh resource. | |
static constexpr int | NoStream = -1 |
Used to indicate no stream. | |
![]() | |
static const uint32_t | NoAttachment = 0xFFFFFFFF |
Constant used to signal no attachment. | |
Meshes contain streams of vertex data in addition to index data and options defining geometry used for rendering and picking.
Cogs::Core::Mesh::Mesh | ( | ) |
|
defaultnoexcept |
void Cogs::Core::Mesh::addSubMesh | ( | std::span< uint32_t > | collection, |
PrimitiveType::EPrimitiveType | primitiveType | ||
) |
Add a sub-mesh to the Mesh.
The sub-mesh is added after any existing sub-meshes. If no sub-meshes exist but index data is present, the current index set is defined as the first sub-mesh before adding. If no sub-meshes exist and no index data is present the sub-mesh will be the first of the Mesh resource.
Sub-meshes can be used to partition large meshes into several draw calls, for example using different materials for each sub-mesh.
collection | Collection of index data to use for the sub-mesh. |
primitiveType | Primitive type to use when rendering the sub-mesh. |
Collection | Type of collection holding index data for the sub-mesh. |
Definition at line 189 of file Mesh.cpp.
References Cogs::Core::MeshFlags::Indexed, and Cogs::Core::MeshFlags::IndexesChanged.
|
inline |
Gets if the mesh bounds need to be updated before use.
True if any of the mesh data changed, and a bounding box is not set explicitly.
Definition at line 692 of file Mesh.h.
Referenced by Cogs::Core::InstancedMeshRenderSystem::update().
void Cogs::Core::Mesh::clear | ( | ) |
Clear all data from the Mesh, returning it to its initial non-indexed state with no streams and no sub-meshes defined.
Definition at line 27 of file Mesh.cpp.
References Cogs::Core::MeshFlags::BoundingBoxSet, Cogs::Core::MeshFlags::Indexed, and Cogs::Core::MeshFlags::Instanced.
Referenced by Cogs::Core::MarkerPointSetSystem::update(), Cogs::Core::LoftedCrossSectionsSystem::update(), Cogs::Core::Volumetric::PointVisualizationSystem::update(), and Cogs::Core::ShapeSystem::update().
|
inline |
Clear all index data, also clearing all sub-meshes.
If the Mesh was flagged as Indexed before the call to clearIndexes(), it will retain this flag after the call. To remove the use of indexes call unsetMeshFlag(MeshFlags::Indexed).
Definition at line 607 of file Mesh.h.
Referenced by Cogs::Core::LoftedCrossSectionsSystem::update().
void Cogs::Core::Mesh::clearStream | ( | DataStream & | stream | ) |
|
inline |
Return a vector with all elements of the given semantic data as a continous buffer.
semantic | Which element semantic to copy |
format | Expected format of the element |
|
inline |
Cogs::Core::DataStream * Cogs::Core::Mesh::getAllocatedStream | ( | const VertexDataType::EVertexDataType | dataType | ) |
const Cogs::Core::DataStream * Cogs::Core::Mesh::getAllocatedStream | ( | const VertexDataType::EVertexDataType | dataType | ) | const |
|
inline |
Get the vertex count of the mesh.
If indexed, returns the size of the index array used to render the mesh.
Definition at line 1012 of file Mesh.h.
Referenced by Cogs::Core::calculateBounds(), Cogs::Core::generateMeshTangents(), and Cogs::Core::InstancedMeshRenderSystem::update().
std::span< const uint32_t > Cogs::Core::Mesh::getIndexes | ( | ) | const |
std::span< const uint16_t > Cogs::Core::Mesh::getIndexesU16 | ( | ) | const |
|
inline |
Get the number of instances in this mesh.
Cogs::Core::MeshManager * Cogs::Core::Mesh::getManager | ( | ) | const |
std::span< const uint32_t > Cogs::Core::Mesh::getPoseIndexes | ( | ) | const |
Cogs::Core::Mesh::StreamReference Cogs::Core::Mesh::getPositionStream | ( | ) |
Get the data of the stream containing positions.
If the Positions stream is used, and has the correct format and element size, this will be returned. If not the remaining streams are checked for position info and returned if present.
Definition at line 136 of file Mesh.cpp.
References Cogs::Position.
Referenced by Cogs::Core::MeshCollisionSystem::update().
Cogs::Core::Mesh::StreamReference Cogs::Core::Mesh::getSemanticStream | ( | ElementSemantic | semantic, |
DataFormat | format | ||
) |
Get the data of the stream containing data with the given semantic, format and minimum element size.
Checks all streams and uses the first that contains a matching vertex format.
Definition at line 144 of file Mesh.cpp.
References Cogs::Core::DataStream::format, and Cogs::Core::DataStream::numElements.
Referenced by Cogs::Core::InstancedMeshPicker::pickImpl(), and Cogs::Core::InstancedMeshRenderSystem::update().
Cogs::Core::DataStream & Cogs::Core::Mesh::getStream | ( | const VertexDataType::EVertexDataType | dataType | ) |
Get the stream corresponding to the given dataType.
If the stream does not exist, a DataStream is constructed at the given index.
dataType | Vertex data stream type to fetch stream for. |
Definition at line 85 of file Mesh.cpp.
References Cogs::Core::DataStream::buffer, Cogs::Core::BufferBindFlags::IndexBuffer, Cogs::Core::BufferResource::setBindFlags(), Cogs::Core::DataStream::type, and Cogs::Core::BufferBindFlags::VertexBuffer.
Referenced by Cogs::Core::generateMeshNormals().
const Cogs::Core::DataStream & Cogs::Core::Mesh::getStream | ( | const VertexDataType::EVertexDataType | dataType | ) | const |
Cogs::Core::MeshStreamsLayout Cogs::Core::Mesh::getStreamsLayout | ( | ) | const |
std::span< Cogs::Core::SubMesh > Cogs::Core::Mesh::getSubMeshes | ( | ) |
|
inline |
Check if the Mesh has a DataStream for the given type.
type | Vertex data type to check for. |
Definition at line 933 of file Mesh.h.
Referenced by Cogs::Core::generateMeshNormals(), and Cogs::Core::generateMeshTangents().
|
inline |
If triangles in the mesh are specified counter-clockwise, which is the default.
Definition at line 943 of file Mesh.h.
Referenced by Cogs::Core::generateMeshNormals(), and Cogs::Core::generateMeshTangents().
|
inline |
If the mesh uses indexed geometry.
Definition at line 953 of file Mesh.h.
Referenced by Cogs::Core::generateMeshNormals(), and Cogs::Core::generateMeshTangents().
|
inlineconstexpr |
|
inline |
Maps the data stream corresponding to the given type with the given format and count.
type | Type index of the mapped stream. |
format | Pointer to a valid vertex format describing the mapped stream data. |
count | Number of elements to map. |
|
inline |
Maps the data stream corresponding to the given type.
If no stream currently exists for type, a new empty DataStream is created with the corresponding type.
If needed, the stream is resized to be able to hold (start + count) * sizeof(Element) number of bytes.
type | Type index of the stream to map. If no stream exists for this type, a DataStream is created. |
format | Pointer to a vertex format describing the data in the stream. Must be alive for as long as the Mesh resource instance is in use. Prefer using formats defined in VertexFormats. |
start | Index of the first element in the stream to map. |
count | Number of elements to map from the start index. |
resize | A boolean indicating if resize is wanted even when the mapped size is smaller than the capacity of the stream. =True to shrink streams to only contain enough storage for the desired mapped range. |
|
inline |
Map the normal stream for write access, range between start and end.
start | Starting index to the first normal element to map. |
end | End index one past the last element to map. |
|
inline |
Map the normal stream for read access, range between start and end.
start | Starting index to the first normal element to map. |
end | End index one past the last element to map. |
Definition at line 438 of file Mesh.h.
Referenced by Cogs::Core::generateMeshTangents().
std::span< uint32_t > Cogs::Core::Mesh::mapPoseIndexes | ( | uint32_t | count | ) |
|
inline |
Map the position stream for write access, range between start and end.
If the range [start, end) extends past the current capacity of the position stream, the stream data is resized to cover the range.
start | Starting index to the first position element to map. |
end | End index one past the last element to map. |
|
inline |
Map the position stream for read access, range between start and end.
If the range [start, end) extends past the current capacity of the position stream, the stream data is resized to cover the range.
start | Starting index to the first position element to map. |
end | End index one past the last element to map. |
Definition at line 382 of file Mesh.h.
Referenced by Cogs::Core::generateMeshNormals(), and Cogs::Core::generateMeshTangents().
|
inline |
Maps the data stream corresponding to the given type for read-only access.
If no stream currently exists for type an invalid stream is returned. Use isValid() member to check.
If stream length is too short an invalid stream is returned.
type | Type index of the stream to map. If no stream exists for this type, a DataStream is created. |
format | Pointer to a vertex format describing the data in the stream. Must be alive for as long as the Mesh resource instance is in use. Prefer using formats defined in VertexFormats. |
start | Index of the first element in the stream to map. |
count | Number of elements to map from the start index. |
Definition at line 857 of file Mesh.h.
Referenced by Cogs::Core::SpritePicker::pickCamera().
uint8_t * Cogs::Core::Mesh::mapStream | ( | const VertexDataType::EVertexDataType | type, |
const size_t | start, | ||
const size_t | count, | ||
const size_t | stride, | ||
bool | resize = false |
||
) |
Raw stream mapping method.
Must be unmapped using unmap after modification.
Definition at line 61 of file Mesh.cpp.
References Cogs::Core::DataStream::buffer, Cogs::Core::DataStream::numElements, Cogs::Core::BufferResource::resize(), and Cogs::Core::DataStream::stride.
uint8_t * Cogs::Core::Mesh::mapStream | ( | const VertexDataType::EVertexDataType | type, |
VertexFormatHandle | format, | ||
const size_t | start, | ||
const size_t | count, | ||
const size_t | elementSize, | ||
bool | resize = false |
||
) |
Raw stream mapping method.
Must be unmapped using unmap after modification. The stream is resize if it is too short. Also resized if different size and resize flag is set.
Definition at line 46 of file Mesh.cpp.
References Cogs::Core::DataStream::format.
std::span< Cogs::Core::SubMesh > Cogs::Core::Mesh::mapSubMeshes | ( | uint32_t | count | ) |
|
inline |
Map the tangent stream for write access, range between start and end.
start | Starting index to the first tangent element to map. |
end | End index one past the last element to map. |
|
inline |
|
inline |
Map the texture coordinate stream for write access, range between start and end.
start | Starting index to the first texture coordinate element to map. |
end | End index one past the last element to map. |
|
inline |
Map the texture coordinate stream for read access, range between start and end.
start | Starting index to the first texture coordinate element to map. |
end | End index one past the last element to map. |
Definition at line 550 of file Mesh.h.
Referenced by Cogs::Core::generateMeshTangents().
|
inline |
Move assign from other.
The contents of other are all moved into this instance, and the instance moved from is left in an empty, uninitialized state.
|
inline |
Convenience method for setting vertex data to the stream given by type.
type | Vertex data stream index to copy data to. |
format | Pointer to a valid vertex format describing the data in collection. |
collection | Collection of vertex data. |
Type | of collection to copy vertex data from. std::span or other continous storage collection (.data + .size) |
|
inline |
Set the data of the vertex stream indexed by type.
The vertex stream is automatically created if needed, and resized to fit the exact contents given.
The data between begin and end is copied into the stream.
type | Vertex data stream index to set the data to. |
format | Pointer to a valid vertex format describing the data pointed to by begin. |
begin | Pointer to the first data element to copy. |
end | Pointer one past the last element to copy. |
Element | Type of data the begin and end pointers are pointing to. |
Definition at line 792 of file Mesh.h.
Referenced by Cogs::Core::MarkerPointSetSystem::update().
|
inline |
Set custom bounds for the mesh.
box | Custom bounding box to use for culling and other operations on the Mesh. |
Definition at line 298 of file Mesh.h.
Referenced by Cogs::Core::SeaCurrentsSystem::initialize(), Cogs::Core::LoftedCrossSectionsSystem::update(), and Cogs::Core::Text3DSystem::update().
void Cogs::Core::Mesh::setBufferStream | ( | VertexDataType::EVertexDataType | type, |
ResourceBufferHandle | buffer, | ||
VertexFormatHandle | format, | ||
uint32_t | numElements, | ||
uint32_t | offset, | ||
uint32_t | stride | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
Convenience method for setting index data from a raw pointer to data and count number of elements.
The index data pointed to will be copied into the internal index data of the Mesh.
data | Pointer to index data. |
count | Number of indexes to copy. |
Definition at line 705 of file Mesh.h.
Referenced by Cogs::Core::Text3DSystem::update(), and Cogs::Core::ShapeSystem::update().
|
inline |
|
inline |
Set the index data to the collection given.
Any existing index data is overwritten by the contents of collection. If the index data given is smaller than the previously set index data, any previous data past the size of collection is simply discarded.
Any defined sub-meshes are discarded.
The Mesh is flagged as Indexed when this method is called, even with an empty index collection. To remove the Indexed flag, see unsetMeshFlag().
collection | std::span of index data to set. |
Definition at line 596 of file Mesh.h.
Referenced by Cogs::Core::CurtainView::CurtainViewSystem::update().
|
inline |
|
inline |
Set the number of instances in this mesh.
|
inline |
|
inline |
Set the given mesh flag.
flag | MeshFlag to set. |
Definition at line 659 of file Mesh.h.
References Cogs::setChanged().
|
inline |
Set the normal data of the mesh.
The data contained between begin and end is copied into the Normals stream of the Mesh.
begin | Iterator to the beginning of the normal data. |
end | Iterator to the end of the normal data. |
Iterator | Forward iterator to elements consisting of three-component floating point vectors. Must have continpus storage. |
|
inline |
Set the normal data of the Mesh.
normals | std::span of normal data. |
Definition at line 392 of file Mesh.h.
Referenced by Cogs::Core::generateMeshNormals(), Cogs::Core::CurtainView::CurtainViewSystem::update(), and Cogs::Core::ShapeSystem::update().
|
inline |
Set the position data of the mesh.
The data contained between begin and end is copied into the Positions stream of the Mesh.
begin | Iterator to the beginning of the position data. |
end | Iterator to the end of the position data. |
Iterator | Forward iterator to elements consisting of three-component floating point vectors. |
|
inline |
Set the position data of the Mesh.
positions | std::span of position data. |
Definition at line 315 of file Mesh.h.
Referenced by Cogs::Core::SeaCurrentsSystem::initialize(), Cogs::Core::CurtainView::CurtainViewSystem::update(), Cogs::Core::Text3DSystem::update(), and Cogs::Core::ShapeSystem::update().
|
inline |
Set the tangent data of the mesh.
The data contained between begin and end is copied into the Tangents stream of the Mesh.
begin | Iterator to the beginning of the tangent data. |
end | Iterator to the end of the tangent data. |
Iterator | Forward iterator to elements consisting of three-component floating point vectors. |
|
inline |
Set the tangent data of the Mesh.
tangents | std::span of tangent data. |
Definition at line 448 of file Mesh.h.
Referenced by Cogs::Core::generateMeshTangents().
|
inline |
Set the texture coordinate data of the mesh.
The data contained between begin and end is copied into the TexCoords0 stream of the Mesh.
begin | Iterator to the beginning of the texture coordinate data. |
end | Iterator to the end of the texture coordinate data. |
Iterator | Forward iterator to elements consisting of two-component floating point vectors. |
|
inline |
Set the texture coordinate data of the Mesh.
texCoords | std::span of texture coordinate data. |
Definition at line 504 of file Mesh.h.
Referenced by Cogs::Core::CurtainView::CurtainViewSystem::update(), Cogs::Core::Text3DSystem::update(), and Cogs::Core::ShapeSystem::update().
|
inline |
Set vertex data.
The vertex data is considered custom formatted data and is set to the Interleaved0 stream.
elements | Pointer to the first vertex to copy. |
count | Number of elements to copy. |
Type | of vertex to copy from. Must implement static getVertexFormat() method. |
|
inline |
Set vertex data.
The vertex data is considered custom formatted data and is set to the Interleaved0 stream.
elements | Pointer to the beginning of the first element to copy. |
count | Number of elements to copy. |
format | Pointer to a valid vertex format describing the data pointed to by elements. |
Element | type of element elements is pointing to. |
|
inlinestaticconstexpr |
|
inline |
|
inline |
|
staticconstexpr |
|
staticconstexpr |