nodeVertexTransform.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file nodeVertexTransform.h
10  * @author drose
11  * @date 2007-02-22
12  */
13 
14 #ifndef NODEVERTEXTRANSFORM_H
15 #define NODEVERTEXTRANSFORM_H
16 
17 #include "pandabase.h"
18 #include "pandaNode.h"
19 #include "vertexTransform.h"
20 
21 class FactoryParams;
22 
23 /**
24  * This VertexTransform gets its matrix from the Transform stored on a node.
25  * It can also compose its node's transform with another VertexTransform,
26  * allowing you to build up a chain of NodeVertexTransforms that represent a
27  * list of composed matrices.
28  */
29 class EXPCL_PANDA_GRUTIL NodeVertexTransform : public VertexTransform {
30 PUBLISHED:
32  const VertexTransform *prev = NULL);
33 
34  INLINE const PandaNode *get_node() const;
35  INLINE const VertexTransform *get_prev() const;
36  MAKE_PROPERTY(node, get_node);
37  MAKE_PROPERTY(prev, get_prev);
38 
39  virtual void get_matrix(LMatrix4 &matrix) const;
40 
41  virtual void output(ostream &out) const;
42 
43 private:
44  CPT(PandaNode) _node;
45  CPT(VertexTransform) _prev;
46 
47 public:
48  static TypeHandle get_class_type() {
49  return _type_handle;
50  }
51  static void init_type() {
52  VertexTransform::init_type();
53  register_type(_type_handle, "NodeVertexTransform",
54  VertexTransform::get_class_type());
55  }
56  virtual TypeHandle get_type() const {
57  return get_class_type();
58  }
59  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
60 
61 private:
62  static TypeHandle _type_handle;
63 
64  friend class RigidBodyCombiner;
65 };
66 
67 #include "nodeVertexTransform.I"
68 
69 #endif
void register_type(TypeHandle &type_handle, const string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(), along with zero to four record_derivation()s.
Definition: register_type.I:22
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:36
This is a special node that combines multiple independently-moving rigid nodes into one Geom internal...
A basic node of the scene graph or data graph.
Definition: pandaNode.h:63
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is an abstract base class that holds a pointer to some transform, computed in some arbitrary way...
This VertexTransform gets its matrix from the Transform stored on a node.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PT(BoundingVolume) NodePath return node() -> get_bounds(current_thread) ->make_copy()
Returns a newly-allocated bounding volume containing the bottom node and all of its descendants...