Panda3D
loaderFileTypeDae.cxx
1 // Filename: loaderFileTypeDae.cxx
2 // Created by: rdb (23Aug09)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "loaderFileTypeDae.h"
16 #include "load_collada_file.h"
17 
18 TypeHandle LoaderFileTypeDae::_type_handle;
19 
20 ////////////////////////////////////////////////////////////////////
21 // Function: LoaderFileTypeDae::Constructor
22 // Access: Public
23 // Description:
24 ////////////////////////////////////////////////////////////////////
25 LoaderFileTypeDae::
26 LoaderFileTypeDae() {
27 }
28 
29 ////////////////////////////////////////////////////////////////////
30 // Function: LoaderFileTypeDae::get_name
31 // Access: Public, Virtual
32 // Description:
33 ////////////////////////////////////////////////////////////////////
34 string LoaderFileTypeDae::
35 get_name() const {
36 #if PANDA_COLLADA_VERSION == 14
37  return "COLLADA 1.4";
38 #elif PANDA_COLLADA_VERSION == 15
39  return "COLLADA 1.5";
40 #else
41  return "COLLADA";
42 #endif
43 }
44 
45 ////////////////////////////////////////////////////////////////////
46 // Function: LoaderFileTypeDae::get_extension
47 // Access: Public, Virtual
48 // Description:
49 ////////////////////////////////////////////////////////////////////
50 string LoaderFileTypeDae::
51 get_extension() const {
52  return "dae";
53 }
54 
55 ////////////////////////////////////////////////////////////////////
56 // Function: LoaderFileType::get_additional_extensions
57 // Access: Published, Virtual
58 // Description: Returns a space-separated list of extension, in
59 // addition to the one returned by get_extension(), that
60 // are recognized by this loader.
61 ////////////////////////////////////////////////////////////////////
64  return "zae";
65 }
66 
67 ////////////////////////////////////////////////////////////////////
68 // Function: LoaderFileTypeDae::supports_compressed
69 // Access: Published, Virtual
70 // Description: Returns true if this file type can transparently load
71 // compressed files (with a .pz extension), false
72 // otherwise.
73 ////////////////////////////////////////////////////////////////////
76  return true;
77 }
78 
79 ////////////////////////////////////////////////////////////////////
80 // Function: LoaderFileTypeDae::load_file
81 // Access: Public, Virtual
82 // Description:
83 ////////////////////////////////////////////////////////////////////
84 PT(PandaNode) LoaderFileTypeDae::
85 load_file(const Filename &path, const LoaderOptions &,
86  BamCacheRecord *record) const {
87  PT(PandaNode) result = load_collada_file(path, CS_default, record);
88  return result;
89 }
90 
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
Specifies parameters that may be passed to the loader.
Definition: loaderOptions.h:26
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
An instance of this class is written to the front of a Bam or Txo file to make the file a cached inst...
virtual string get_additional_extensions() const
Returns a space-separated list of extension, in addition to the one returned by get_extension(), that are recognized by this loader.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
virtual bool supports_compressed() const
Returns true if this file type can transparently load compressed files (with a .pz extension)...