summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-07-21 15:02:03 -0400
committerOz Linden <oz@lindenlab.com>2011-07-21 15:02:03 -0400
commitc118ec209907618c77613990fe2359d4f92802e6 (patch)
treeb2fa95d1fa1563cdee89d2bf035b680c64918c0f /indra/llmath
parent54bb91fd03d0c2f2600993274c59ae89324eeb03 (diff)
parent67e365ba57bb7024a64bc0663782cd7f06b4a5cc (diff)
merge up changes for 2.8.0 release
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/llvolume.cpp48
1 files changed, 27 insertions, 21 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 8c81f27784..21cc9b22f2 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2500,37 +2500,43 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
{
U16* n = (U16*) &(norm[0]);
- for (U32 j = 0; j < num_verts; ++j)
+ if(n)
{
- norm_out->set((F32) n[0], (F32) n[1], (F32) n[2]);
- norm_out->div(65535.f);
- norm_out->mul(2.f);
- norm_out->sub(1.f);
- norm_out++;
- n += 3;
+ for (U32 j = 0; j < num_verts; ++j)
+ {
+ norm_out->set((F32) n[0], (F32) n[1], (F32) n[2]);
+ norm_out->div(65535.f);
+ norm_out->mul(2.f);
+ norm_out->sub(1.f);
+ norm_out++;
+ n += 3;
+ }
}
}
{
U16* t = (U16*) &(tc[0]);
- for (U32 j = 0; j < num_verts; j+=2)
+ if(t)
{
- if (j < num_verts-1)
+ for (U32 j = 0; j < num_verts; j+=2)
{
- tc_out->set((F32) t[0], (F32) t[1], (F32) t[2], (F32) t[3]);
- }
- else
- {
- tc_out->set((F32) t[0], (F32) t[1], 0.f, 0.f);
- }
+ if (j < num_verts-1)
+ {
+ tc_out->set((F32) t[0], (F32) t[1], (F32) t[2], (F32) t[3]);
+ }
+ else
+ {
+ tc_out->set((F32) t[0], (F32) t[1], 0.f, 0.f);
+ }
- t += 4;
+ t += 4;
- tc_out->div(65535.f);
- tc_out->mul(tc_range);
- tc_out->add(min_tc4);
+ tc_out->div(65535.f);
+ tc_out->mul(tc_range);
+ tc_out->add(min_tc4);
- tc_out++;
+ tc_out++;
+ }
}
}
@@ -3253,7 +3259,7 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components,
{
F32 area = sculptGetSurfaceArea();
- const F32 SCULPT_MAX_AREA = 32.f;
+ const F32 SCULPT_MAX_AREA = 384.f;
if (area < SCULPT_MIN_AREA || area > SCULPT_MAX_AREA)
{