|
| CreateInfo () |
| Default constructor for mesh create info. More...
|
|
void | bind (size_t clusterIndex, ShaderProgramSharedPtr shaderProgram) |
| Prepares a cluster from the mesh for rendering with the specified shader. More...
|
|
const KzuBoundingVolume * | getBoundingVolume () const |
| Returns the bounding volume of the mesh. More...
|
|
size_t | getVertexCount () const |
| Returns the vertex count of the mesh. More...
|
|
size_t | getVertexAttributeCount () const |
| Gets the number of the vertex attributes in the mesh. More...
|
|
size_t | getVertexSize () const |
| Gets size of one vertex in bytes. More...
|
|
const void * | getVertexData () const |
| Gets raw vertex data. More...
|
|
size_t | getClusterCount () const |
| Gets the number of clusters in the mesh. More...
|
|
size_t | getClusterIndexCount (size_t clusterIndex) const |
| Gets the number of indices in a specified cluster. More...
|
|
GraphicsPrimitiveType | getClusterPrimitiveType (size_t clusterIndex) const |
| Gets the primitive type for the cluster. More...
|
|
MaterialSharedPtr | getClusterMaterial (size_t clusterIndex) const |
| Gets the cluster material. More...
|
|
void | setClusterMaterial (size_t clusterIndex, MaterialSharedPtr material) |
| Sets the cluster material. More...
|
|
const uint16_t * | getClusterIndexData (size_t clusterIndex) const |
| Gets index data for given cluster. More...
|
|
bool | updateBoundingBox (Node3D *baseNode, const KzcDynamicArray *transformedObjectList) |
| Updates bounding box of mesh with bones from given model. More...
|
|
size_t | getBoneCount () const |
| Gets number of bones in mesh. More...
|
|
Node3D * | getBoneNode (size_t boneIndex) const |
| Gets node for bone. More...
|
|
Node3D * | getBoneChildJoint (size_t boneIndex) const |
| Gets child node for skeletal animation bone. More...
|
|
void | attach (Node *baseNode) |
| Attaches a root node for bone node lookup functions. More...
|
|
void | detach () |
| Detaches root node, making bone node lookups no longer available. More...
|
|
const vector< int > & | acquireAttributeMap (ShaderProgramSharedPtr shaderProgram) |
| Gets attribute map for given shader program. More...
|
|
void | applySkeleton (Node *baseNode, const KzcDynamicArray *transformedObjectList) |
| Applies bone animation, updating matrix palette transformation uniforms. More...
|
|
const MeshVertexAttribute & | getVertexAttribute (int index) const |
| Gets mesh vertex attribute with given mesh attribute index. More...
|
|
void | bindAttribute (Renderer *renderer, unsigned int shaderAttributeIndex, int meshVertexAttributeIndex) |
| Takes one mesh vertex attribute from mesh and makes it usable with (current) shader. More...
|
|
unsigned int | bindAttributes (ShaderProgramSharedPtr shaderProgram) |
| Makes all mesh vertex attributes available with a shader program. More...
|
|
void | bindIndices (size_t clusterIndex) |
| Makes mesh cluster indices available to the next draw call. More...
|
|
virtual | ~GPUResource () KZ_OVERRIDE |
|
void | invalidate () |
| Notify resource that graphics context was lost and all GPU resources are invalid. More...
|
|
unsigned int | getGPUMemoryUsage () const |
|
Renderer * | getRenderer () const |
|
bool | isDeployed () const |
|
KzcMemoryManager * | getMemoryManager () const |
|
| Resource (Domain *domain, string_view name) |
|
virtual | ~Resource () |
|
virtual void | loadFromKZB (const KzuResourceLoaderThreadContext *threadContext, KzcInputStream *inputStream, const KzuBinaryFileInfo *file) |
| Function for loading the resource from .KZB. More...
|
|
virtual void | unloadOverride () |
| Unload function for resource. Releases all CPU memory taken by the resource except the resource loader. More...
|
|
virtual unsigned int | getCPUMemoryUsage () const |
| Function for getting the memory usage of a resource. More...
|
|
void | setKZB (const KzuBinaryDirectory *binaryDirectory, string_view path) |
| Set the binary directory and path of the resource. More...
|
|
const string & | getName () const |
| Gets the resource name. More...
|
|
const string & | getUrl () const |
| Gets the resource URL. More...
|
|
void | setUrl (string_view url) |
| Sets the resource URL. More...
|
|
void | setNotLoaded () |
|
bool | isFromKZB () const |
|
void | reload () |
|
void | reloadFromKzb (KzcInputStream *inputStream, const KzuBinaryFileInfo *file) |
|
void | reloadFromKzb (KzbFile &kzbFile, ReadOnlyMemoryFile &file, KzbMemoryParser &parser) |
|
void | reloadFromFile (string_view filePath) |
|
void | load () |
|
void | unload () |
|
bool | isLoaded () const |
|
void | kzuResourceLoad_private (const KzuResourceLoaderThreadContext *threadContext) |
| Private function for kzuResourceLoad() with specified thread context. More...
|
|
void | kzuResourceFinishLoading_private (const KzuResourceLoaderThreadContext *threadContext) |
| Private function for finishing the loading of the resource. More...
|
|
bool | isKeepAlive () const |
| Tells if the resource has keep alive flag set. More...
|
|
void | setKeepAlive (bool keepAlive) |
| Sets the keep alive flag. More...
|
|
| Object (Domain *domain) |
|
virtual | ~Object () |
|
Domain * | getDomain () const |
| Returns the domain the object belongs to. More...
|
|
KzuTaskScheduler * | getTaskScheduler () const |
| Returns the task scheduler of the object. More...
|
|
KzuMessageDispatcher * | getMessageDispatcher () const |
| Returns the message dispatcher of the object. More...
|
|
ResourceManager * | getResourceManager () const |
| Returns the resource manager of the object. More...
|
|
virtual const Metaclass * | getDynamicMetaclass () const KZ_OVERRIDE |
| Returns the metaclass of the dynamic type of the object. More...
|
|
AppliedStyleEntry * | applyObjectStyle (kanzi::StyleSharedPtr style) |
| Applies a style to an object. More...
|
|
void | unapplyObjectStyle (AppliedStyleEntry *appliedStyleEntry) |
|
void | applyObjectStyles () |
| Apply all styles for an object node. More...
|
|
void | unapplyObjectStyles () |
| Unapplies and removes all applied styles. More...
|
|
virtual | ~MetaObject () |
|
bool | isTypeOf (const Metaclass *objectType) const |
| Determines if the type of this object is the given type or derived from it. More...
|
|
| PropertyObject () |
|
virtual | ~PropertyObject () |
|
template<typename DataType > |
void | setProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Traits::ParameterType value) |
| Sets the local value of a property. More...
|
|
void | removeKzbProperties () |
|
template<typename DataType > |
PropertyType< DataType >::Traits::ReturnType | getProperty (const PropertyType< DataType > &propertyType) const |
| Returns the current value of a property. More...
|
|
template<typename DataType > |
optional< typename PropertyType< DataType >::Traits::ReturnType > | getOptionalProperty (const PropertyType< DataType > &propertyType) const |
| Evaluates the property value in the same way as the overload above but does not default to the value in property metadata if there are no inputs to the property value. More...
|
|
template<typename DataType > |
PropertyType< DataType >::Traits::ReturnType | getPropertyBase (const PropertyType< DataType > &propertyType) const |
| Returns the current value of a property disregarding modifiers. More...
|
|
template<typename DataType > |
void | setAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::Traits::ParameterType value) |
|
template<typename DataType > |
PropertyType< DataType >::Traits::ReturnType | getAbstractProperty (AbstractPropertyType abstractPropertyType) const |
|
template<typename DataType > |
PropertyType< DataType >::Traits::ReturnType | getAbstractPropertyBase (AbstractPropertyType abstractPropertyType) const |
|
template<typename DataType > |
optional< typename PropertyType< DataType >::Traits::ReturnType > | getOptionalAbstractProperty (AbstractPropertyType abstractPropertyType) const |
|
void | setPropertyFlag (AbstractPropertyType propertyType, uint32_t flag) |
|
bool | isPropertyFlagSet (AbstractPropertyType propertyType, uint32_t flag) const |
|
void | clearPropertyFlag (AbstractPropertyType propertyType, uint32_t flag) |
|
bool | hasValue (AbstractPropertyType propertyType) const |
| Evaluates whether there are any inputs into the property value. More...
|
|
bool | hasBaseValue (AbstractPropertyType propertyType) const |
| Evaluates whether there are any inputs into the property value, disregarding modifiers. More...
|
|
bool | hasLocalValue (AbstractPropertyType propertyType) const |
| Evaluates whether there is a local value set for the property. More...
|
|
bool | hasNonClassValue (AbstractPropertyType propertyType) const |
| Evaluates whether there is a value of any precedence higher than class default value set for the property. More...
|
|
void | removeLocalValue (AbstractPropertyType propertyType) |
| Removes the local value associated with the property. More...
|
|
void | copyLocalValue (const PropertyObject &other, AbstractPropertyType propertyType) |
| Copies local value of single property from another object. More...
|
|
void | copyLocalValues (const PropertyObject &other) |
| Copies all local values from another object. More...
|
|
virtual void | onPropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) |
| Virtual function to handle property change notifications. More...
|
|
template<typename DataType > |
void | addPropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, PropertyValuePrecedence precedence, void *owner) |
|
template<typename DataType > |
void | removePropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, void *owner) |
|
template<typename DataType > |
void | addPropertyModifier (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner) |
|
template<typename DataType > |
void | removePropertyModifier (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner) |
|
void | validatePropertyModifiers (AbstractPropertyType propertyType) |
|
template<typename DataType > |
void | addPropertyNotificationHandler (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::NotificationCallback callback, void *owner) |
|
template<typename DataType > |
void | removePropertyNotificationHandler (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::NotificationCallback callback, void *owner) |
|
template<typename DataType > |
size_t | getPropertyNotificationHandlerCount (const PropertyType< DataType > &propertyType) |
| Gets number of current notification handlers for given property type. More...
|
|
|
virtual void | reloadOverride () KZ_OVERRIDE |
| Resource::reloadOverride() implementation. More...
|
|
virtual void | reloadFromKzbOverride (KzcInputStream *inputStream, const KzuBinaryFileInfo *file) KZ_OVERRIDE |
| Resource::reloadFromKzbOverride() implementation. More...
|
|
virtual void | reloadFromKzbOverride (KzbFile &kzbFile, ReadOnlyMemoryFile &file, KzbMemoryParser &parser) |
| Resource::reloadFromKzbOverride() implementation. More...
|
|
virtual void | invalidateOverride () KZ_OVERRIDE |
| GPUResource::invalidateOverride() implementation. More...
|
|
virtual bool | isDeployedOverride () const KZ_OVERRIDE |
| GpuResource::isDeployed() implementation. More...
|
|
virtual unsigned int | getGPUMemoryUsageOverride () const KZ_OVERRIDE |
| GpuResource::getGPUMemoryUsageOverride() implementation. More...
|
|
| Mesh (Domain *domain, const CreateInfo &createInfo, string_view name) |
|
| GPUResource (Domain *domain, string_view name="") |
|
virtual void | reloadFromFileOverride (string_view filePath) |
|
virtual unsigned int | getCPUMemoryUsageOverride () const |
|
void | initialize () |
|
void | onCopy (const Object &other) |
|
| MetaObject () |
|
void | initialize () |
|
void | addPropertyValueSource (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::ValueSource *valueSource, PropertyValuePrecedence precedence, void *owner) |
|
void | removePropertyValueSource (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::ValueSource *valueSource, void *owner) |
|
AbstractPropertyTypeDescriptor::ValueSourceEntry * | getTopValueSourceEntry (AbstractPropertyTypeDescriptor::PropertyStorage &propertyStorage) const |
|
AbstractPropertyTypeDescriptor::ValueSourceEntry * | getTopValueSourceEntry (AbstractPropertyTypeDescriptor &descriptor) const |
|
AbstractPropertyTypeDescriptor::ValueSource * | getTopValueSource (AbstractPropertyTypeDescriptor &descriptor) const |
|
AbstractPropertyTypeDescriptor::ValueSource * | getFinalValueSource (AbstractPropertyTypeDescriptor &descriptor) const |
|
AbstractPropertyTypeDescriptor::ValueSource * | getNonClassValueSource (AbstractPropertyTypeDescriptor &descriptor) const |
|
AbstractPropertyTypeDescriptor::ValueSource * | getClassValueSource (AbstractPropertyTypeDescriptor &descriptor) const |
|
AbstractPropertyTypeDescriptor::ValueSourceEntry * | findLocalValueSourceEntry (AbstractPropertyTypeDescriptor::PropertyStorage &propertyStorage) |
|
AbstractPropertyTypeDescriptor::ValueSourceEntry * | constructLocalValueSourceEntry (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::PropertyStorage &propertyStorage) |
|
AbstractPropertyTypeDescriptor::ValueSourceEntry * | acquireLocalValueSourceEntry (AbstractPropertyTypeDescriptor &descriptor) |
|
AbstractPropertyTypeDescriptor::PropertyStorage * | findPropertyStorage (AbstractPropertyTypeDescriptor &descriptor) const |
|
PropertyStoragePtr | findPropertyStoragePtr (AbstractPropertyTypeDescriptor &descriptor) const |
| Gets property storage intrusive pointer that can be used to hold a reference until end of operation. More...
|
|
PropertyStoragePtr | constructPropertyStorage (AbstractPropertyTypeDescriptor &descriptor) |
|
PropertyStoragePtr | acquirePropertyStorage (AbstractPropertyTypeDescriptor &descriptor) |
|
AbstractPropertyTypeDescriptor::ModifierStorage * | acquireModifierStorage (AbstractPropertyTypeDescriptor &descriptor) |
|
AbstractPropertyTypeDescriptor::ModifierStorage * | findModifierStorage (AbstractPropertyTypeDescriptor &descriptor) |
|
AbstractPropertyTypeDescriptor::NotificationStorage * | acquireNotificationStorage (AbstractPropertyTypeDescriptor &descriptor) |
|
AbstractPropertyTypeDescriptor::NotificationStorage * | findNotificationStorage (AbstractPropertyTypeDescriptor &descriptor) |
|
AbstractPropertyTypeDescriptor * | findPropertyTypeDescriptorByUnqualifiedNameAndDataType (string_view unqualifiedName, PropertyDataType dataType) |
|
void | validatePropertyModifiersAndNotifyHandlers (PropertyStoragePtr &propertyStorage) |
|
void | copyLocalValue (const AbstractPropertyTypeDescriptor::PropertyStorage &propertyStorage) |
| Copy local value from property storage. More...
|
|
PropertyStorageContainer::iterator | beginPropertyStorage () |
|
PropertyStorageContainer::iterator | endPropertyStorage () |
|
virtual void | notifyPropertyHandlers (PropertyStoragePtr &propertyStorage, PropertyNotificationReason reason) |
|
void | onCopy (const PropertyObject &other) |
|
Struct which contains all the parameters that are needed for mesh creation.
Mesh stores the geometry data for rendering Model3d nodes.
- See also
- Mesh
Each mesh has one or more clusters. Each cluster has material and primitives. Primitives are typically triangles, they are stored as vertex data and index data.
You can load a mesh resource from a .kzb file or create it with the Mesh::create() function.
Once Mesh has been created with constructor, all primitive data is uploaded to GPU memory and no longer stored in CPU memory in Mesh.
Examples - Creating Mesh with Kanzi C++ API
To create a mesh with Kanzi C++ API:
1.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f };
uint16_t indexData[] = { 0, 1, 2 };
createInfo.vertexCount = 3;
createInfo.vertexSize = 3 * sizeof(float);
createInfo.vertexData.resize(createInfo.vertexCount * createInfo.vertexSize);
memcpy(createInfo.vertexData.data(), &vertexData[0], createInfo.vertexCount * createInfo.vertexSize);
Mesh::CreateInfo::Cluster cluster;
cluster.indexData.resize(3);
memcpy(cluster.indexData.data(), &indexData, cluster.indexData.size() * sizeof(uint16_t));
cluster.material = material;