diff options
author | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
commit | ce28e056c20bf2723f565bbf464b87781ec248a2 (patch) | |
tree | ef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/llprimitive/llmaterialtable.h | |
parent | Second Life viewer sources 1.19.1.4b (diff) | |
download | meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2 meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz |
Second Life viewer sources 1.20.2
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llprimitive/llmaterialtable.h | 57 |
1 files changed, 53 insertions, 4 deletions
diff --git a/linden/indra/llprimitive/llmaterialtable.h b/linden/indra/llprimitive/llmaterialtable.h index b48c832..863fb25 100644 --- a/linden/indra/llprimitive/llmaterialtable.h +++ b/linden/indra/llprimitive/llmaterialtable.h | |||
@@ -33,11 +33,36 @@ | |||
33 | #define LL_LLMATERIALTABLE_H | 33 | #define LL_LLMATERIALTABLE_H |
34 | 34 | ||
35 | #include "lluuid.h" | 35 | #include "lluuid.h" |
36 | #include "linked_lists.h" | ||
37 | #include "llstring.h" | 36 | #include "llstring.h" |
38 | 37 | ||
38 | #include <list> | ||
39 | |||
39 | const U32 LLMATERIAL_INFO_NAME_LENGTH = 256; | 40 | const U32 LLMATERIAL_INFO_NAME_LENGTH = 256; |
40 | 41 | ||
42 | // We've moved toward more reasonable mass values for the Havok4 engine. | ||
43 | // The LEGACY_DEFAULT_OBJECT_DENSITY is used to maintain support for | ||
44 | // legacy scripts code (llGetMass()) and script energy consumption. | ||
45 | const F32 DEFAULT_OBJECT_DENSITY = 1000.0f; // per m^3 | ||
46 | const F32 LEGACY_DEFAULT_OBJECT_DENSITY = 10.0f; | ||
47 | |||
48 | // Avatars density depends on the collision shape used. The approximate | ||
49 | // legacy volumes of avatars are: | ||
50 | // Body_Length Body_Width Body_Fat Leg_Length Volume(m^3) | ||
51 | // ------------------------------------------------------- | ||
52 | // min | min | min | min | 0.123 | | ||
53 | // max | max | max | max | 0.208 | | ||
54 | // | ||
55 | // Either the avatar shape must be tweaked to match those volumes | ||
56 | // or the DEFAULT_AVATAR_DENSITY must be adjusted to achieve the | ||
57 | // legacy mass. | ||
58 | // | ||
59 | // The current density appears to be low because the mass and | ||
60 | // inertia are computed as if the avatar were a cylinder which | ||
61 | // has more volume than the actual collision shape of the avatar. | ||
62 | // See the physics engine mass properties code for more info. | ||
63 | const F32 DEFAULT_AVATAR_DENSITY = 445.3f; // was 444.24f; | ||
64 | |||
65 | |||
41 | class LLMaterialInfo | 66 | class LLMaterialInfo |
42 | { | 67 | { |
43 | public: | 68 | public: |
@@ -84,9 +109,33 @@ public: | |||
84 | class LLMaterialTable | 109 | class LLMaterialTable |
85 | { | 110 | { |
86 | public: | 111 | public: |
112 | static const F32 FRICTION_MIN; | ||
113 | static const F32 FRICTION_GLASS; | ||
114 | static const F32 FRICTION_LIGHT; | ||
115 | static const F32 FRICTION_METAL; | ||
116 | static const F32 FRICTION_PLASTIC; | ||
117 | static const F32 FRICTION_WOOD; | ||
118 | static const F32 FRICTION_LAND; | ||
119 | static const F32 FRICTION_STONE; | ||
120 | static const F32 FRICTION_FLESH; | ||
121 | static const F32 FRICTION_RUBBER; | ||
122 | static const F32 FRICTION_MAX; | ||
123 | |||
124 | static const F32 RESTITUTION_MIN; | ||
125 | static const F32 RESTITUTION_LAND; | ||
126 | static const F32 RESTITUTION_FLESH; | ||
127 | static const F32 RESTITUTION_STONE; | ||
128 | static const F32 RESTITUTION_METAL; | ||
129 | static const F32 RESTITUTION_WOOD; | ||
130 | static const F32 RESTITUTION_GLASS; | ||
131 | static const F32 RESTITUTION_PLASTIC; | ||
132 | static const F32 RESTITUTION_LIGHT; | ||
133 | static const F32 RESTITUTION_RUBBER; | ||
134 | static const F32 RESTITUTION_MAX; | ||
135 | |||
87 | typedef std::list<LLMaterialInfo*> info_list_t; | 136 | typedef std::list<LLMaterialInfo*> info_list_t; |
88 | info_list_t mMaterialInfoList; | 137 | info_list_t mMaterialInfoList; |
89 | 138 | ||
90 | LLUUID *mCollisionSoundMatrix; | 139 | LLUUID *mCollisionSoundMatrix; |
91 | LLUUID *mSlidingSoundMatrix; | 140 | LLUUID *mSlidingSoundMatrix; |
92 | LLUUID *mRollingSoundMatrix; | 141 | LLUUID *mRollingSoundMatrix; |
@@ -117,8 +166,8 @@ public: | |||
117 | char* getName(U8 mcode); | 166 | char* getName(U8 mcode); |
118 | 167 | ||
119 | F32 getDensity(U8 mcode); // kg/m^3, 0 if not found | 168 | F32 getDensity(U8 mcode); // kg/m^3, 0 if not found |
120 | F32 getFriction(U8 mcode); // havok values | 169 | F32 getFriction(U8 mcode); // physics values |
121 | F32 getRestitution(U8 mcode); // havok values | 170 | F32 getRestitution(U8 mcode); // physics values |
122 | F32 getHPMod(U8 mcode); | 171 | F32 getHPMod(U8 mcode); |
123 | F32 getDamageMod(U8 mcode); | 172 | F32 getDamageMod(U8 mcode); |
124 | F32 getEPMod(U8 mcode); | 173 | F32 getEPMod(U8 mcode); |