Visualization Library 2.1.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
COLLADA loader. More...
#include <DaeLoader.hpp>
Public Member Functions | |
DaeLoader () | |
bool | load (VirtualFile *file) |
const ResourceDatabase * | resources () const |
ResourceDatabase * | resources () |
void | setLoadOptions (const LoadWriterDae::LoadOptions *options) |
const LoadWriterDae::LoadOptions * | loadOptions () const |
Protected Member Functions | |
void | reset () |
void | parseInputs (Dae::Primitive *dae_primitive, const domInputLocalOffset_Array &input_arr, const std::vector< ref< Dae::Input > > &vertex_inputs) |
ref< Dae::Mesh > | parseGeometry (daeElement *geometry) |
Dae::Source * | getSource (daeElement *source_el) |
void | bindMaterials (Dae::Node *dae_node, Dae::Mesh *dae_mesh, domBind_materialRef bind_material) |
void | parseNode (daeElement *el, Dae::Node *parent) |
void | parseAsset (domElement *root) |
void | loadImages (const domImage_Array &images) |
void | parseImages (daeElement *library) |
void | parseEffects (daeElement *library) |
void | prepareTexture2D (Dae::Sampler2D *sampler2D) |
void | parseMaterials (daeElement *library) |
ref< Light > | parseLight (domLight *, Transform *) |
void | setupLights () |
ref< Effect > | setup_vl_Effect (Dae::Material *mat) |
template<class T_color_or_texture > | |
void | parseColor (const domProfile_COMMON *common, const T_color_or_texture &color_or_texture, Dae::ColorOrTexture *out_col) |
void | generateGeometry (Dae::Primitive *primitive, const char *name) |
Static Protected Member Functions | |
static std::string | percentDecode (const char *uri) |
static Dae::EInputSemantic | getSemantic (const char *semantic) |
static const char * | getSemanticString (Dae::EInputSemantic semantic) |
static ETexParamFilter | translateSampleFilter (domFx_sampler_filter_common filter) |
static ETexParamWrap | translateWrapMode (domFx_sampler_wrap_common wrap) |
Protected Attributes | |
const LoadWriterDae::LoadOptions * | mLoadOptions |
ref< ResourceDatabase > | mResources |
std::vector< ref< Light > > | mLights |
std::map< daeElementRef, ref< Dae::Material > > | mMaterials |
std::map< daeElementRef, ref< Dae::Effect > > | mEffects |
std::map< daeElementRef, ref< Dae::Mesh > > | mMeshes |
std::vector< ref< Dae::Node > > | mNodes |
std::map< daeElementRef, ref< Dae::Source > > | mSources |
std::map< daeElementRef, ref< Image > > | mImages |
std::map< daeElementRef, ref< Dae::NewParam > > | mDaeNewParams |
ref< Effect > | mDefaultFX |
ref< Dae::Node > | mScene |
DAE | mDAE |
String | mFilePath |
mat4 | mUpMatrix |
bool | mInvertTransparency |
bool | mAssumeOpaque |
COLLADA loader.
Definition at line 41 of file DaeLoader.hpp.
DaeLoader::DaeLoader | ( | ) |
Definition at line 77 of file DaeLoader.cpp.
References vl::EN_LIGHTING, mDefaultFX, vl::PM_LINE, and reset().
|
protected |
Definition at line 527 of file DaeLoader.cpp.
References vl::ref< T >::get(), vl::Dae::Node::mActors, mDefaultFX, mMaterials, vl::Dae::Mesh::mPrimitives, vl::Dae::Node::mTransform, setup_vl_Effect(), VL_CHECK, and VL_LOG_DEBUG.
Referenced by loadOptions(), and parseNode().
|
protected |
Definition at line 1626 of file DaeLoader.cpp.
References vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::at(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::begin(), vl::dot(), vl::LoadWriterDae::LoadOptions::fixBadNormals(), vl::ref< T >::get(), getSemanticString(), vl::Dae::IS_COLOR, vl::Dae::IS_NORMAL, vl::Dae::IS_POSITION, vl::Dae::IS_TEXCOORD, vl::Vector3< T_Scalar >::length(), loadOptions(), vl::Dae::Vert::mAttribIndex, vl::Dae::Primitive::mChannels, mDAE, vl::Dae::Primitive::mGeometry, vl::Dae::Vert::mIndex, vl::Dae::Primitive::mIndexStride, vl::Dae::Primitive::mP, vl::Dae::Primitive::mType, vl::Vector3< T_Scalar >::normalize(), NULL, vl::Dae::PT_LINE_STRIP, vl::PT_LINE_STRIP, vl::Dae::PT_LINES, vl::PT_LINES, vl::PT_POINTS, vl::PT_POLYGON, vl::Dae::PT_POLYGONS, vl::PT_TRIANGLE_FAN, vl::PT_TRIANGLE_STRIP, vl::Dae::PT_TRIANGLES, vl::PT_TRIANGLES, vl::Dae::PT_TRIFANS, vl::Dae::PT_TRISTRIPS, vl::Dae::PT_UNKNOWN, vl::Vector3< T_Scalar >::ptr(), vl::Vector4< T_Scalar >::ptr(), vl::Vector2< T_Scalar >::ptr(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::resize(), vl::MultiDrawElementsBase::setCountVector(), vl::MultiDrawElements< arr_type >::setIndexBuffer(), vl::DrawElements< arr_type >::setIndexBuffer(), vl::Object::setObjectName(), vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::size(), vl::String::toStdString(), VL_CHECK, VL_LOG_DEBUG, VL_TRAP, and vl::Log::warning().
Referenced by loadOptions(), and parseGeometry().
|
staticprotected |
Definition at line 1526 of file DaeLoader.cpp.
References vl::Dae::IS_UNKNOWN.
Referenced by loadOptions(), parseGeometry(), and parseInputs().
|
staticprotected |
Definition at line 1537 of file DaeLoader.cpp.
References NULL.
Referenced by generateGeometry(), and loadOptions().
|
protected |
Definition at line 385 of file DaeLoader.cpp.
References vl::Log::error(), vl::ref< T >::get(), vl::Dae::Source::init(), mSources, NULL, and VL_CHECK.
Referenced by loadOptions(), parseGeometry(), and parseInputs().
bool DaeLoader::load | ( | VirtualFile * | file | ) |
Definition at line 726 of file DaeLoader.cpp.
References vl::Object::as(), vl::Matrix4< T_Scalar >::as3x3(), vl::LoadWriterDae::LoadOptions::computeMissingNormals(), vl::Geometry::computeNormals(), vl::Geometry::drawCalls(), vl::Actor::effect(), vl::EN_LIGHTING, vl::EN_NORMALIZE, vl::Shader::enable(), vl::Log::error(), vl::ref< T >::get(), vl::Shader::getEnableSet(), vl::Shader::getRenderStateSet(), vl::Matrix4< T_Scalar >::getX(), vl::Matrix4< T_Scalar >::getY(), vl::Matrix4< T_Scalar >::getZ(), vl::Matrix4< T_Scalar >::invert(), vl::Shader::isEnabled(), vl::Vector3< T_Scalar >::length(), vl::VirtualFile::load(), loadOptions(), vl::Actor::lod(), mDAE, vl::Geometry::mergeDrawCallsWithTriangles(), vl::Geometry::mergeTriangleStrips(), mFilePath, mLights, mNodes, mResources, mScene, mUpMatrix, vl::Geometry::normalArray(), vl::Object::objectName(), parseAsset(), parseEffects(), parseImages(), parseMaterials(), parseNode(), vl::VirtualFile::path(), vl::PT_UNKNOWN, vl::Transform::removeFromParent(), reset(), vl::Actor::setEffect(), vl::Shader::setEnableSet(), vl::Object::setObjectName(), vl::Shader::setRenderState(), vl::Shader::setRenderStateSet(), setupLights(), vl::Effect::shader(), vl::String::toStdString(), vl::Actor::transform(), vl::Matrix4< T_Scalar >::transpose(), and vl::Transform::worldMatrix().
Referenced by vl::LoadWriterDae::load().
|
protected |
Definition at line 910 of file DaeLoader.cpp.
References vl::Log::error(), vl::loadImage(), mImages, and percentDecode().
Referenced by loadOptions(), parseEffects(), and parseImages().
|
inline |
Definition at line 56 of file DaeLoader.hpp.
References bindMaterials(), generateGeometry(), getSemantic(), getSemanticString(), getSource(), loadImages(), mLoadOptions, parseAsset(), parseColor(), parseEffects(), parseGeometry(), parseImages(), parseInputs(), parseLight(), parseMaterials(), parseNode(), percentDecode(), prepareTexture2D(), reset(), setup_vl_Effect(), setupLights(), translateSampleFilter(), and translateWrapMode().
Referenced by generateGeometry(), load(), parseAsset(), parseNode(), prepareTexture2D(), and setupLights().
|
protected |
Definition at line 1872 of file DaeLoader.cpp.
References loadOptions(), mAssumeOpaque, mInvertTransparency, mUpMatrix, vl::Matrix4< T_Scalar >::setX(), vl::Matrix4< T_Scalar >::setY(), vl::Matrix4< T_Scalar >::setZ(), vl::LoadWriterDae::LoadOptions::TransparencyAuto, vl::LoadWriterDae::LoadOptions::TransparencyInvert, and VL_LOG_DEBUG.
Referenced by load(), and loadOptions().
|
protected |
Definition at line 1575 of file DaeLoader.cpp.
References vl::Dae::ColorOrTexture::mColor, mDaeNewParams, mImages, vl::Dae::ColorOrTexture::mSampler, vl::Dae::ColorOrTexture::mTexCoord, NULL, prepareTexture2D(), VL_CHECK, and VL_LOG_DEBUG.
Referenced by loadOptions(), and parseEffects().
|
protected |
Definition at line 936 of file DaeLoader.cpp.
References vl::Log::error(), loadImages(), mAssumeOpaque, mDaeNewParams, vl::Dae::NewParam::mDaeSampler2D, vl::Dae::NewParam::mDaeSurface, vl::Dae::Effect::mDaeTechniqueCOMMON, vl::Dae::Effect::mDoubleSided, mEffects, vl::Dae::NewParam::mFloat4, mImages, mInvertTransparency, vl::Dae::Effect::mNewParams, vl::Dae::OM_A_ONE, vl::Dae::OM_RGB_ZERO, parseColor(), prepareTexture2D(), vl::Object::setObjectName(), translateSampleFilter(), translateWrapMode(), and VL_LOG_DEBUG.
Referenced by load(), and loadOptions().
Definition at line 149 of file DaeLoader.cpp.
References vl::Log::error(), generateGeometry(), vl::ref< T >::get(), getSemantic(), getSource(), vl::Dae::IS_UNKNOWN, vl::Dae::Primitive::mCount, mDAE, vl::Dae::Primitive::mIndexStride, vl::Dae::Primitive::mMaterial, mMeshes, vl::Dae::Primitive::mP, vl::Dae::Mesh::mPrimitives, vl::Dae::Input::mSemantic, vl::Dae::Input::mSource, vl::Dae::Primitive::mType, vl::Dae::Mesh::mVertexInputs, NULL, parseInputs(), vl::Dae::PT_LINE_STRIP, vl::Dae::PT_LINES, vl::Dae::PT_POLYGONS, vl::Dae::PT_TRIANGLES, vl::Dae::PT_TRIFANS, vl::Dae::PT_TRISTRIPS, and VL_CHECK.
Referenced by loadOptions(), and parseNode().
|
protected |
Definition at line 927 of file DaeLoader.cpp.
References loadImages().
Referenced by load(), and loadOptions().
|
protected |
Definition at line 99 of file DaeLoader.cpp.
References getSemantic(), getSource(), vl::Dae::IS_UNKNOWN, vl::Dae::IS_VERTEX, vl::max(), vl::Dae::Primitive::mChannels, vl::Dae::Primitive::mIndexStride, vl::Dae::Input::mOffset, vl::Dae::Input::mSemantic, vl::Dae::Input::mSet, vl::Dae::Input::mSource, and VL_CHECK.
Referenced by loadOptions(), and parseGeometry().
Definition at line 1324 of file DaeLoader.cpp.
References vl::Light::bindTransform(), vl::Light::setAmbient(), vl::Light::setConstantAttenuation(), vl::Light::setDiffuse(), vl::Light::setLinearAttenuation(), vl::Object::setObjectName(), vl::Light::setPosition(), vl::Light::setQuadraticAttenuation(), vl::Light::setSpecular(), vl::Light::setSpotCutoff(), vl::Light::setSpotDirection(), and vl::Light::setSpotExponent().
Referenced by loadOptions(), and parseNode().
|
protected |
Definition at line 1293 of file DaeLoader.cpp.
References vl::Dae::Material::mDaeEffect, mEffects, mMaterials, and VL_LOG_DEBUG.
Referenced by load(), and loadOptions().
|
protected |
Definition at line 590 of file DaeLoader.cpp.
References bindMaterials(), vl::Log::error(), vl::LoadWriterDae::LoadOptions::extractSkins(), vl::ref< T >::get(), vl::Matrix4< float >::getLookAt(), vl::Matrix4< float >::getRotation(), vl::Matrix4< float >::getScaling(), vl::Matrix4< float >::getTranslation(), loadOptions(), vl::Dae::Node::mChildren, mLights, vl::Dae::Node::mMesh, mNodes, vl::Dae::Node::mTransform, parseGeometry(), parseLight(), vl::Matrix4< T_Scalar >::ptr(), vl::Matrix4< T_Scalar >::transpose(), and VL_CHECK.
Referenced by load(), and loadOptions().
|
staticprotected |
Definition at line 859 of file DaeLoader.cpp.
Referenced by loadImages(), and loadOptions().
|
protected |
Definition at line 1267 of file DaeLoader.cpp.
References loadOptions(), vl::Dae::Sampler2D::mDaeSurface, vl::Dae::Sampler2D::mMagFilter, vl::Dae::Sampler2D::mMinFilter, vl::Dae::Sampler2D::mTexture, vl::Dae::Sampler2D::mWrapS, vl::Dae::Sampler2D::mWrapT, vl::TF_UNKNOWN, vl::TPF_LINEAR, vl::TPF_LINEAR_MIPMAP_NEAREST, and vl::TPF_NEAREST.
Referenced by loadOptions(), parseColor(), and parseEffects().
|
protected |
Definition at line 91 of file DaeLoader.cpp.
References mAssumeOpaque, mInvertTransparency, mResources, mScene, and NULL.
Referenced by DaeLoader(), load(), and loadOptions().
|
inline |
Definition at line 48 of file DaeLoader.hpp.
References mResources.
Referenced by vl::LoadWriterDae::load().
|
inline |
Definition at line 50 of file DaeLoader.hpp.
References mResources.
|
inline |
Definition at line 54 of file DaeLoader.hpp.
References mLoadOptions.
Referenced by vl::LoadWriterDae::load().
|
protected |
Definition at line 431 of file DaeLoader.cpp.
References vl::Vector4< T_Scalar >::a(), vl::clamp(), vl::dot(), vl::EN_BLEND, vl::EN_CULL_FACE, vl::EN_DEPTH_TEST, vl::EN_LIGHTING, vl::Shader::enable(), vl::Log::error(), vl::Shader::gocColor(), vl::Shader::gocLightModel(), vl::Shader::gocMaterial(), vl::Dae::TechniqueCOMMON::mAmbient, mAssumeOpaque, vl::Dae::ColorOrTexture::mColor, vl::Dae::Material::mDaeEffect, vl::Dae::TechniqueCOMMON::mDiffuse, vl::Dae::TechniqueCOMMON::mEmission, vl::Dae::TechniqueCOMMON::mOpaqueMode, vl::Dae::ColorOrTexture::mSampler, vl::Dae::TechniqueCOMMON::mShininess, vl::Dae::TechniqueCOMMON::mSpecular, vl::Dae::TechniqueCOMMON::mTransparency, vl::Dae::TechniqueCOMMON::mTransparent, vl::Material::multiplyTransparency(), vl::Dae::OM_A_ONE, vl::Vector4< T_Scalar >::rgb(), vl::Material::setAmbient(), vl::Material::setDiffuse(), vl::Material::setEmission(), vl::Material::setShininess(), vl::Material::setSpecular(), vl::LightModel::setTwoSide(), vl::Color::setValue(), vl::Effect::shader(), and VL_CHECK.
Referenced by bindMaterials(), and loadOptions().
|
protected |
Definition at line 1430 of file DaeLoader.cpp.
References vl::Light::ambient(), vl::EN_DEPTH_TEST, vl::Shader::enable(), vl::ref< T >::get(), vl::Matrix4< float >::getRotation(), vl::Matrix4< float >::getTranslation(), vl::Shader::gocColor(), vl::Shader::gocPolygonMode(), loadOptions(), vl::makeCone(), vl::makePyramid(), vl::makeTorus(), vl::makeUVSphere(), mLights, mResources, NULL, vl::PM_LINE, vl::Light::position(), vl::PolygonMode::set(), vl::Geometry::setNormalArray(), vl::Object::setObjectName(), vl::Color::setValue(), vl::Effect::shader(), vl::Light::spotCutoff(), vl::Geometry::transform(), and vl::Vector4< T_Scalar >::w().
Referenced by load(), and loadOptions().
|
staticprotected |
Definition at line 1548 of file DaeLoader.cpp.
References vl::TPF_LINEAR, vl::TPF_LINEAR_MIPMAP_LINEAR, vl::TPF_LINEAR_MIPMAP_NEAREST, vl::TPF_NEAREST, vl::TPF_NEAREST_MIPMAP_LINEAR, and vl::TPF_NEAREST_MIPMAP_NEAREST.
Referenced by loadOptions(), and parseEffects().
|
staticprotected |
Definition at line 1562 of file DaeLoader.cpp.
References vl::TPW_CLAMP, vl::TPW_CLAMP_TO_BORDER, vl::TPW_MIRRORED_REPEAT, and vl::TPW_REPEAT.
Referenced by loadOptions(), and parseEffects().
|
protected |
Definition at line 126 of file DaeLoader.hpp.
Referenced by parseAsset(), parseEffects(), reset(), and setup_vl_Effect().
|
protected |
Definition at line 122 of file DaeLoader.hpp.
Referenced by generateGeometry(), load(), and parseGeometry().
|
protected |
Definition at line 119 of file DaeLoader.hpp.
Referenced by parseColor(), and parseEffects().
Definition at line 120 of file DaeLoader.hpp.
Referenced by bindMaterials(), and DaeLoader().
|
protected |
Definition at line 114 of file DaeLoader.hpp.
Referenced by parseEffects(), and parseMaterials().
|
protected |
Definition at line 123 of file DaeLoader.hpp.
Referenced by load().
Definition at line 118 of file DaeLoader.hpp.
Referenced by loadImages(), parseColor(), and parseEffects().
|
protected |
Definition at line 125 of file DaeLoader.hpp.
Referenced by parseAsset(), parseEffects(), and reset().
Definition at line 112 of file DaeLoader.hpp.
Referenced by load(), parseNode(), and setupLights().
|
protected |
Definition at line 108 of file DaeLoader.hpp.
Referenced by loadOptions(), and setLoadOptions().
|
protected |
Definition at line 113 of file DaeLoader.hpp.
Referenced by bindMaterials(), and parseMaterials().
Definition at line 115 of file DaeLoader.hpp.
Referenced by parseGeometry().
Definition at line 116 of file DaeLoader.hpp.
Referenced by load(), and parseNode().
|
protected |
Definition at line 111 of file DaeLoader.hpp.
Referenced by load(), reset(), resources(), and setupLights().
Definition at line 121 of file DaeLoader.hpp.
|
protected |
Definition at line 117 of file DaeLoader.hpp.
Referenced by getSource().
|
protected |
Definition at line 124 of file DaeLoader.hpp.
Referenced by load(), and parseAsset().
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:49.
© Copyright Michele Bosi. All rights reserved.