2008-05-09 17:24:28 +00:00
|
|
|
/*
|
|
|
|
---------------------------------------------------------------------------
|
2008-05-22 10:20:31 +00:00
|
|
|
Open Asset Import Library (ASSIMP)
|
2008-05-09 17:24:28 +00:00
|
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
Copyright (c) 2006-2008, ASSIMP Development Team
|
|
|
|
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
Redistribution and use of this software in source and binary forms,
|
|
|
|
with or without modification, are permitted provided that the following
|
|
|
|
conditions are met:
|
|
|
|
|
|
|
|
* Redistributions of source code must retain the above
|
|
|
|
copyright notice, this list of conditions and the
|
|
|
|
following disclaimer.
|
|
|
|
|
|
|
|
* Redistributions in binary form must reproduce the above
|
|
|
|
copyright notice, this list of conditions and the
|
|
|
|
following disclaimer in the documentation and/or other
|
|
|
|
materials provided with the distribution.
|
|
|
|
|
|
|
|
* Neither the name of the ASSIMP team, nor the names of its
|
|
|
|
contributors may be used to endorse or promote products
|
|
|
|
derived from this software without specific prior
|
|
|
|
written permission of the ASSIMP Development Team.
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2009-01-13 18:58:07 +00:00
|
|
|
/** @file aiScene.h
|
|
|
|
* @brief Defines the data structures in which the imported scene is returned.
|
|
|
|
*/
|
2008-10-19 11:32:33 +00:00
|
|
|
#ifndef __AI_SCENE_H_INC__
|
|
|
|
#define __AI_SCENE_H_INC__
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
#include "aiTypes.h"
|
2008-10-19 11:32:33 +00:00
|
|
|
#include "aiTexture.h"
|
2008-05-05 12:36:31 +00:00
|
|
|
#include "aiMesh.h"
|
2008-10-19 11:32:33 +00:00
|
|
|
#include "aiLight.h"
|
|
|
|
#include "aiCamera.h"
|
2008-05-05 12:36:31 +00:00
|
|
|
#include "aiMaterial.h"
|
|
|
|
#include "aiAnim.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
2008-05-05 12:36:31 +00:00
|
|
|
/** A node in the imported hierarchy.
|
2009-02-11 20:56:05 +00:00
|
|
|
*
|
|
|
|
* Each node has name, a parent node (except for the root node),
|
|
|
|
* a transformation relative to its parent and possibly several child nodes.
|
|
|
|
* Simple file formats don't support hierarchical structures - for these formats
|
|
|
|
* the imported scene does consist of only a single root node without children.
|
|
|
|
*/
|
|
|
|
// -------------------------------------------------------------------------------
|
2008-05-05 12:36:31 +00:00
|
|
|
struct aiNode
|
|
|
|
{
|
|
|
|
/** The name of the node.
|
2009-02-11 20:56:05 +00:00
|
|
|
*
|
|
|
|
* The name might be empty (length of zero) but all nodes which
|
|
|
|
* need to be accessed afterwards by bones or anims are usually named.
|
|
|
|
* Multiple nodes may have the same name, but nodes which are accessed
|
|
|
|
* by bones (see #aiBone and #aiMesh::mBones) *must* be unique.
|
|
|
|
*
|
|
|
|
* Cameras and lights are assigned to a specific node name - if there
|
|
|
|
* are multiple nodes with this name, they're assigned to each of them.
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
* <br>
|
|
|
|
* There are no limitations regarding the characters contained in
|
|
|
|
* this text. You should be able to handle stuff like whitespace, tabs,
|
|
|
|
* linefeeds, quotation marks, ampersands, ... .
|
2009-02-11 20:56:05 +00:00
|
|
|
*/
|
2008-05-09 17:24:28 +00:00
|
|
|
C_STRUCT aiString mName;
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
/** The transformation relative to the node's parent. */
|
2009-01-12 22:06:54 +00:00
|
|
|
C_STRUCT aiMatrix4x4 mTransformation;
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
/** Parent node. NULL if this node is the root node. */
|
2008-05-09 17:24:28 +00:00
|
|
|
C_STRUCT aiNode* mParent;
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
/** The number of child nodes of this node. */
|
|
|
|
unsigned int mNumChildren;
|
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
/** The child nodes of this node. NULL if mNumChildren is 0. */
|
2008-05-09 17:24:28 +00:00
|
|
|
C_STRUCT aiNode** mChildren;
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
/** The number of meshes of this node. */
|
|
|
|
unsigned int mNumMeshes;
|
|
|
|
|
|
|
|
/** The meshes of this node. Each entry is an index into the mesh */
|
|
|
|
unsigned int* mMeshes;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
/** Constructor */
|
|
|
|
aiNode()
|
|
|
|
{
|
2008-06-22 10:09:26 +00:00
|
|
|
// set all members to zero by default
|
2008-05-05 12:36:31 +00:00
|
|
|
mParent = NULL;
|
|
|
|
mNumChildren = 0; mChildren = NULL;
|
|
|
|
mNumMeshes = 0; mMeshes = NULL;
|
|
|
|
}
|
|
|
|
|
2008-08-15 23:23:28 +00:00
|
|
|
/** Construction from a specific name */
|
|
|
|
aiNode(const std::string& name)
|
|
|
|
{
|
|
|
|
// set all members to zero by default
|
|
|
|
mParent = NULL;
|
|
|
|
mNumChildren = 0; mChildren = NULL;
|
|
|
|
mNumMeshes = 0; mMeshes = NULL;
|
|
|
|
mName = name;
|
|
|
|
}
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
/** Destructor */
|
|
|
|
~aiNode()
|
|
|
|
{
|
2008-10-19 11:32:33 +00:00
|
|
|
// delete all children recursively
|
|
|
|
// to make sure we won't crash if the data is invalid ...
|
|
|
|
if (mChildren && mNumChildren)
|
2008-10-13 16:45:48 +00:00
|
|
|
{
|
|
|
|
for( unsigned int a = 0; a < mNumChildren; a++)
|
|
|
|
delete mChildren[a];
|
|
|
|
}
|
2008-11-04 17:21:08 +00:00
|
|
|
delete [] mChildren;
|
2008-05-05 12:36:31 +00:00
|
|
|
delete [] mMeshes;
|
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
/** Searches for a node with a specific name, beginning at this
|
|
|
|
* nodes. Normally you will call this method on the root node
|
|
|
|
* of the scene.
|
|
|
|
*
|
2009-01-13 18:58:07 +00:00
|
|
|
* @param name Name to search for
|
2008-10-19 11:32:33 +00:00
|
|
|
* @return NULL or a valid Node if the search was successful.
|
|
|
|
*/
|
|
|
|
inline aiNode* FindNode(const aiString& name)
|
|
|
|
{
|
2009-02-11 20:56:05 +00:00
|
|
|
return FindNode(name.data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @override
|
|
|
|
*/
|
|
|
|
inline aiNode* FindNode(const char* name)
|
|
|
|
{
|
|
|
|
if (!::strcmp( mName.data,name))return this;
|
2008-10-19 11:32:33 +00:00
|
|
|
for (unsigned int i = 0; i < mNumChildren;++i)
|
|
|
|
{
|
|
|
|
aiNode* p = mChildren[i]->FindNode(name);
|
|
|
|
if (p)return p;
|
|
|
|
}
|
|
|
|
// there is definitely no sub node with this name
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
#endif // __cplusplus
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
2008-10-19 11:32:33 +00:00
|
|
|
/** @def AI_SCENE_FLAGS_INCOMPLETE
|
|
|
|
* Specifies that the scene data structure that was imported is not complete.
|
|
|
|
* This flag bypasses some internal validations and allows the import
|
|
|
|
* of animation skeletons, material libraries or camera animation paths
|
|
|
|
* using Assimp. Most applications won't support such data.
|
|
|
|
*/
|
|
|
|
#define AI_SCENE_FLAGS_INCOMPLETE 0x1
|
|
|
|
|
|
|
|
/** @def AI_SCENE_FLAGS_VALIDATED
|
|
|
|
* This flag is set by the validation postprocess-step (aiPostProcess_ValidateDS)
|
|
|
|
* if the validation is successful. In a validated scene you can be sure that
|
|
|
|
* any cross references in the data structure (e.g. vertex indices) are valid.
|
|
|
|
*/
|
|
|
|
#define AI_SCENE_FLAGS_VALIDATED 0x2
|
|
|
|
|
|
|
|
/** @def AI_SCENE_FLAGS_VALIDATION_WARNING
|
|
|
|
* This flag is set by the validation postprocess-step (aiPostProcess_ValidateDS)
|
|
|
|
* if the validation is successful but some issues have been found.
|
|
|
|
* This can for example mean that a texture that does not exist is referenced
|
|
|
|
* by a material or that the bone weights for a vertex don't sum to 1.0 ... .
|
|
|
|
* In most cases you should still be able to use the import. This flag could
|
|
|
|
* be useful for applications which don't capture Assimp's log output.
|
|
|
|
*/
|
|
|
|
#define AI_SCENE_FLAGS_VALIDATION_WARNING 0x4
|
|
|
|
|
|
|
|
/** @def AI_SCENE_FLAGS_NON_VERBOSE_FORMAT
|
|
|
|
* This flag is currently only set by the aiProcess_JoinIdenticalVertices step.
|
|
|
|
* It indicates that the vertices of the output meshes aren't in the internal
|
|
|
|
* verbose format anymore. In the verbose format all vertices are unique,
|
|
|
|
* no vertex is ever referenced by more than one face.
|
|
|
|
*/
|
|
|
|
#define AI_SCENE_FLAGS_NON_VERBOSE_FORMAT 0x8
|
2008-07-18 20:29:46 +00:00
|
|
|
|
2009-01-10 17:58:06 +00:00
|
|
|
/** @def AI_SCENE_FLAGS_TERRAIN
|
|
|
|
* Denotes pure height-map terrain data. Pure terrains usually consist of quads,
|
|
|
|
* sometimes triangles, in a regular grid. The x,y coordinates of all vertex
|
|
|
|
* positions refer to the x,y coordinates on the terrain height map, the z-axis
|
|
|
|
* stores the elevation at a specific point.
|
|
|
|
*
|
|
|
|
* TER (Terragen) and HMP (3D Game Studio) are height map formats.
|
2009-01-13 18:58:07 +00:00
|
|
|
* @note Assimp is probably not the best choice for loading *huge* terrains -
|
2009-01-10 17:58:06 +00:00
|
|
|
* fully triangulated data takes extremely much free store and should be avoided
|
|
|
|
* as long as possible (typically you'll do the triangulation when you actually
|
|
|
|
* need to render it).
|
|
|
|
*/
|
2009-02-15 20:29:07 +00:00
|
|
|
#define AI_SCENE_FLAGS_TERRAIN 0x10
|
|
|
|
|
2009-01-10 17:58:06 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// -------------------------------------------------------------------------------
|
2008-05-05 12:36:31 +00:00
|
|
|
/** The root structure of the imported data.
|
2009-02-11 20:56:05 +00:00
|
|
|
*
|
|
|
|
* Everything that was imported from the given file can be accessed from here.
|
|
|
|
* Objects of this class are generally maintained and owned by Assimp, not
|
|
|
|
* by the caller. You shouldn't want to instance it, nor should you ever try to
|
|
|
|
* delete a given scene on your own.
|
|
|
|
*/
|
|
|
|
// -------------------------------------------------------------------------------
|
2008-05-05 12:36:31 +00:00
|
|
|
struct aiScene
|
|
|
|
{
|
2008-07-10 16:49:01 +00:00
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
/** Any combination of the AI_SCENE_FLAGS_XXX flags. By default
|
|
|
|
* this value is 0, no flags are set. Most applications will
|
|
|
|
* want to reject all scenes with the AI_SCENE_FLAGS_INCOMPLETE
|
|
|
|
* bit set.
|
|
|
|
*/
|
2008-07-10 16:49:01 +00:00
|
|
|
unsigned int mFlags;
|
|
|
|
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
/** The root node of the hierarchy.
|
|
|
|
*
|
|
|
|
* There will always be at least the root node if the import
|
2008-10-19 11:32:33 +00:00
|
|
|
* was successful (and no special flags have been set).
|
|
|
|
* Presence of further nodes depends on the format and content
|
|
|
|
* of the imported file.
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
2008-05-09 17:24:28 +00:00
|
|
|
C_STRUCT aiNode* mRootNode;
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
/** The number of meshes in the scene. */
|
|
|
|
unsigned int mNumMeshes;
|
|
|
|
|
|
|
|
/** The array of meshes.
|
|
|
|
*
|
|
|
|
* Use the indices given in the aiNode structure to access
|
2008-10-19 11:32:33 +00:00
|
|
|
* this array. The array is mNumMeshes in size. If the
|
|
|
|
* AI_SCENE_FLAGS_INCOMPLETE flag is not set there will always
|
|
|
|
* be at least ONE material.
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
2008-05-09 17:24:28 +00:00
|
|
|
C_STRUCT aiMesh** mMeshes;
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
/** The number of materials in the scene. */
|
|
|
|
unsigned int mNumMaterials;
|
|
|
|
|
|
|
|
/** The array of materials.
|
|
|
|
*
|
|
|
|
* Use the index given in each aiMesh structure to access this
|
2008-10-19 11:32:33 +00:00
|
|
|
* array. The array is mNumMaterials in size. If the
|
|
|
|
* AI_SCENE_FLAGS_INCOMPLETE flag is not set there will always
|
|
|
|
* be at least ONE material.
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
2008-05-09 17:24:28 +00:00
|
|
|
C_STRUCT aiMaterial** mMaterials;
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
/** The number of animations in the scene. */
|
|
|
|
unsigned int mNumAnimations;
|
|
|
|
|
|
|
|
/** The array of animations.
|
|
|
|
*
|
|
|
|
* All animations imported from the given file are listed here.
|
|
|
|
* The array is mNumAnimations in size.
|
|
|
|
*/
|
2008-05-09 17:24:28 +00:00
|
|
|
C_STRUCT aiAnimation** mAnimations;
|
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
|
|
|
|
|
2008-05-09 17:24:28 +00:00
|
|
|
/** The number of textures embedded into the file */
|
|
|
|
unsigned int mNumTextures;
|
|
|
|
|
|
|
|
/** The array of embedded textures.
|
|
|
|
*
|
2009-01-13 18:58:07 +00:00
|
|
|
* Not many file formats embed their textures into the file.
|
2008-06-22 10:09:26 +00:00
|
|
|
* An example is Quake's MDL format (which is also used by
|
2008-10-19 11:32:33 +00:00
|
|
|
* some GameStudio versions)
|
2008-05-09 17:24:28 +00:00
|
|
|
*/
|
|
|
|
C_STRUCT aiTexture** mTextures;
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
/** The number of light sources in the scene. Light sources
|
|
|
|
are fully optional, in most cases this attribute will be 0 */
|
|
|
|
unsigned int mNumLights;
|
|
|
|
|
|
|
|
/** The array of light sources.
|
|
|
|
*
|
|
|
|
* All light sources imported from the given file are
|
|
|
|
* listed here. The array is mNumLights in size.
|
|
|
|
*/
|
|
|
|
C_STRUCT aiLight** mLights;
|
|
|
|
|
|
|
|
|
|
|
|
/** The number of cameras in the scene. Cameras
|
|
|
|
are fully optional, in most cases this attribute will be 0 */
|
|
|
|
unsigned int mNumCameras;
|
|
|
|
|
|
|
|
/** The array of cameras.
|
|
|
|
*
|
|
|
|
* All cameras imported from the given file are listed here.
|
|
|
|
* The array is mNumCameras in size. The first camera in the
|
|
|
|
* array (if existing) is the default camera view into
|
|
|
|
* the scene.
|
|
|
|
*/
|
|
|
|
C_STRUCT aiCamera** mCameras;
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
#ifdef __cplusplus
|
2008-06-22 10:09:26 +00:00
|
|
|
|
|
|
|
//! Default constructor
|
2008-05-05 12:36:31 +00:00
|
|
|
aiScene()
|
|
|
|
{
|
2008-06-22 10:09:26 +00:00
|
|
|
// set all members to zero by default
|
2008-05-05 12:36:31 +00:00
|
|
|
mRootNode = NULL;
|
|
|
|
mNumMeshes = 0; mMeshes = NULL;
|
|
|
|
mNumMaterials = 0; mMaterials = NULL;
|
|
|
|
mNumAnimations = 0; mAnimations = NULL;
|
2008-05-09 17:24:28 +00:00
|
|
|
mNumTextures = 0; mTextures = NULL;
|
2008-10-19 11:32:33 +00:00
|
|
|
mNumCameras = 0; mCameras = NULL;
|
|
|
|
mNumLights = 0; mLights = NULL;
|
2008-07-10 16:49:01 +00:00
|
|
|
mFlags = 0;
|
2008-05-05 12:36:31 +00:00
|
|
|
}
|
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
//! Destructor
|
2008-05-05 12:36:31 +00:00
|
|
|
~aiScene()
|
|
|
|
{
|
2009-01-13 18:58:07 +00:00
|
|
|
// delete all sub-objects recursively
|
2008-05-05 12:36:31 +00:00
|
|
|
delete mRootNode;
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
// To make sure we won't crash if the data is invalid it's
|
2009-01-13 18:58:07 +00:00
|
|
|
// much better to check whether both mNumXXX and mXXX are
|
2008-10-19 11:32:33 +00:00
|
|
|
// valid instead of relying on just one of them.
|
|
|
|
if (mNumMeshes && mMeshes)
|
2008-07-10 16:49:01 +00:00
|
|
|
for( unsigned int a = 0; a < mNumMeshes; a++)
|
|
|
|
delete mMeshes[a];
|
2008-11-04 17:21:08 +00:00
|
|
|
delete [] mMeshes;
|
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
if (mNumMaterials && mMaterials)
|
2008-07-10 16:49:01 +00:00
|
|
|
for( unsigned int a = 0; a < mNumMaterials; a++)
|
|
|
|
delete mMaterials[a];
|
2008-11-04 17:21:08 +00:00
|
|
|
delete [] mMaterials;
|
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
if (mNumAnimations && mAnimations)
|
2008-07-10 16:49:01 +00:00
|
|
|
for( unsigned int a = 0; a < mNumAnimations; a++)
|
|
|
|
delete mAnimations[a];
|
2008-11-04 17:21:08 +00:00
|
|
|
delete [] mAnimations;
|
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
if (mNumTextures && mTextures)
|
2008-07-10 16:49:01 +00:00
|
|
|
for( unsigned int a = 0; a < mNumTextures; a++)
|
|
|
|
delete mTextures[a];
|
2008-11-04 17:21:08 +00:00
|
|
|
delete [] mTextures;
|
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
if (mNumLights && mLights)
|
|
|
|
for( unsigned int a = 0; a < mNumLights; a++)
|
|
|
|
delete mLights[a];
|
2008-11-04 17:21:08 +00:00
|
|
|
delete [] mLights;
|
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
if (mNumCameras && mCameras)
|
|
|
|
for( unsigned int a = 0; a < mNumCameras; a++)
|
|
|
|
delete mCameras[a];
|
2008-11-04 17:21:08 +00:00
|
|
|
delete [] mCameras;
|
2008-05-05 12:36:31 +00:00
|
|
|
}
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
//! Check whether the scene contains meshes
|
|
|
|
//! Unless no special scene flags are set this will always be true.
|
|
|
|
inline bool HasMeshes() const
|
2008-11-04 17:21:08 +00:00
|
|
|
{ return mMeshes != NULL && mNumMeshes > 0; }
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
//! Check whether the scene contains materials
|
|
|
|
//! Unless no special scene flags are set this will always be true.
|
|
|
|
inline bool HasMaterials() const
|
2008-11-04 17:21:08 +00:00
|
|
|
{ return mMaterials != NULL && mNumMaterials > 0; }
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
//! Check whether the scene contains lights
|
|
|
|
inline bool HasLights() const
|
2008-11-04 17:21:08 +00:00
|
|
|
{ return mLights != NULL && mNumLights > 0; }
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
//! Check whether the scene contains textures
|
|
|
|
inline bool HasTextures() const
|
2008-11-04 17:21:08 +00:00
|
|
|
{ return mTextures != NULL && mNumTextures > 0; }
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
//! Check whether the scene contains cameras
|
|
|
|
inline bool HasCameras() const
|
2008-11-04 17:21:08 +00:00
|
|
|
{ return mCameras != NULL && mNumCameras > 0; }
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
//! Check whether the scene contains animations
|
|
|
|
inline bool HasAnimations() const
|
2008-11-04 17:21:08 +00:00
|
|
|
{ return mAnimations != NULL && mNumAnimations > 0; }
|
2008-10-19 11:32:33 +00:00
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
#endif // __cplusplus
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2009-01-12 22:06:54 +00:00
|
|
|
} //! namespace Assimp
|
2008-05-05 12:36:31 +00:00
|
|
|
#endif
|
|
|
|
|
2008-10-19 11:32:33 +00:00
|
|
|
#endif // __AI_SCENE_H_INC__
|