Kuesa::Qt3D::MeshInstantiator¶
Module: Kuesa Qt 3D API
Kuesa::Qt3D::MeshInstantiator allows to render several instances of a same mesh with different transformations. More...
#include <Kuesa/Qt3D/api/meshinstantiator.h>
Inherits from Kuesa::Qt3D::KuesaNode, Qt3DCore::QNode
Public Signals¶
Name | |
---|---|
void | countChanged(int count) |
void | transformationMatricesChanged(const std::vector< QMatrix4x4 > & transformationMatrices) |
void | entityNameChanged(const QString & entityName) |
Public Functions¶
Name | |
---|---|
MeshInstantiator(Qt3DCore::QNode * parent =nullptr) | |
~MeshInstantiator() =default | |
int | count() const |
void | setEntityName(const QString & entityName) |
QString | entityName() const |
void | setTransformationMatrices(const std::vector< QMatrix4x4 > & transformationMatrices) |
const std::vector< QMatrix4x4 > & | transformationMatrices() const |
Public Properties¶
Name | |
---|---|
QString | entityName |
int | count |
Additional inherited members¶
Public Slots inherited from Kuesa::Qt3D::KuesaNode
Name | |
---|---|
void | setSceneEntity(Kuesa::Qt3D::SceneEntity * sceneEntity) |
Public Signals inherited from Kuesa::Qt3D::KuesaNode
Name | |
---|---|
void | sceneEntityChanged(Kuesa::Qt3D::SceneEntity * sceneEntity) |
Public Functions inherited from Kuesa::Qt3D::KuesaNode
Name | |
---|---|
KuesaNode(Qt3DCore::QNode * parent =nullptr) | |
SceneEntity * | sceneEntity() const |
Public Properties inherited from Kuesa::Qt3D::KuesaNode
Name | |
---|---|
Kuesa::Qt3D::SceneEntity * | sceneEntity |
Protected Attributes inherited from Kuesa::Qt3D::KuesaNode
Name | |
---|---|
SceneEntity * | m_sceneEntity |
Detailed Description¶
1 |
|
Kuesa::Qt3D::MeshInstantiator allows to render several instances of a same mesh with different transformations.
Since: Kuesa 2.0
Note: For the instances to be visible, you should ensure that either frustum culling is disabled or that the initial instances (the mesh with no transformation applies) fit within the view frustum. Furthermore care needs to be taken to not share the material you intend to use with the instanced meshes with the material used for non instanced meshes.
Instanced drawing is a drawing technique that relies on a single draw call being made to the graphics API and letting the GPU draw several instances of the same base mesh.
Each mesh instance can be controlled by per instance properties provided under the form of per instance attributes.
Kuesa::Qt3D::MeshInstantiator simplifies that process by expecting users provide an array of QMatrix4x4 transformations. The number of transformations dictates the number of instances to draw and each instance will be transformed by one of the transformations.
There is no strict limitations on how many instances can be drawn as it is GPU dependent. For simple meshes, this can easily be thousands of instances.
Public Signals Documentation¶
signal countChanged¶
1 2 3 |
|
signal transformationMatricesChanged¶
1 2 3 |
|
signal entityNameChanged¶
1 2 3 |
|
Public Functions Documentation¶
function MeshInstantiator¶
1 2 3 |
|
function ~MeshInstantiator¶
1 |
|
function count¶
1 |
|
function setEntityName¶
1 2 3 |
|
function entityName¶
1 |
|
function setTransformationMatrices¶
1 2 3 |
|
Set the transformation matrices transformationMatrices to be associated and applied to the instances.
function transformationMatrices¶
1 |
|
Returns the transformation matrices.
Public Property Documentation¶
property entityName¶
1 |
|
The name of the entity to be retrieved from the
property count¶
1 |
|
\readonly
The number of instances being drawn. The number of instances being drawn. It will be at least 1 even if no transformation matrices were provided.
Updated on 2023-07-03 at 11:02:09 +0000