summaryrefslogtreecommitdiff
path: root/indra/newview/llmodelpreview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llmodelpreview.cpp')
-rw-r--r--indra/newview/llmodelpreview.cpp49
1 files changed, 25 insertions, 24 deletions
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp
index a3eab3c26d..736971276e 100644
--- a/indra/newview/llmodelpreview.cpp
+++ b/indra/newview/llmodelpreview.cpp
@@ -451,13 +451,13 @@ void LLModelPreview::rebuildUploadData()
// That's ok, but might not what they wanted. Use default_physics_shape if found.
std::ostringstream out;
out << "No physics model specified for " << instance.mLabel;
- if (mDefaultPhysicsShapeP)
+ if (mDefaultPhysicsShapeP.notNull())
{
out << " - using: " << DEFAULT_PHYSICS_MESH_NAME;
lod_model = mDefaultPhysicsShapeP;
}
LL_WARNS() << out.str() << LL_ENDL;
- LLFloaterModelPreview::addStringToLog(out, !mDefaultPhysicsShapeP); // Flash log tab if no default.
+ LLFloaterModelPreview::addStringToLog(out, mDefaultPhysicsShapeP.isNull()); // Flash log tab if no default.
}
if (lod_model)
@@ -1088,8 +1088,9 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod)
if (loaded_lod == LLModel::LOD_PHYSICS)
{ // Explicitly loading physics. See if there is a default mesh.
LLMatrix4 ignored_transform; // Each mesh that uses this will supply their own.
- mDefaultPhysicsShapeP = nullptr;
- FindModel(mScene[loaded_lod], DEFAULT_PHYSICS_MESH_NAME + getLodSuffix(loaded_lod), mDefaultPhysicsShapeP, ignored_transform);
+ LLModel* out_model = nullptr;
+ FindModel(mScene[loaded_lod], DEFAULT_PHYSICS_MESH_NAME + getLodSuffix(loaded_lod), out_model, ignored_transform);
+ mDefaultPhysicsShapeP = out_model;
mWarnOfUnmatchedPhyicsMeshes = true;
}
BOOL legacyMatching = gSavedSettings.getBOOL("ImporterLegacyMatching");
@@ -2784,7 +2785,7 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights)
LLVertexBuffer* vb = NULL;
-
+
U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0;
@@ -3144,7 +3145,7 @@ BOOL LLModelPreview::render()
LLGLDisable no_blend(GL_BLEND);
LLGLEnable cull(GL_CULL_FACE);
LLGLDepthTest depth(GL_FALSE); // SL-12781 disable z-buffer to render background color
-
+
{
gUIProgram.bind();
@@ -3331,9 +3332,9 @@ BOOL LLModelPreview::render()
LLQuaternion av_rot = camera_rot;
F32 camera_distance = skin_weight ? SKIN_WEIGHT_CAMERA_DISTANCE : mCameraDistance;
LLViewerCamera::getInstance()->setOriginAndLookAt(
- target_pos + ((LLVector3(camera_distance, 0.f, 0.f) + offset) * av_rot), // camera
- LLVector3::z_axis, // up
- target_pos); // point of interest
+ target_pos + ((LLVector3(camera_distance, 0.f, 0.f) + offset) * av_rot), // camera
+ LLVector3::z_axis, // up
+ target_pos); // point of interest
z_near = llclamp(z_far * 0.001f, 0.001f, 0.1f);
@@ -3399,7 +3400,7 @@ BOOL LLModelPreview::render()
LLMatrix4 mat = instance.mTransform;
gGL.multMatrix((GLfloat*)mat.mMatrix);
-
+
U32 num_models = mVertexBuffer[mPreviewLOD][model].size();
for (U32 i = 0; i < num_models; ++i)
{
@@ -3664,9 +3665,9 @@ BOOL LLModelPreview::render()
bool pelvis_recalc = false;
LLViewerCamera::getInstance()->setOriginAndLookAt(
- target_pos + ((LLVector3(camera_distance, 0.f, 0.f) + offset) * av_rot), // camera
- LLVector3::z_axis, // up
- target_pos); // point of interest
+ target_pos + ((LLVector3(camera_distance, 0.f, 0.f) + offset) * av_rot), // camera
+ LLVector3::z_axis, // up
+ target_pos); // point of interest
for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter)
{
@@ -3817,22 +3818,22 @@ BOOL LLModelPreview::render()
void LLModelPreview::renderGroundPlane(float z_offset)
{ // Not necesarilly general - beware - but it seems to meet the needs of LLModelPreview::render
- gGL.diffuseColor3f( 1.0f, 0.0f, 1.0f );
+ gGL.diffuseColor3f( 1.0f, 0.0f, 1.0f );
- gGL.begin(LLRender::LINES);
- gGL.vertex3fv(mGroundPlane[0].mV);
- gGL.vertex3fv(mGroundPlane[1].mV);
+ gGL.begin(LLRender::LINES);
+ gGL.vertex3fv(mGroundPlane[0].mV);
+ gGL.vertex3fv(mGroundPlane[1].mV);
- gGL.vertex3fv(mGroundPlane[1].mV);
- gGL.vertex3fv(mGroundPlane[2].mV);
+ gGL.vertex3fv(mGroundPlane[1].mV);
+ gGL.vertex3fv(mGroundPlane[2].mV);
- gGL.vertex3fv(mGroundPlane[2].mV);
- gGL.vertex3fv(mGroundPlane[3].mV);
+ gGL.vertex3fv(mGroundPlane[2].mV);
+ gGL.vertex3fv(mGroundPlane[3].mV);
- gGL.vertex3fv(mGroundPlane[3].mV);
- gGL.vertex3fv(mGroundPlane[0].mV);
+ gGL.vertex3fv(mGroundPlane[3].mV);
+ gGL.vertex3fv(mGroundPlane[0].mV);
- gGL.end();
+ gGL.end();
}