Panda3D
|
00001 // Filename: modelFlattenRequest.cxx 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 #include "modelFlattenRequest.h" 00016 #include "nodePath.h" 00017 00018 TypeHandle ModelFlattenRequest::_type_handle; 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: ModelFlattenRequest::do_task 00022 // Access: Protected, Virtual 00023 // Description: Performs the task: that is, copies and flattens the 00024 // model. 00025 //////////////////////////////////////////////////////////////////// 00026 AsyncTask::DoneStatus ModelFlattenRequest:: 00027 do_task() { 00028 // We make another instance of the original node, so we can safely 00029 // flatten that without affecting the original copy. 00030 NodePath np("flatten_root"); 00031 np.attach_new_node(_orig); 00032 np.flatten_strong(); 00033 _model = np.get_child(0).node(); 00034 _is_ready = true; 00035 00036 // Don't continue the task; we're done. 00037 return DS_done; 00038 }