Panda3D
|
00001 // Filename: loaderFileTypeDae.cxx 00002 // Created by: rdb (23Aug09) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #include "loaderFileTypeDae.h" 00016 #include "load_collada_file.h" 00017 00018 TypeHandle LoaderFileTypeDae::_type_handle; 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: LoaderFileTypeDae::Constructor 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 LoaderFileTypeDae:: 00026 LoaderFileTypeDae() { 00027 } 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Function: LoaderFileTypeDae::get_name 00031 // Access: Public, Virtual 00032 // Description: 00033 //////////////////////////////////////////////////////////////////// 00034 string LoaderFileTypeDae:: 00035 get_name() const { 00036 #if PANDA_COLLADA_VERSION == 14 00037 return "COLLADA 1.4"; 00038 #elif PANDA_COLLADA_VERSION == 15 00039 return "COLLADA 1.5"; 00040 #else 00041 return "COLLADA"; 00042 #endif 00043 } 00044 00045 //////////////////////////////////////////////////////////////////// 00046 // Function: LoaderFileTypeDae::get_extension 00047 // Access: Public, Virtual 00048 // Description: 00049 //////////////////////////////////////////////////////////////////// 00050 string LoaderFileTypeDae:: 00051 get_extension() const { 00052 return "dae"; 00053 } 00054 00055 //////////////////////////////////////////////////////////////////// 00056 // Function: LoaderFileType::get_additional_extensions 00057 // Access: Published, Virtual 00058 // Description: Returns a space-separated list of extension, in 00059 // addition to the one returned by get_extension(), that 00060 // are recognized by this loader. 00061 //////////////////////////////////////////////////////////////////// 00062 string LoaderFileTypeDae:: 00063 get_additional_extensions() const { 00064 return "zae"; 00065 } 00066 00067 //////////////////////////////////////////////////////////////////// 00068 // Function: LoaderFileTypeDae::supports_compressed 00069 // Access: Published, Virtual 00070 // Description: Returns true if this file type can transparently load 00071 // compressed files (with a .pz extension), false 00072 // otherwise. 00073 //////////////////////////////////////////////////////////////////// 00074 bool LoaderFileTypeDae:: 00075 supports_compressed() const { 00076 return true; 00077 } 00078 00079 //////////////////////////////////////////////////////////////////// 00080 // Function: LoaderFileTypeDae::load_file 00081 // Access: Public, Virtual 00082 // Description: 00083 //////////////////////////////////////////////////////////////////// 00084 PT(PandaNode) LoaderFileTypeDae:: 00085 load_file(const Filename &path, const LoaderOptions &, 00086 BamCacheRecord *record) const { 00087 PT(PandaNode) result = load_collada_file(path, CS_default, record); 00088 return result; 00089 } 00090