Panda3D

xFileAnimationSet.I

00001 // Filename: xFileAnimationSet.I
00002 // Created by:  drose (04Oct04)
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 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: XFileAnimationSet::FrameEntry::Constructor
00018 //       Access: Public
00019 //  Description:
00020 ////////////////////////////////////////////////////////////////////
00021 INLINE XFileAnimationSet::FrameEntry::
00022 FrameEntry() :
00023   _scale(1.0, 1.0, 1.0),
00024   _rot(LQuaterniond::ident_quat()),
00025   _trans(LVector3d::zero()),
00026   _mat(LMatrix4d::ident_mat())
00027 {
00028 }
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //     Function: XFileAnimationSet::FrameEntry::get_mat
00032 //       Access: Public
00033 //  Description: Returns the frame's data as a matrix, composing the
00034 //               matrix first if necessary, as indicated by the
00035 //               FrameData's _flags member.
00036 ////////////////////////////////////////////////////////////////////
00037 INLINE const LMatrix4d &XFileAnimationSet::FrameEntry::
00038 get_mat(int flags) const {
00039   if ((flags & FDF_mat) == 0) {
00040     ((FrameEntry *)this)->_mat = LMatrix4d::scale_mat(_scale) * _rot;
00041     ((FrameEntry *)this)->_mat.set_row(3, _trans);
00042   }
00043   return _mat;
00044 }
00045 
00046 ////////////////////////////////////////////////////////////////////
00047 //     Function: XFileAnimationSet::FrameData::Constructor
00048 //       Access: Public
00049 //  Description:
00050 ////////////////////////////////////////////////////////////////////
00051 INLINE XFileAnimationSet::FrameData::
00052 FrameData() :
00053   _flags(0)
00054 {
00055 }
 All Classes Functions Variables Enumerations