Panda3D
Loading...
Searching...
No Matches
nodeVertexTransform.cxx
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.cxx
10 * @author drose
11 * @date 2007-02-22
12 */
13
14#include "nodeVertexTransform.h"
15
16TypeHandle NodeVertexTransform::_type_handle;
17
18/**
19 *
20 */
21NodeVertexTransform::
22NodeVertexTransform(const PandaNode *node,
23 const VertexTransform *prev) :
24 _node(node),
25 _prev(prev)
26{
27}
28
29/**
30 * Returns the transform of the associated node, composed with the previous
31 * VertexTransform if any, expressed as a matrix.
32 */
34get_matrix(LMatrix4 &matrix) const {
35 if (_prev != nullptr) {
36 LMatrix4 prev_matrix;
37 _prev->get_matrix(prev_matrix);
38 matrix.multiply(_node->get_transform()->get_mat(), prev_matrix);
39
40 } else {
41 matrix = _node->get_transform()->get_mat();
42 }
43}
44
45/**
46 *
47 */
48void NodeVertexTransform::
49output(std::ostream &out) const {
50 if (_prev != nullptr) {
51 _prev->output(out);
52 out << " * ";
53 }
54
55 out << "NodeVertexTransform(" << _node->get_name() << ")";
56}
virtual void get_matrix(LMatrix4 &matrix) const
Returns the transform of the associated node, composed with the previous VertexTransform if any,...
A basic node of the scene graph or data graph.
Definition pandaNode.h:65
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
This is an abstract base class that holds a pointer to some transform, computed in some arbitrary way...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.