Panda3D
Main Page
Classes
Files
File List
All
Classes
Functions
Variables
Enumerations
pandatool
src
xfileegg
xFileAnimationSet.h
1
// Filename: xFileAnimationSet.h
2
// Created by: drose (02Oct04)
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
#ifndef XFILEANIMATIONSET_H
16
#define XFILEANIMATIONSET_H
17
18
#include "pandatoolbase.h"
19
#include "pmap.h"
20
#include "epvector.h"
21
#include "luse.h"
22
#include "namable.h"
23
24
class
XFileToEggConverter
;
25
class
EggGroup
;
26
class
EggTable
;
27
class
EggXfmSAnim
;
28
29
////////////////////////////////////////////////////////////////////
30
// Class : XFileAnimationSet
31
// Description : This represents a tree of EggTables, corresponding to
32
// Animation entries in the X file. There is one
33
// EggTable for each joint in the character's joint
34
// set, and the whole tree is structured as a
35
// mirror of the joint set.
36
////////////////////////////////////////////////////////////////////
37
class
XFileAnimationSet
:
public
Namable
{
38
public
:
39
XFileAnimationSet
();
40
~
XFileAnimationSet
();
41
42
bool
create_hierarchy
(
XFileToEggConverter
*converter);
43
EggXfmSAnim
*
get_table
(
const
string
&joint_name)
const
;
44
45
enum
FrameDataFlags {
46
FDF_scale = 0x01,
47
FDF_rot = 0x02,
48
FDF_trans = 0x04,
49
FDF_mat = 0x08,
50
};
51
52
class
FrameEntry
{
53
public
:
54
INLINE
FrameEntry
();
55
INLINE
const
LMatrix4d
&
get_mat
(
int
flags)
const
;
56
57
LVecBase3d
_scale;
58
LQuaterniond
_rot;
59
LVector3d
_trans;
60
LMatrix4d
_mat;
61
};
62
63
typedef
epvector<FrameEntry> FrameEntries;
64
65
class
FrameData
{
66
public
:
67
INLINE
FrameData
();
68
FrameEntries _entries;
69
int
_flags;
70
};
71
72
FrameData
&
create_frame_data
(
const
string
&joint_name);
73
74
public
:
75
double
_frame_rate;
76
77
private
:
78
void
mirror_table(
XFileToEggConverter
*converter,
79
EggGroup
*model_node,
EggTable
*anim_node);
80
81
typedef
pmap<string, FrameData>
JointData
;
82
JointData
_joint_data;
83
84
class
TablePair {
85
public
:
86
EggGroup
*_joint;
87
EggXfmSAnim
*_table;
88
};
89
90
typedef
pmap<string, TablePair>
Tables;
91
Tables _tables;
92
};
93
94
#include "xFileAnimationSet.I"
95
96
#endif
97
XFileAnimationSet::FrameData
Definition:
xFileAnimationSet.h:65
pmap< string, FrameData >
LMatrix4d
This is a 4-by-4 transform matrix.
Definition:
lmatrix.h:4716
XFileAnimationSet::create_frame_data
FrameData & create_frame_data(const string &joint_name)
Returns a reference to a new FrameData table corresponding to the indicated joint.
Definition:
xFileAnimationSet.cxx:128
XFileAnimationSet::create_hierarchy
bool create_hierarchy(XFileToEggConverter *converter)
Sets up the hierarchy of EggTables corresponding to this AnimationSet.
Definition:
xFileAnimationSet.cxx:50
LQuaterniond
This is the base quaternion class.
Definition:
lquaternion.h:974
XFileAnimationSet
This represents a tree of EggTables, corresponding to Animation entries in the X file.
Definition:
xFileAnimationSet.h:37
EggGroup
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
Definition:
eggGroup.h:36
XFileAnimationSet::get_table
EggXfmSAnim * get_table(const string &joint_name) const
Returns the table associated with the indicated joint name.
Definition:
xFileAnimationSet.cxx:112
Namable
A base class for all things which can have a name.
Definition:
namable.h:29
XFileAnimationSet::FrameEntry
Definition:
xFileAnimationSet.h:52
EggXfmSAnim
This corresponds to an <Xfm$Anim_S$> entry, which is a collection of up to nine <S$Anim> entries that...
Definition:
eggXfmSAnim.h:33
LVecBase3d
This is the base class for all three-component vectors and points.
Definition:
lvecBase3.h:1455
EggTable
This corresponds to a.
Definition:
eggTable.h:31
LVector3d
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition:
lvector3.h:746
XFileToEggConverter
Definition:
xFileToEggConverter.h:42
XFileAnimationSet::FrameEntry::get_mat
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...
Definition:
xFileAnimationSet.I:38
Generated on Mon Feb 1 2016 13:44:45 for Panda3D by
1.8.5