Panda3D
xFileAnimationSet.I
1 // Filename: xFileAnimationSet.I
2 // Created by: drose (04Oct04)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: XFileAnimationSet::FrameEntry::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE XFileAnimationSet::FrameEntry::
22 FrameEntry() :
23  _scale(1.0, 1.0, 1.0),
24  _rot(LQuaterniond::ident_quat()),
25  _trans(LVector3d::zero()),
26  _mat(LMatrix4d::ident_mat())
27 {
28 }
29 
30 ////////////////////////////////////////////////////////////////////
31 // Function: XFileAnimationSet::FrameEntry::get_mat
32 // Access: Public
33 // Description: Returns the frame's data as a matrix, composing the
34 // matrix first if necessary, as indicated by the
35 // FrameData's _flags member.
36 ////////////////////////////////////////////////////////////////////
38 get_mat(int flags) const {
39  if ((flags & FDF_mat) == 0) {
40  ((FrameEntry *)this)->_mat = LMatrix4d::scale_mat(_scale) * _rot;
41  ((FrameEntry *)this)->_mat.set_row(3, _trans);
42  }
43  return _mat;
44 }
45 
46 ////////////////////////////////////////////////////////////////////
47 // Function: XFileAnimationSet::FrameData::Constructor
48 // Access: Public
49 // Description:
50 ////////////////////////////////////////////////////////////////////
51 INLINE XFileAnimationSet::FrameData::
52 FrameData() :
53  _flags(0)
54 {
55 }
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:4716
This is the base quaternion class.
Definition: lquaternion.h:974
static LMatrix4d scale_mat(const LVecBase3d &scale)
Returns a matrix that applies the indicated scale in each of the three axes.
Definition: lmatrix.h:6721
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:760
const LMatrix4d & get_mat(int flags) const
Returns the frame's data as a matrix, composing the matrix first if necessary, as indicated by the Fr...