aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llanimalcontrols.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/newview/llanimalcontrols.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/newview/llanimalcontrols.h192
1 files changed, 192 insertions, 0 deletions
diff --git a/linden/indra/newview/llanimalcontrols.h b/linden/indra/newview/llanimalcontrols.h
new file mode 100644
index 0000000..a5a62bf
--- /dev/null
+++ b/linden/indra/newview/llanimalcontrols.h
@@ -0,0 +1,192 @@
1/**
2 * @file llanimalcontrols.h
3 * @brief LLAnimalControls class definition
4 *
5 * Copyright (c) 2005-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_LLANIMALCONTROLS_H
29#define LL_LLANIMALCONTROLS_H
30
31#include "llhudobject.h"
32#include "llflexibleobject.h"
33
34//-----------------------------------------------------------------------------------
35// Default setting for the attributes of a animalControls object...
36//-----------------------------------------------------------------------------------
37//const LLVector3 ANIMAL_CONTROLS_DEFAULT_ANCHOR_DIRECTION = LLVector3::z_axis;
38//const LLVector3 ANIMAL_CONTROLS_DEFAULT_ANCHOR_POSITION_OFFSET = LLVector3::zero;
39//const LLColor4 ANIMAL_CONTROLS_DEFAULT_COLOR = LLColor4( 1.0f, 1.0f, 1.0f, 1.0f );
40//const F32 ANIMAL_CONTROLS_DEFAULT_GRAVITY = 0.3f;
41//const F32 ANIMAL_CONTROLS_DEFAULT_TENSION = 10.0f;
42//const F32 ANIMAL_CONTROLS_DEFAULT_AIR_FRICTION = 10.0f;
43//const F32 ANIMAL_CONTROLS_DEFAULT_LENGTH = 1.0f;
44//const int ANIMAL_CONTROLS_DEFAULT_NUM_SECTIONS = 4;
45//const F32 ANIMAL_CONTROLS_DEFAULT_ANCHOR_RADIUS = 0.05f;
46//const F32 ANIMAL_CONTROLS_DEFAULT_RADIUS_CHANGE = -0.01f;
47
48class LLViewerObject;
49
50/*struct LLAnimalControlsBodyBehavior
51{
52 LLVector3 mPosition;
53 LLQuaternion mHipRotation;
54};
55
56class LLAnimalControlsHeadBehavior
57{
58 private:
59 LLVector3 mBodyPosition;
60 LLQuaternion mBodyRotation;
61 LLHUDFlexibleObject mFeather;
62 LLVector3 mPosition;
63 LLQuaternion mRotation;
64 LLVector3 mFocusPosition;
65 bool mEyesBlinking;
66 F32 mEyeBlinkRate;
67
68 public:
69 LLAnimalControlsHeadBehavior();
70 void setBodyPositionAndRotation( LLVector3 p, LLQuaternion r );
71 void setFocusPosition( LLVector3 focusPosition );
72 void update();
73 void render();
74};
75
76
77class LLAnimalControlsLegBehavior
78{
79 private:
80 LLVector3 mBodyPosition;
81 LLQuaternion mBodyRotation;
82 LLVector3 mHipAnchorPosition;
83 bool mWalking;
84 bool mIsLeft;
85
86 public:
87 LLAnimalControlsLegBehavior();
88 void setBodyPositionAndRotation( LLVector3 p, LLQuaternion r );
89 void update();
90 void render();
91};
92
93
94class LLAnimalControlsVirtualServer
95{
96 private:
97 int fakeClock;
98 LLVector3 focusPosition;
99 bool settingFocusPosition;
100 LLVector3 animalPosition;
101 LLQuaternion animalRotation;
102
103 public:
104 LLAnimalControlsVirtualServer();
105 bool getSettingFocusPosition();
106 LLVector3 getFocusPosition();
107 void update();
108 void setParentPositionAndRotation( LLVector3 p, LLQuaternion q );
109};
110
111
112//-------------------------------------------------
113// This structure is also used in the part of the
114// code that creates new animalControls objects.
115//-------------------------------------------------
116struct LLAnimalControlsAttributes
117{
118 //LLVector3 mAnchorPositionOffset;
119 //LLVector3 mAnchorDirection;
120 //LLColor4 mColor;
121 //F32 mAnchorRadius;
122 //S32 mNumSections;
123 //F32 mLength;
124 //F32 mGravity;
125 //F32 mAirFriction;
126 //F32 mTension;
127 //F32 mRadiusChange;
128 bool mUsingBodyControls;
129 bool mUsingHeadControls;
130 bool mUsingTailControls;
131 bool mUsingLegControls;
132
133 //------ the constructor for the structure ------------
134 LLAnimalControlsAttributes()
135 {
136 //mAnchorPositionOffset = ANIMAL_CONTROLS_DEFAULT_ANCHOR_DIRECTION;
137 //mAnchorDirection = ANIMAL_CONTROLS_DEFAULT_ANCHOR_POSITION_OFFSET;
138 //mAnchorRadius = ANIMAL_CONTROLS_DEFAULT_ANCHOR_RADIUS;
139 //mColor = ANIMAL_CONTROLS_DEFAULT_COLOR;
140 //mNumSections = ANIMAL_CONTROLS_DEFAULT_NUM_SECTIONS;
141 //mLength = ANIMAL_CONTROLS_DEFAULT_LENGTH;
142 //mGravity = ANIMAL_CONTROLS_DEFAULT_GRAVITY;
143 //mAirFriction = ANIMAL_CONTROLS_DEFAULT_AIR_FRICTION;
144 //mTension = ANIMAL_CONTROLS_DEFAULT_TENSION;
145 //mRadiusChange = ANIMAL_CONTROLS_DEFAULT_RADIUS_CHANGE;
146 }
147};// end of attributes structure
148
149
150
151//---------------------------------------------------------
152// The LLHUDAnimalControls class
153//---------------------------------------------------------
154class LLHUDAnimalControls : public LLHUDObject
155{
156 public:
157 LLHUDAnimalControls();
158 void setParentObject( LLViewerObject * );
159 void setAttributes( LLAnimalControlsAttributes );
160 void markAsDead();
161 void update();
162 LLViewerObject * getParentObject();
163 void render();
164
165 private:
166 //--------------------------------------
167 // private members
168 //--------------------------------------
169 LLViewerObject* mParentObject;
170 LLAnimalControlsAttributes mAttributes;
171 LLAnimalControlsHeadBehavior mHeadBehavior;
172 LLAnimalControlsLegBehavior mLeftLegBehavior;
173 LLAnimalControlsLegBehavior mRightLegBehavior;
174 LLAnimalControlsVirtualServer mVirtualServer;
175
176 //--------------------------------------
177 // private methods
178 //--------------------------------------
179 void updateVirtualServer();
180 void updateBodyBehavior();
181 void renderBodyBehavior();
182 //void updateLegBehavior();
183 //void renderLegBehavior();
184 //void updateHeadBehavior();
185 //void renderHeadBehavior();
186
187 friend class LLHUDObject;
188
189};// end of class definition
190
191*/
192#endif // LL_LLANIMALCONTROLS_H