From 1be5133116c7e63bc621a4017bedaebf557c83db Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 8 Dec 2010 21:24:02 -0800 Subject: SH-541 - Physics mesh display shows inconsistent data. The object UI was allowing the user to set 'prim' physics for meshes for which no user physics had been uploaded, or decomposed. It defaulted to convex hull in that case. The fix is to fix the UI to disallow 'prim' for meshes without physics meshes, limiting those to only convex hull and none. We will also redo the task validation to detect invalid states related to this as part of the 'redo the validation' work --- indra/newview/llmeshrepository.cpp | 6 +++ indra/newview/llmeshrepository.h | 3 +- indra/newview/llpanelobject.cpp | 47 +++++++++++++++++----- indra/newview/llspatialpartition.cpp | 2 +- .../newview/skins/default/xui/en/floater_tools.xml | 18 ++------- 5 files changed, 51 insertions(+), 25 deletions(-) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 1ff11f2c01..8d5ef4ae3d 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2667,6 +2667,12 @@ void LLMeshRepository::buildHull(const LLVolumeParams& params, S32 detail) LLPrimitive::sVolumeManager->unrefVolume(volume); } +bool LLMeshRepository::hasPhysicsShape(const LLUUID& mesh_id) +{ + LLSD mesh = mThread->getMeshHeader(mesh_id); + return mesh.has("physics_shape") && mesh["physics_shape"].has("size") && (mesh["physics_shape"]["size"].asInteger() > 0); +} + const LLSD& LLMeshRepository::getMeshHeader(const LLUUID& mesh_id) { return mThread->getMeshHeader(mesh_id); diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index df00c6c7aa..8687ac750b 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -458,7 +458,8 @@ public: const LLMeshSkinInfo* getSkinInfo(const LLUUID& mesh_id); const LLMeshDecomposition* getDecomposition(const LLUUID& mesh_id); void fetchPhysicsShape(const LLUUID& mesh_id); - + bool hasPhysicsShape(const LLUUID& mesh_id); + void buildHull(const LLVolumeParams& params, S32 detail); const LLSD& getMeshHeader(const LLUUID& mesh_id); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 4a1385134e..462ec2e75c 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -67,6 +67,7 @@ #include "pipeline.h" #include "llviewercontrol.h" #include "lluictrlfactory.h" +#include "llmeshrepository.h" //#include "llfirstuse.h" #include "lldrawpool.h" @@ -539,8 +540,6 @@ void LLPanelObject::getState( ) mCheckPhantom->set( mIsPhantom ); mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible ); - mComboPhysicsShapeType->setCurrentByIndex(objectp->getPhysicsShapeType()); - mComboPhysicsShapeType->setEnabled(editable); mSpinPhysicsGravity->set(objectp->getPhysicsGravity()); mSpinPhysicsGravity->setEnabled(editable); @@ -604,6 +603,7 @@ void LLPanelObject::getState( ) BOOL enabled = FALSE; BOOL hole_enabled = FALSE; F32 scale_x=1.f, scale_y=1.f; + BOOL isMesh = FALSE; if( !objectp || !objectp->getVolume() || !editable || !single_volume) { @@ -634,10 +634,9 @@ void LLPanelObject::getState( ) // Only allowed to change these parameters for objects // that you have permissions on AND are not attachments. enabled = root_objectp->permModify(); - - const LLVolumeParams &volume_params = objectp->getVolume()->getParams(); - + // Volume type + const LLVolumeParams &volume_params = objectp->getVolume()->getParams(); U8 path = volume_params.getPathParams().getCurveType(); U8 profile_and_hole = volume_params.getProfileParams().getCurveType(); U8 profile = profile_and_hole & LL_PCODE_PROFILE_MASK; @@ -868,7 +867,7 @@ void LLPanelObject::getState( ) } mSpinSkew->set( skew ); } - + // Compute control visibility, label names, and twist range. // Start with defaults. BOOL cut_visible = TRUE; @@ -1132,6 +1131,10 @@ void LLPanelObject::getState( ) mCtrlSculptInvert->setVisible(sculpt_texture_visible); + // update the physics shape combo to include allowed physics shapes + mComboPhysicsShapeType->removeall(); + mComboPhysicsShapeType->add(getString("None"), LLSD(1)); + // sculpt texture if (selected_item == MI_SCULPT) @@ -1163,6 +1166,7 @@ void LLPanelObject::getState( ) U8 sculpt_stitching = sculpt_type & LL_SCULPT_TYPE_MASK; BOOL sculpt_invert = sculpt_type & LL_SCULPT_FLAG_INVERT; BOOL sculpt_mirror = sculpt_type & LL_SCULPT_FLAG_MIRROR; + isMesh = (sculpt_stitching == LL_SCULPT_TYPE_MESH); if (mCtrlSculptType) { @@ -1179,20 +1183,43 @@ void LLPanelObject::getState( ) if (mCtrlSculptInvert) { mCtrlSculptInvert->set(sculpt_invert); - mCtrlSculptInvert->setEnabled(editable && (sculpt_stitching != LL_SCULPT_TYPE_MESH)); + mCtrlSculptInvert->setEnabled(editable && (!isMesh)); } if (mLabelSculptType) { mLabelSculptType->setEnabled(TRUE); } + } } else { - mSculptTextureRevert = LLUUID::null; + mSculptTextureRevert = LLUUID::null; } + if(isMesh && objectp) + { + const LLVolumeParams &volume_params = objectp->getVolume()->getParams(); + LLUUID mesh_id = volume_params.getSculptID(); + if(gMeshRepo.hasPhysicsShape(mesh_id)) + { + // if a mesh contains an uploaded or decomposed physics mesh, + // allow 'Prim' + mComboPhysicsShapeType->add(getString("Prim"), LLSD(0)); + } + // meshes always allow convex hull + mComboPhysicsShapeType->add(getString("Convex Hull"), LLSD(2)); + } + else + { + // simple prims always allow physics shape prim + mComboPhysicsShapeType->add(getString("Prim"), LLSD(0)); + } + + mComboPhysicsShapeType->setValue(LLSD(objectp->getPhysicsShapeType())); + mComboPhysicsShapeType->setEnabled(editable); + //---------------------------------------------------------------------------- @@ -1268,7 +1295,9 @@ public: void LLPanelObject::sendPhysicsParam() { - U8 type = (U8)mComboPhysicsShapeType->getCurrentIndex(); + LLSD physicsType = mComboPhysicsShapeType->getValue(); + + U8 type = physicsType.asInteger(); F32 gravity = mSpinPhysicsGravity->get(); F32 friction = mSpinPhysicsFriction->get(); F32 density = mSpinPhysicsDensity->get(); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index bd6be14341..6b77209867 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2900,7 +2900,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) LLVolumeParams volume_params = volume->getVolume()->getParams(); - LLPhysicsVolumeParams physics_params(volume->getVolume()->getParams(), + LLPhysicsVolumeParams physics_params(volume_params, physics_type == LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL); LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification physics_spec; diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index f6f74f2ebd..1f79cf310e 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1291,6 +1291,9 @@ even though the user gets a free copy. name="Object" top="16" width="295"> + None + Prim + Convex Hull - - - - + width="108"/> Date: Thu, 9 Dec 2010 17:46:51 -0800 Subject: Fixes for OSX 10.5 SDK builds --- indra/llrender/llgl.h | 63 ++++++++++++++++++++++++++++++++++++++++++++ indra/llrender/llglheaders.h | 5 +++- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index b152bd0c3c..4630811679 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -417,4 +417,67 @@ extern BOOL gClothRipple; extern BOOL gNoRender; extern BOOL gGLActive; +// Deal with changing glext.h definitions for newer SDK versions, specifically +// with MAC OSX 10.5 -> 10.6 + + +#ifndef GL_DEPTH_ATTACHMENT +#define GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_EXT +#endif + +#ifndef GL_STENCIL_ATTACHMENT +#define GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT_EXT +#endif + +#ifndef GL_FRAMEBUFFER +#define GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT +#define GL_DRAW_FRAMEBUFFER GL_DRAW_FRAMEBUFFER_EXT +#define GL_READ_FRAMEBUFFER GL_READ_FRAMEBUFFER_EXT +#define GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT +#define GL_FRAMEBUFFER_UNSUPPORTED GL_FRAMEBUFFER_UNSUPPORTED_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT +#define glGenFramebuffers glGenFramebuffersEXT +#define glBindFramebuffer glBindFramebufferEXT +#define glCheckFramebufferStatus glCheckFramebufferStatusEXT +#define glBlitFramebuffer glBlitFramebufferEXT +#define glDeleteFramebuffers glDeleteFramebuffersEXT +#define glFramebufferRenderbuffer glFramebufferRenderbufferEXT +#define glFramebufferTexture2D glFramebufferTexture2DEXT +#endif + +#ifndef GL_RENDERBUFFER +#define GL_RENDERBUFFER GL_RENDERBUFFER_EXT +#define glGenRenderbuffers glGenRenderbuffersEXT +#define glBindRenderbuffer glBindRenderbufferEXT +#define glRenderbufferStorage glRenderbufferStorageEXT +#define glRenderbufferStorageMultisample glRenderbufferStorageMultisampleEXT +#define glDeleteRenderbuffers glDeleteRenderbuffersEXT +#endif + +#ifndef GL_COLOR_ATTACHMENT +#define GL_COLOR_ATTACHMENT GL_COLOR_ATTACHMENT_EXT +#endif + +#ifndef GL_COLOR_ATTACHMENT0 +#define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT +#endif + +#ifndef GL_COLOR_ATTACHMENT1 +#define GL_COLOR_ATTACHMENT1 GL_COLOR_ATTACHMENT1_EXT +#endif + +#ifndef GL_COLOR_ATTACHMENT2 +#define GL_COLOR_ATTACHMENT2 GL_COLOR_ATTACHMENT2_EXT +#endif + +#ifndef GL_COLOR_ATTACHMENT3 +#define GL_COLOR_ATTACHMENT3 GL_COLOR_ATTACHMENT3_EXT +#endif + + +#ifndef GL_DEPTH24_STENCIL8 +#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_EXT +#endif + #endif // LL_LLGL_H diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index 1f77897a56..46bc282436 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -691,7 +691,7 @@ extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB; #include //GL_EXT_blend_func_separate -extern void glBlendFuncSeparateEXT(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +extern void glBlendFuncSeparateEXT(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) ; // GL_EXT_framebuffer_object extern GLboolean glIsRenderbufferEXT(GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; @@ -712,6 +712,9 @@ extern void glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenu extern void glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; extern void glGenerateMipmapEXT(GLenum target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; +#ifndef GL_ARB_framebuffer_object +#define glGenerateMipmap glGenerateMipmapEXT +#endif // GL_ARB_draw_buffers extern void glDrawBuffersARB(GLsizei n, const GLenum* bufs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -- cgit v1.2.3 From d8695e8d657568d0ebf6b63ad9cadad7e225afc7 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Thu, 9 Dec 2010 18:09:35 -0800 Subject: Use 10.5 sdk for now --- indra/cmake/Variables.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index c543710d6c..bc517cde49 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -88,7 +88,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) # NOTE: setting -isysroot is NOT adequate: http://lists.apple.com/archives/Xcode-users/2007/Oct/msg00696.html # see http://public.kitware.com/Bug/view.php?id=9959 + poppy - set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk) + set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk) set(CMAKE_OSX_DEPLOYMENT_TARGET 10.4) endif (NOT CMAKE_OSX_DEPLOYMENT_TARGET) -- cgit v1.2.3