diff options
Diffstat (limited to 'linden/indra/llcharacter/lleditingmotion.h')
-rw-r--r-- | linden/indra/llcharacter/lleditingmotion.h | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/linden/indra/llcharacter/lleditingmotion.h b/linden/indra/llcharacter/lleditingmotion.h new file mode 100644 index 0000000..37df991 --- /dev/null +++ b/linden/indra/llcharacter/lleditingmotion.h | |||
@@ -0,0 +1,134 @@ | |||
1 | /** | ||
2 | * @file lleditingmotion.h | ||
3 | * @brief Implementation of LLEditingMotion class. | ||
4 | * | ||
5 | * Copyright (c) 2001-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_LLEDITINGMOTION_H | ||
29 | #define LL_LLEDITINGMOTION_H | ||
30 | |||
31 | //----------------------------------------------------------------------------- | ||
32 | // Header files | ||
33 | //----------------------------------------------------------------------------- | ||
34 | #include "llmotion.h" | ||
35 | #include "lljointsolverrp3.h" | ||
36 | #include "v3dmath.h" | ||
37 | |||
38 | #define EDITING_EASEIN_DURATION 0.0f | ||
39 | #define EDITING_EASEOUT_DURATION 0.5f | ||
40 | #define EDITING_PRIORITY LLJoint::HIGH_PRIORITY | ||
41 | #define MIN_REQUIRED_PIXEL_AREA_EDITING 500.f | ||
42 | |||
43 | //----------------------------------------------------------------------------- | ||
44 | // class LLEditingMotion | ||
45 | //----------------------------------------------------------------------------- | ||
46 | class LLEditingMotion : | ||
47 | public LLMotion | ||
48 | { | ||
49 | public: | ||
50 | // Constructor | ||
51 | LLEditingMotion(const LLUUID &id); | ||
52 | |||
53 | // Destructor | ||
54 | virtual ~LLEditingMotion(); | ||
55 | |||
56 | public: | ||
57 | //------------------------------------------------------------------------- | ||
58 | // functions to support MotionController and MotionRegistry | ||
59 | //------------------------------------------------------------------------- | ||
60 | |||
61 | // static constructor | ||
62 | // all subclasses must implement such a function and register it | ||
63 | static LLMotion *create(const LLUUID &id) { return new LLEditingMotion(id); } | ||
64 | |||
65 | public: | ||
66 | //------------------------------------------------------------------------- | ||
67 | // animation callbacks to be implemented by subclasses | ||
68 | //------------------------------------------------------------------------- | ||
69 | |||
70 | // motions must specify whether or not they loop | ||
71 | virtual BOOL getLoop() { return TRUE; } | ||
72 | |||
73 | // motions must report their total duration | ||
74 | virtual F32 getDuration() { return 0.0; } | ||
75 | |||
76 | // motions must report their "ease in" duration | ||
77 | virtual F32 getEaseInDuration() { return EDITING_EASEIN_DURATION; } | ||
78 | |||
79 | // motions must report their "ease out" duration. | ||
80 | virtual F32 getEaseOutDuration() { return EDITING_EASEOUT_DURATION; } | ||
81 | |||
82 | // motions must report their priority | ||
83 | virtual LLJoint::JointPriority getPriority() { return EDITING_PRIORITY; } | ||
84 | |||
85 | virtual LLMotionBlendType getBlendType() { return NORMAL_BLEND; } | ||
86 | |||
87 | // called to determine when a motion should be activated/deactivated based on avatar pixel coverage | ||
88 | virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_EDITING; } | ||
89 | |||
90 | // run-time (post constructor) initialization, | ||
91 | // called after parameters have been set | ||
92 | // must return true to indicate success and be available for activation | ||
93 | virtual LLMotionInitStatus onInitialize(LLCharacter *character); | ||
94 | |||
95 | // called when a motion is activated | ||
96 | // must return TRUE to indicate success, or else | ||
97 | // it will be deactivated | ||
98 | virtual BOOL onActivate(); | ||
99 | |||
100 | // called per time step | ||
101 | // must return TRUE while it is active, and | ||
102 | // must return FALSE when the motion is completed. | ||
103 | virtual BOOL onUpdate(F32 time, U8* joint_mask); | ||
104 | |||
105 | // called when a motion is deactivated | ||
106 | virtual void onDeactivate(); | ||
107 | |||
108 | public: | ||
109 | //------------------------------------------------------------------------- | ||
110 | // joint states to be animated | ||
111 | //------------------------------------------------------------------------- | ||
112 | LLCharacter *mCharacter; | ||
113 | LLVector3 mWristOffset; | ||
114 | |||
115 | LLJointState mParentState; | ||
116 | LLJointState mShoulderState; | ||
117 | LLJointState mElbowState; | ||
118 | LLJointState mWristState; | ||
119 | LLJointState mTorsoState; | ||
120 | |||
121 | LLJoint mParentJoint; | ||
122 | LLJoint mShoulderJoint; | ||
123 | LLJoint mElbowJoint; | ||
124 | LLJoint mWristJoint; | ||
125 | LLJoint mTarget; | ||
126 | LLJointSolverRP3 mIKSolver; | ||
127 | |||
128 | static S32 sHandPose; | ||
129 | static S32 sHandPosePriority; | ||
130 | LLVector3 mLastSelectPt; | ||
131 | }; | ||
132 | |||
133 | #endif // LL_LLKEYFRAMEMOTION_H | ||
134 | |||