aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcharacter/lljointstate.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/lljointstate.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 'linden/indra/llcharacter/lljointstate.h')
-rw-r--r--linden/indra/llcharacter/lljointstate.h125
1 files changed, 125 insertions, 0 deletions
diff --git a/linden/indra/llcharacter/lljointstate.h b/linden/indra/llcharacter/lljointstate.h
new file mode 100644
index 0000000..7fef28a
--- /dev/null
+++ b/linden/indra/llcharacter/lljointstate.h
@@ -0,0 +1,125 @@
1/**
2 * @file lljointstate.h
3 * @brief Implementation of LLJointState 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_LLJOINTSTATE_H
29#define LL_LLJOINTSTATE_H
30
31//-----------------------------------------------------------------------------
32// Header Files
33//-----------------------------------------------------------------------------
34#include "lljoint.h"
35
36//-----------------------------------------------------------------------------
37// class LLJointState
38//-----------------------------------------------------------------------------
39class LLJointState
40{
41public:
42 enum BlendPhase
43 {
44 INACTIVE,
45 EASE_IN,
46 ACTIVE,
47 EASE_OUT
48 };
49protected:
50 // associated joint
51 LLJoint *mJoint;
52
53 // indicates which members are used
54 U32 mUsage;
55
56 // indicates weighted effect of this joint
57 F32 mWeight;
58
59 // transformation members
60 LLVector3 mPosition; // position relative to parent joint
61 LLQuaternion mRotation; // joint rotation relative to parent joint
62 LLVector3 mScale; // scale relative to rotated frame
63 LLJoint::JointPriority mPriority; // how important this joint state is relative to others
64public:
65 // Constructor
66 LLJointState()
67 {
68 mUsage = 0;
69 mJoint = NULL;
70 mUsage = 0;
71 mWeight = 0.f;
72 mPriority = LLJoint::USE_MOTION_PRIORITY;
73 }
74
75 LLJointState(LLJoint* joint)
76 {
77 mUsage = 0;
78 mJoint = joint;
79 mUsage = 0;
80 mWeight = 0.f;
81 mPriority = LLJoint::USE_MOTION_PRIORITY;
82 }
83
84 // Destructor
85 virtual ~LLJointState()
86 {
87 }
88
89 // joint that this state is applied to
90 LLJoint *getJoint() { return mJoint; }
91 BOOL setJoint( LLJoint *joint ) { mJoint = joint; return mJoint != NULL; }
92
93 // transform type (bitwise flags can be combined)
94 // Note that these are set automatically when various
95 // member setPos/setRot/setScale functions are called.
96 enum Usage
97 {
98 POS = 1,
99 ROT = 2,
100 SCALE = 4,
101 };
102 U32 getUsage() { return mUsage; }
103 void setUsage( U32 usage ) { mUsage = usage; }
104 F32 getWeight() { return mWeight; }
105 void setWeight( F32 weight ) { mWeight = weight; }
106
107 // get/set position
108 const LLVector3& getPosition() { return mPosition; }
109 void setPosition( const LLVector3& pos ) { llassert(mUsage & POS); mPosition = pos; }
110
111 // get/set rotation
112 const LLQuaternion& getRotation() { return mRotation; }
113 void setRotation( const LLQuaternion& rot ) { llassert(mUsage & ROT); mRotation = rot; }
114
115 // get/set scale
116 const LLVector3& getScale() { return mScale; }
117 void setScale( const LLVector3& scale ) { llassert(mUsage & SCALE); mScale = scale; }
118
119 // get/set priority
120 const LLJoint::JointPriority getPriority() { return mPriority; }
121 void setPriority( const LLJoint::JointPriority priority ) { mPriority = priority; }
122};
123
124#endif // LL_LLJOINTSTATE_H
125