diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/llcharacter/lltargetingmotion.h | |
parent | README.txt (diff) | |
download | meta-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/lltargetingmotion.h | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/linden/indra/llcharacter/lltargetingmotion.h b/linden/indra/llcharacter/lltargetingmotion.h new file mode 100644 index 0000000..9fd8391 --- /dev/null +++ b/linden/indra/llcharacter/lltargetingmotion.h | |||
@@ -0,0 +1,117 @@ | |||
1 | /** | ||
2 | * @file lltargetingmotion.h | ||
3 | * @brief Implementation of LLTargetingMotion 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_LLTARGETINGMOTION_H | ||
29 | #define LL_LLTARGETINGMOTION_H | ||
30 | |||
31 | //----------------------------------------------------------------------------- | ||
32 | // Header files | ||
33 | //----------------------------------------------------------------------------- | ||
34 | #include "llmotion.h" | ||
35 | |||
36 | #define TARGETING_EASEIN_DURATION 0.3f | ||
37 | #define TARGETING_EASEOUT_DURATION 0.5f | ||
38 | #define TARGETING_PRIORITY LLJoint::HIGH_PRIORITY | ||
39 | #define MIN_REQUIRED_PIXEL_AREA_TARGETING 1000.f; | ||
40 | |||
41 | |||
42 | //----------------------------------------------------------------------------- | ||
43 | // class LLTargetingMotion | ||
44 | //----------------------------------------------------------------------------- | ||
45 | class LLTargetingMotion : | ||
46 | public LLMotion | ||
47 | { | ||
48 | public: | ||
49 | // Constructor | ||
50 | LLTargetingMotion(const LLUUID &id); | ||
51 | |||
52 | // Destructor | ||
53 | virtual ~LLTargetingMotion(); | ||
54 | |||
55 | public: | ||
56 | //------------------------------------------------------------------------- | ||
57 | // functions to support MotionController and MotionRegistry | ||
58 | //------------------------------------------------------------------------- | ||
59 | |||
60 | // static constructor | ||
61 | // all subclasses must implement such a function and register it | ||
62 | static LLMotion *create(const LLUUID &id) { return new LLTargetingMotion(id); } | ||
63 | |||
64 | public: | ||
65 | //------------------------------------------------------------------------- | ||
66 | // animation callbacks to be implemented by subclasses | ||
67 | //------------------------------------------------------------------------- | ||
68 | |||
69 | // motions must specify whether or not they loop | ||
70 | virtual BOOL getLoop() { return TRUE; } | ||
71 | |||
72 | // motions must report their total duration | ||
73 | virtual F32 getDuration() { return 0.0; } | ||
74 | |||
75 | // motions must report their "ease in" duration | ||
76 | virtual F32 getEaseInDuration() { return TARGETING_EASEIN_DURATION; } | ||
77 | |||
78 | // motions must report their "ease out" duration. | ||
79 | virtual F32 getEaseOutDuration() { return TARGETING_EASEOUT_DURATION; } | ||
80 | |||
81 | // motions must report their priority | ||
82 | virtual LLJoint::JointPriority getPriority() { return TARGETING_PRIORITY; } | ||
83 | |||
84 | virtual LLMotionBlendType getBlendType() { return ADDITIVE_BLEND; } | ||
85 | |||
86 | // called to determine when a motion should be activated/deactivated based on avatar pixel coverage | ||
87 | virtual F32 getMinPixelArea() { return MIN_REQUIRED_PIXEL_AREA_TARGETING; } | ||
88 | |||
89 | // run-time (post constructor) initialization, | ||
90 | // called after parameters have been set | ||
91 | // must return true to indicate success and be available for activation | ||
92 | virtual LLMotionInitStatus onInitialize(LLCharacter *character); | ||
93 | |||
94 | // called when a motion is activated | ||
95 | // must return TRUE to indicate success, or else | ||
96 | // it will be deactivated | ||
97 | virtual BOOL onActivate(); | ||
98 | |||
99 | // called per time step | ||
100 | // must return TRUE while it is active, and | ||
101 | // must return FALSE when the motion is completed. | ||
102 | virtual BOOL onUpdate(F32 time, U8* joint_mask); | ||
103 | |||
104 | // called when a motion is deactivated | ||
105 | virtual void onDeactivate(); | ||
106 | |||
107 | public: | ||
108 | |||
109 | LLCharacter *mCharacter; | ||
110 | LLJointState mTorsoState; | ||
111 | LLJoint* mPelvisJoint; | ||
112 | LLJoint* mTorsoJoint; | ||
113 | LLJoint* mRightHandJoint; | ||
114 | }; | ||
115 | |||
116 | #endif // LL_LLTARGETINGMOTION_H | ||
117 | |||