47 lines
1 KiB
Text
47 lines
1 KiB
Text
|
/**
|
||
|
* PANDA 3D SOFTWARE
|
||
|
* Copyright (c) Carnegie Mellon University. All rights reserved.
|
||
|
*
|
||
|
* All use of this software is subject to the terms of the revised BSD
|
||
|
* license. You should have received a copy of this license along
|
||
|
* with this source code in a file named "LICENSE."
|
||
|
*
|
||
|
* @file xFileAnimationSet.I
|
||
|
* @author drose
|
||
|
* @date 2004-10-04
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
*/
|
||
|
INLINE XFileAnimationSet::FrameEntry::
|
||
|
FrameEntry() :
|
||
|
_scale(1.0, 1.0, 1.0),
|
||
|
_rot(LQuaterniond::ident_quat()),
|
||
|
_trans(LVector3d::zero()),
|
||
|
_mat(LMatrix4d::ident_mat())
|
||
|
{
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Returns the frame's data as a matrix, composing the matrix first if
|
||
|
* necessary, as indicated by the FrameData's _flags member.
|
||
|
*/
|
||
|
INLINE const LMatrix4d &XFileAnimationSet::FrameEntry::
|
||
|
get_mat(int flags) const {
|
||
|
if ((flags & FDF_mat) == 0) {
|
||
|
((FrameEntry *)this)->_mat = LMatrix4d::scale_mat(_scale) * _rot;
|
||
|
((FrameEntry *)this)->_mat.set_row(3, _trans);
|
||
|
}
|
||
|
return _mat;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
*/
|
||
|
INLINE XFileAnimationSet::FrameData::
|
||
|
FrameData() :
|
||
|
_flags(0)
|
||
|
{
|
||
|
}
|