aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llprimitive/llmaterialtable.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-x[-rw-r--r--]linden/indra/llprimitive/llmaterialtable.h87
1 files changed, 47 insertions, 40 deletions
diff --git a/linden/indra/llprimitive/llmaterialtable.h b/linden/indra/llprimitive/llmaterialtable.h
index ca9017a..7950c40 100644..100755
--- a/linden/indra/llprimitive/llmaterialtable.h
+++ b/linden/indra/llprimitive/llmaterialtable.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$ 5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2001-2009, Linden Research, Inc. 7 * Copyright (c) 2001-2010, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -38,6 +38,8 @@
38 38
39#include <list> 39#include <list>
40 40
41class LLMaterialInfo;
42
41const U32 LLMATERIAL_INFO_NAME_LENGTH = 256; 43const U32 LLMATERIAL_INFO_NAME_LENGTH = 256;
42 44
43// We've moved toward more reasonable mass values for the Havok4 engine. 45// We've moved toward more reasonable mass values for the Havok4 engine.
@@ -64,45 +66,6 @@ const F32 LEGACY_DEFAULT_OBJECT_DENSITY = 10.0f;
64const F32 DEFAULT_AVATAR_DENSITY = 445.3f; // was 444.24f; 66const F32 DEFAULT_AVATAR_DENSITY = 445.3f; // was 444.24f;
65 67
66 68
67class LLMaterialInfo
68{
69public:
70 U8 mMCode;
71 std::string mName;
72 LLUUID mDefaultTextureID;
73 LLUUID mShatterSoundID;
74 F32 mDensity; // kg/m^3
75 F32 mFriction;
76 F32 mRestitution;
77
78 // damage and energy constants
79 F32 mHPModifier; // modifier on mass based HP total
80 F32 mDamageModifier; // modifier on KE based damage
81 F32 mEPModifier; // modifier on mass based EP total
82
83 LLMaterialInfo(U8 mcode, const std::string& name, const LLUUID &uuid)
84 {
85 init(mcode,name,uuid);
86 };
87
88 void init(U8 mcode, const std::string& name, const LLUUID &uuid)
89 {
90 mDensity = 1000.f; // default to 1000.0 (water)
91 mHPModifier = 1.f;
92 mDamageModifier = 1.f;
93 mEPModifier = 1.f;
94
95 mMCode = mcode;
96 mName = name;
97 mDefaultTextureID = uuid;
98 };
99
100 ~LLMaterialInfo()
101 {
102 };
103
104};
105
106class LLMaterialTable 69class LLMaterialTable
107{ 70{
108public: 71public:
@@ -147,6 +110,8 @@ public:
147 110
148 void initBasicTable(); 111 void initBasicTable();
149 112
113 void initTableTransNames(std::map<std::string, std::string> namemap);
114
150 BOOL add(U8 mcode, const std::string& name, const LLUUID &uuid); 115 BOOL add(U8 mcode, const std::string& name, const LLUUID &uuid);
151 BOOL addCollisionSound(U8 mcode, U8 mcode2, const LLUUID &uuid); 116 BOOL addCollisionSound(U8 mcode, U8 mcode2, const LLUUID &uuid);
152 BOOL addSlidingSound(U8 mcode, U8 mcode2, const LLUUID &uuid); 117 BOOL addSlidingSound(U8 mcode, U8 mcode2, const LLUUID &uuid);
@@ -183,5 +148,47 @@ public:
183 static LLMaterialTable basic; 148 static LLMaterialTable basic;
184}; 149};
185 150
151
152class LLMaterialInfo
153{
154public:
155 U8 mMCode;
156 std::string mName;
157 LLUUID mDefaultTextureID;
158 LLUUID mShatterSoundID;
159 F32 mDensity; // kg/m^3
160 F32 mFriction;
161 F32 mRestitution;
162
163 // damage and energy constants
164 F32 mHPModifier; // modifier on mass based HP total
165 F32 mDamageModifier; // modifier on KE based damage
166 F32 mEPModifier; // modifier on mass based EP total
167
168 LLMaterialInfo(U8 mcode, const std::string& name, const LLUUID &uuid)
169 {
170 init(mcode,name,uuid);
171 };
172
173 void init(U8 mcode, const std::string& name, const LLUUID &uuid)
174 {
175 mDensity = 1000.f; // default to 1000.0 (water)
176 mFriction = LLMaterialTable::DEFAULT_FRICTION;
177 mRestitution = LLMaterialTable::DEFAULT_RESTITUTION;
178 mHPModifier = 1.f;
179 mDamageModifier = 1.f;
180 mEPModifier = 1.f;
181
182 mMCode = mcode;
183 mName = name;
184 mDefaultTextureID = uuid;
185 };
186
187 ~LLMaterialInfo()
188 {
189 };
190
191};
192
186#endif 193#endif
187 194