modelNode.I 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // Filename: modelNode.I
  2. // Created by: drose (16Mar02)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://etc.cmu.edu/panda3d/docs/license/ .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. ////////////////////////////////////////////////////////////////////
  19. // Function: ModelNode::Constructor
  20. // Access: Public
  21. // Description:
  22. ////////////////////////////////////////////////////////////////////
  23. INLINE ModelNode::
  24. ModelNode(const string &name) :
  25. PandaNode(name)
  26. {
  27. _preserve_transform = PT_none;
  28. }
  29. ////////////////////////////////////////////////////////////////////
  30. // Function: ModelNode::set_preserve_transform
  31. // Access: Public
  32. // Description: Sets the preserve_transform flag. This restricts the
  33. // ability of a flatten operation to affect the
  34. // transform stored on this node. If the flag is:
  35. //
  36. // PT_none - the transform may be adjusted at will.
  37. //
  38. // PT_local - the local (and net) transform should not
  39. // be changed in any way. If necessary, an extra
  40. // transform will be left on the node above to guarantee
  41. // this. This is the strongest restriction.
  42. //
  43. // PT_net - preserve the net transform from the
  44. // root, but it's acceptable to modify the local
  45. // transform stored on this particular node if
  46. // necessary, so long as the net transform is not
  47. // changed. This eliminates the need to drop an extra
  48. // transform on the node above.
  49. ////////////////////////////////////////////////////////////////////
  50. INLINE void ModelNode::
  51. set_preserve_transform(ModelNode::PreserveTransform preserve_transform) {
  52. _preserve_transform = preserve_transform;
  53. }
  54. ////////////////////////////////////////////////////////////////////
  55. // Function: ModelNode::get_preserve_transform
  56. // Access: Public
  57. // Description: Returns the current setting of the preserve_transform
  58. // flag. See set_preserve_transform().
  59. ////////////////////////////////////////////////////////////////////
  60. INLINE ModelNode::PreserveTransform ModelNode::
  61. get_preserve_transform() const {
  62. return _preserve_transform;
  63. }
  64. ////////////////////////////////////////////////////////////////////
  65. // Function: ModelNode::Copy Constructor
  66. // Access: Protected
  67. // Description:
  68. ////////////////////////////////////////////////////////////////////
  69. INLINE ModelNode::
  70. ModelNode(const ModelNode &copy) :
  71. PandaNode(copy),
  72. _preserve_transform(copy._preserve_transform)
  73. {
  74. }