Panda3D
|
00001 // Filename: modelFlattenRequest.I 00002 // Created by: drose (30Mar07) 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 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: ModelFlattenRequest::Constructor 00018 // Access: Published 00019 // Description: Create a new ModelFlattenRequest, and add it to the loader 00020 // via load_async(), to begin an asynchronous load. 00021 //////////////////////////////////////////////////////////////////// 00022 INLINE ModelFlattenRequest:: 00023 ModelFlattenRequest(PandaNode *orig) : 00024 AsyncTask(orig->get_name()), 00025 _orig(orig), 00026 _is_ready(false) 00027 { 00028 } 00029 00030 //////////////////////////////////////////////////////////////////// 00031 // Function: ModelFlattenRequest::get_orig 00032 // Access: Published 00033 // Description: Returns the original, unflattened node. 00034 //////////////////////////////////////////////////////////////////// 00035 INLINE PandaNode *ModelFlattenRequest:: 00036 get_orig() const { 00037 return _orig; 00038 } 00039 00040 //////////////////////////////////////////////////////////////////// 00041 // Function: ModelFlattenRequest::is_ready 00042 // Access: Published 00043 // Description: Returns true if this request has completed, false if 00044 // it is still pending. When this returns true, you may 00045 // retrieve the model loaded by calling get_result(). 00046 //////////////////////////////////////////////////////////////////// 00047 INLINE bool ModelFlattenRequest:: 00048 is_ready() const { 00049 return _is_ready; 00050 } 00051 00052 //////////////////////////////////////////////////////////////////// 00053 // Function: ModelFlattenRequest::get_model 00054 // Access: Published 00055 // Description: Returns the flattened copy of the model. It is an 00056 // error to call this unless is_ready() returns true. 00057 //////////////////////////////////////////////////////////////////// 00058 INLINE PandaNode *ModelFlattenRequest:: 00059 get_model() const { 00060 nassertr(_is_ready, NULL); 00061 return _model; 00062 }