Panda3D
|
00001 // Filename: nodeVertexTransform.h 00002 // Created by: drose (22eb07) 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 #ifndef NODEVERTEXTRANSFORM_H 00016 #define NODEVERTEXTRANSFORM_H 00017 00018 #include "pandabase.h" 00019 #include "pandaNode.h" 00020 #include "vertexTransform.h" 00021 00022 class FactoryParams; 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : NodeVertexTransform 00026 // Description : This VertexTransform gets its matrix from the 00027 // Transform stored on a node. It can also compose its 00028 // node's transform with another VertexTransform, 00029 // allowing you to build up a chain of 00030 // NodeVertexTransforms that represent a list of 00031 // composed matrices. 00032 //////////////////////////////////////////////////////////////////// 00033 class EXPCL_PANDA_GRUTIL NodeVertexTransform : public VertexTransform { 00034 PUBLISHED: 00035 NodeVertexTransform(const PandaNode *node, 00036 const VertexTransform *prev = NULL); 00037 00038 INLINE const PandaNode *get_node() const; 00039 INLINE const VertexTransform *get_prev() const; 00040 00041 virtual void get_matrix(LMatrix4 &matrix) const; 00042 00043 virtual void output(ostream &out) const; 00044 00045 private: 00046 CPT(PandaNode) _node; 00047 CPT(VertexTransform) _prev; 00048 00049 public: 00050 static TypeHandle get_class_type() { 00051 return _type_handle; 00052 } 00053 static void init_type() { 00054 VertexTransform::init_type(); 00055 register_type(_type_handle, "NodeVertexTransform", 00056 VertexTransform::get_class_type()); 00057 } 00058 virtual TypeHandle get_type() const { 00059 return get_class_type(); 00060 } 00061 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00062 00063 private: 00064 static TypeHandle _type_handle; 00065 00066 friend class RigidBodyCombiner; 00067 }; 00068 00069 #include "nodeVertexTransform.I" 00070 00071 #endif