Static helper class providing various utilities to merge two scenes. It is intended as internal utility and NOT for use by applications.
More...
#include <SceneCombiner.h>
|
static void | MergeScenes (aiScene **dest, std::vector< aiScene * > &src, unsigned int flags=0) |
|
static void | MergeScenes (aiScene **dest, aiScene *master, std::vector< AttachmentInfo > &src, unsigned int flags=0) |
|
static void | MergeMeshes (aiMesh **dest, unsigned int flags, std::vector< aiMesh * >::const_iterator begin, std::vector< aiMesh * >::const_iterator end) |
|
static void | MergeBones (aiMesh *out, std::vector< aiMesh * >::const_iterator it, std::vector< aiMesh * >::const_iterator end) |
|
static void | MergeMaterials (aiMaterial **dest, std::vector< aiMaterial * >::const_iterator begin, std::vector< aiMaterial * >::const_iterator end) |
|
static void | BuildUniqueBoneList (std::list< BoneWithHash > &asBones, std::vector< aiMesh * >::const_iterator it, std::vector< aiMesh * >::const_iterator end) |
|
static void | AddNodePrefixes (aiNode *node, const char *prefix, unsigned int len) |
|
static void | OffsetNodeMeshIndices (aiNode *node, unsigned int offset) |
|
static void | AttachToGraph (aiScene *master, std::vector< NodeAttachmentInfo > &srcList) |
|
static void | AttachToGraph (aiNode *attach, std::vector< NodeAttachmentInfo > &srcList) |
|
static void | CopyScene (aiScene **dest, const aiScene *source, bool allocate=true) |
|
static void | CopySceneFlat (aiScene **dest, const aiScene *source) |
|
static void | Copy (aiMesh **dest, const aiMesh *src) |
|
static void | Copy (aiAnimMesh **dest, const aiAnimMesh *src) |
|
static void | Copy (aiMaterial **dest, const aiMaterial *src) |
|
static void | Copy (aiTexture **dest, const aiTexture *src) |
|
static void | Copy (aiAnimation **dest, const aiAnimation *src) |
|
static void | Copy (aiCamera **dest, const aiCamera *src) |
|
static void | Copy (aiBone **dest, const aiBone *src) |
|
static void | Copy (aiLight **dest, const aiLight *src) |
|
static void | Copy (aiNodeAnim **dest, const aiNodeAnim *src) |
|
static void | Copy (aiMeshMorphAnim **dest, const aiMeshMorphAnim *src) |
|
static void | Copy (aiMetadata **dest, const aiMetadata *src) |
|
static void | Copy (aiNode **dest, const aiNode *src) |
|
Static helper class providing various utilities to merge two scenes. It is intended as internal utility and NOT for use by applications.
The class is currently being used by various postprocessing steps and loaders (ie. LWS).
◆ AddNodePrefixes()
static void Assimp::SceneCombiner::AddNodePrefixes |
( |
aiNode * |
node, |
|
|
const char * |
prefix, |
|
|
unsigned int |
len |
|
) |
| |
|
static |
Add a name prefix to all nodes in a scene.
- Parameters
-
Current | node. This function is called recursively. |
prefix | Prefix to be added to all nodes |
len | STring length |
◆ AttachToGraph()
Attach a list of node graphs to well-defined nodes in a master graph. This is a helper for MergeScenes()
- Parameters
-
master | Master scene |
srcList | List of source scenes along with their attachment points. If an attachment point is nullptr (or does not exist in the master graph), a scene is attached to the root of the master graph (as an additional child node) @duplicates List of duplicates. If elem[n] == n the scene is not a duplicate. Otherwise elem[n] links scene n to its first occurrence. |
◆ BuildUniqueBoneList()
static void Assimp::SceneCombiner::BuildUniqueBoneList |
( |
std::list< BoneWithHash > & |
asBones, |
|
|
std::vector< aiMesh * >::const_iterator |
it, |
|
|
std::vector< aiMesh * >::const_iterator |
end |
|
) |
| |
|
static |
Builds a list of uniquely named bones in a mesh list
- Parameters
-
asBones | Receives the output list |
it | First mesh to be processed |
end | Last mesh to be processed |
◆ Copy()
static void Assimp::SceneCombiner::Copy |
( |
aiMesh ** |
dest, |
|
|
const aiMesh * |
src |
|
) |
| |
|
static |
Get a deep copy of a mesh
- Parameters
-
dest | Receives a pointer to the destination mesh |
src | Source mesh - remains unmodified. |
◆ CopyScene()
static void Assimp::SceneCombiner::CopyScene |
( |
aiScene ** |
dest, |
|
|
const aiScene * |
source, |
|
|
bool |
allocate = true |
|
) |
| |
|
static |
Get a deep copy of a scene
- Parameters
-
dest | Receives a pointer to the destination scene |
src | Source scene - remains unmodified. |
◆ CopySceneFlat()
static void Assimp::SceneCombiner::CopySceneFlat |
( |
aiScene ** |
dest, |
|
|
const aiScene * |
source |
|
) |
| |
|
static |
Get a flat copy of a scene
Only the first hierarchy layer is copied. All pointer members of aiScene are shared by source and destination scene. If the pointer doesn't point to nullptr when the function is called, the existing scene is cleared and refilled.
- Parameters
-
dest | Receives a pointer to the destination scene |
src | Source scene - remains unmodified. |
◆ MergeBones()
static void Assimp::SceneCombiner::MergeBones |
( |
aiMesh * |
out, |
|
|
std::vector< aiMesh * >::const_iterator |
it, |
|
|
std::vector< aiMesh * >::const_iterator |
end |
|
) |
| |
|
static |
Merges two or more bones
- Parameters
-
out | Mesh to receive the output bone list |
flags | Currently no parameters |
begin | First mesh to be processed |
end | Points to the mesh after the last mesh to be processed |
◆ MergeMaterials()
static void Assimp::SceneCombiner::MergeMaterials |
( |
aiMaterial ** |
dest, |
|
|
std::vector< aiMaterial * >::const_iterator |
begin, |
|
|
std::vector< aiMaterial * >::const_iterator |
end |
|
) |
| |
|
static |
Merges two or more materials
The materials should be complementary as much as possible. In case of a property present in different materials, the first occurrence is used.
- Parameters
-
dest | Destination material. Must be empty. |
begin | First material to be processed |
end | Points to the material after the last material to be processed |
◆ MergeMeshes()
static void Assimp::SceneCombiner::MergeMeshes |
( |
aiMesh ** |
dest, |
|
|
unsigned int |
flags, |
|
|
std::vector< aiMesh * >::const_iterator |
begin, |
|
|
std::vector< aiMesh * >::const_iterator |
end |
|
) |
| |
|
static |
Merges two or more meshes
The meshes should have equal vertex formats. Only components that are provided by ALL meshes will be present in the output mesh. An exception is made for VColors - they are set to black. The meshes should have the same material indices, too. The output material index is always the material index of the first mesh.
- Parameters
-
dest | Destination mesh. Must be empty. |
flags | Currently no parameters |
begin | First mesh to be processed |
end | Points to the mesh after the last mesh to be processed |
◆ MergeScenes() [1/2]
static void Assimp::SceneCombiner::MergeScenes |
( |
aiScene ** |
dest, |
|
|
aiScene * |
master, |
|
|
std::vector< AttachmentInfo > & |
src, |
|
|
unsigned int |
flags = 0 |
|
) |
| |
|
static |
Merges two or more scenes and attaches all scenes to a specific position in the node graph of the master scene.
- Parameters
-
dest | Receives a pointer to the destination scene. If the pointer doesn't point to nullptr when the function is called, the existing scene is cleared and refilled. |
master | Master scene. It will be deleted afterwards. All other scenes will be inserted in its node graph. |
src | Non-empty list of scenes to be merged along with their corresponding attachment points in the master scene. The function deletes the input scenes afterwards. There may be duplicate scenes. |
flags | Combination of the AI_INT_MERGE_SCENE flags defined above |
◆ MergeScenes() [2/2]
static void Assimp::SceneCombiner::MergeScenes |
( |
aiScene ** |
dest, |
|
|
std::vector< aiScene * > & |
src, |
|
|
unsigned int |
flags = 0 |
|
) |
| |
|
static |
Merges two or more scenes.
- Parameters
-
dest | Receives a pointer to the destination scene. If the pointer doesn't point to nullptr when the function is called, the existing scene is cleared and refilled. |
src | Non-empty list of scenes to be merged. The function deletes the input scenes afterwards. There may be duplicate scenes. |
flags | Combination of the AI_INT_MERGE_SCENE flags defined above |
◆ OffsetNodeMeshIndices()
static void Assimp::SceneCombiner::OffsetNodeMeshIndices |
( |
aiNode * |
node, |
|
|
unsigned int |
offset |
|
) |
| |
|
static |
Add an offset to all mesh indices in a node graph
- Parameters
-
Current | node. This function is called recursively. |
offset | Offset to be added to all mesh indices |
The documentation for this class was generated from the following file: