aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcharacter/llkeyframemotionparam.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:46 -0500
committerJacek Antonelli2008-08-15 23:44:46 -0500
commit38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch)
treeadca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/llcharacter/llkeyframemotionparam.h
parentREADME.txt (diff)
downloadmeta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz
Second Life viewer sources 1.13.2.12
Diffstat (limited to '')
-rw-r--r--linden/indra/llcharacter/llkeyframemotionparam.h157
1 files changed, 157 insertions, 0 deletions
diff --git a/linden/indra/llcharacter/llkeyframemotionparam.h b/linden/indra/llcharacter/llkeyframemotionparam.h
new file mode 100644
index 0000000..33dd094
--- /dev/null
+++ b/linden/indra/llcharacter/llkeyframemotionparam.h
@@ -0,0 +1,157 @@
1/**
2 * @file llkeyframemotionparam.h
3 * @brief Implementation of LLKeframeMotionParam class.
4 *
5 * Copyright (c) 2002-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_LLKEYFRAMEMOTIONPARAM_H
29#define LL_LLKEYFRAMEMOTIONPARAM_H
30
31//-----------------------------------------------------------------------------
32// Header files
33//-----------------------------------------------------------------------------
34
35#include <string>
36
37#include "llmotion.h"
38#include "lljointstate.h"
39#include "v3math.h"
40#include "llquaternion.h"
41#include "linked_lists.h"
42#include "llkeyframemotion.h"
43
44//-----------------------------------------------------------------------------
45// class LLKeyframeMotionParam
46//-----------------------------------------------------------------------------
47class LLKeyframeMotionParam :
48 public LLMotion
49{
50public:
51 // Constructor
52 LLKeyframeMotionParam(const LLUUID &id);
53
54 // Destructor
55 virtual ~LLKeyframeMotionParam();
56
57public:
58 //-------------------------------------------------------------------------
59 // functions to support MotionController and MotionRegistry
60 //-------------------------------------------------------------------------
61
62 // static constructor
63 // all subclasses must implement such a function and register it
64 static LLMotion *create(const LLUUID &id) { return new LLKeyframeMotionParam(id); }
65
66public:
67 //-------------------------------------------------------------------------
68 // animation callbacks to be implemented by subclasses
69 //-------------------------------------------------------------------------
70
71 // motions must specify whether or not they loop
72 virtual BOOL getLoop() {
73 return TRUE;
74 }
75
76 // motions must report their total duration
77 virtual F32 getDuration() {
78 return mDuration;
79 }
80
81 // motions must report their "ease in" duration
82 virtual F32 getEaseInDuration() {
83 return mEaseInDuration;
84 }
85
86 // motions must report their "ease out" duration.
87 virtual F32 getEaseOutDuration() {
88 return mEaseOutDuration;
89 }
90
91 // motions must report their priority
92 virtual LLJoint::JointPriority getPriority() {
93 return mPriority;
94 }
95
96 virtual LLMotionBlendType getBlendType() { return NORMAL_BLEND; }
97
98 // called to determine when a motion should be activated/deactivated based on avatar pixel coverage
99 virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_KEYFRAME; }
100
101 // run-time (post constructor) initialization,
102 // called after parameters have been set
103 // must return true to indicate success and be available for activation
104 virtual LLMotionInitStatus onInitialize(LLCharacter *character);
105
106 // called when a motion is activated
107 // must return TRUE to indicate success, or else
108 // it will be deactivated
109 virtual BOOL onActivate();
110
111 // called per time step
112 // must return TRUE while it is active, and
113 // must return FALSE when the motion is completed.
114 virtual BOOL onUpdate(F32 time, U8* joint_mask);
115
116 // called when a motion is deactivated
117 virtual void onDeactivate();
118
119 virtual LLPose* getPose() { return mPoseBlender.getBlendedPose();}
120
121protected:
122 //-------------------------------------------------------------------------
123 // new functions defined by this subclass
124 //-------------------------------------------------------------------------
125 typedef std::pair<LLMotion*, F32> ParameterizedMotion;
126
127 // add a motion and associated parameter triplet
128 BOOL addKeyframeMotion(char *name, const LLUUID &id, char *param, F32 value);
129
130 // set default motion for LOD and retrieving blend constants
131 void setDefaultKeyframeMotion(char *);
132
133 static BOOL sortFunc(ParameterizedMotion *new_motion, ParameterizedMotion *tested_motion);
134
135 BOOL loadMotions();
136
137protected:
138 //-------------------------------------------------------------------------
139 // Member Data
140 //-------------------------------------------------------------------------
141
142 typedef LLLinkedList < ParameterizedMotion > motion_list_t;
143 LLAssocList <std::string, motion_list_t* > mParameterizedMotions;
144 LLJointState* mJointStates;
145 LLMotion* mDefaultKeyframeMotion;
146 LLCharacter* mCharacter;
147 LLPoseBlender mPoseBlender;
148
149 F32 mEaseInDuration;
150 F32 mEaseOutDuration;
151 F32 mDuration;
152 LLJoint::JointPriority mPriority;
153
154 LLUUID mTransactionID;
155};
156
157#endif // LL_LLKEYFRAMEMOTIONPARAM_H