00001 // Filename: modelNode.I 00002 // Created by: drose (16Mar02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: ModelNode::Constructor 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE ModelNode:: 00026 ModelNode(const string &name) : 00027 PandaNode(name) 00028 { 00029 _preserve_transform = PT_none; 00030 } 00031 00032 //////////////////////////////////////////////////////////////////// 00033 // Function: ModelNode::set_preserve_transform 00034 // Access: Public 00035 // Description: Sets the preserve_transform flag. This restricts the 00036 // ability of a flatten operation to affect the 00037 // transform stored on this node. If the flag is: 00038 // 00039 // PT_none - the transform may be adjusted at will. 00040 // 00041 // PT_local - the local (and net) transform should not 00042 // be changed in any way. If necessary, an extra 00043 // transform will be left on the node above to guarantee 00044 // this. This is the strongest restriction. 00045 // 00046 // PT_net - preserve the net transform from the 00047 // root, but it's acceptable to modify the local 00048 // transform stored on this particular node if 00049 // necessary, so long as the net transform is not 00050 // changed. This eliminates the need to drop an extra 00051 // transform on the node above. 00052 //////////////////////////////////////////////////////////////////// 00053 INLINE void ModelNode:: 00054 set_preserve_transform(ModelNode::PreserveTransform preserve_transform) { 00055 _preserve_transform = preserve_transform; 00056 } 00057 00058 //////////////////////////////////////////////////////////////////// 00059 // Function: ModelNode::get_preserve_transform 00060 // Access: Public 00061 // Description: Returns the current setting of the preserve_transform 00062 // flag. See set_preserve_transform(). 00063 //////////////////////////////////////////////////////////////////// 00064 INLINE ModelNode::PreserveTransform ModelNode:: 00065 get_preserve_transform() const { 00066 return _preserve_transform; 00067 } 00068 00069 //////////////////////////////////////////////////////////////////// 00070 // Function: ModelNode::Copy Constructor 00071 // Access: Protected 00072 // Description: 00073 //////////////////////////////////////////////////////////////////// 00074 INLINE ModelNode:: 00075 ModelNode(const ModelNode ©) : 00076 PandaNode(copy), 00077 _preserve_transform(copy._preserve_transform) 00078 { 00079 }