diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/pipeline.cpp | 79 |
1 files changed, 38 insertions, 41 deletions
diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp index 3fa9098..13d8d09 100644 --- a/linden/indra/newview/pipeline.cpp +++ b/linden/indra/newview/pipeline.cpp | |||
@@ -4092,55 +4092,52 @@ LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector3& start, | |||
4092 | 4092 | ||
4093 | const F32 ATTACHMENT_OVERRIDE_DIST = 0.1f; | 4093 | const F32 ATTACHMENT_OVERRIDE_DIST = 0.1f; |
4094 | 4094 | ||
4095 | if (!drawable || !drawable->getVObj()->isAttachment()) | 4095 | //check against avatars |
4096 | { //check against avatars | 4096 | sPickAvatar = TRUE; |
4097 | sPickAvatar = TRUE; | 4097 | for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); |
4098 | for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); | 4098 | iter != LLWorld::getInstance()->getRegionList().end(); ++iter) |
4099 | iter != LLWorld::getInstance()->getRegionList().end(); ++iter) | 4099 | { |
4100 | LLViewerRegion* region = *iter; | ||
4101 | |||
4102 | LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_BRIDGE); | ||
4103 | if (part && hasRenderType(part->mDrawableType)) | ||
4104 | { | ||
4105 | LLDrawable* hit = part->lineSegmentIntersect(start, local_end, pick_transparent, face_hit, &position, tex_coord, normal, bi_normal); | ||
4106 | if (hit) | ||
4100 | { | 4107 | { |
4101 | LLViewerRegion* region = *iter; | 4108 | if (!drawable || |
4109 | !drawable->getVObj()->isAttachment() || | ||
4110 | (position-local_end).magVec() > ATTACHMENT_OVERRIDE_DIST) | ||
4111 | { //avatar overrides if previously hit drawable is not an attachment or | ||
4112 | //attachment is far enough away from detected intersection | ||
4113 | drawable = hit; | ||
4114 | local_end = position; | ||
4115 | } | ||
4116 | else | ||
4117 | { //prioritize attachments over avatars | ||
4118 | position = local_end; | ||
4102 | 4119 | ||
4103 | LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_BRIDGE); | 4120 | if (face_hit) |
4104 | if (part && hasRenderType(part->mDrawableType)) | ||
4105 | { | ||
4106 | LLDrawable* hit = part->lineSegmentIntersect(start, local_end, pick_transparent, face_hit, &position, tex_coord, normal, bi_normal); | ||
4107 | if (hit) | ||
4108 | { | 4121 | { |
4109 | if (!drawable || | 4122 | *face_hit = local_face_hit; |
4110 | !drawable->getVObj()->isAttachment() || | 4123 | } |
4111 | (position-local_end).magVec() > ATTACHMENT_OVERRIDE_DIST) | 4124 | if (tex_coord) |
4112 | { //avatar overrides if previously hit drawable is not an attachment or | 4125 | { |
4113 | //attachment is far enough away from detected intersection | 4126 | *tex_coord = local_texcoord; |
4114 | drawable = hit; | 4127 | } |
4115 | local_end = position; | 4128 | if (bi_normal) |
4116 | } | 4129 | { |
4117 | else | 4130 | *bi_normal = local_binormal; |
4118 | { //prioritize attachments over avatars | 4131 | } |
4119 | position = local_end; | 4132 | if (normal) |
4120 | 4133 | { | |
4121 | if (face_hit) | 4134 | *normal = local_normal; |
4122 | { | ||
4123 | *face_hit = local_face_hit; | ||
4124 | } | ||
4125 | if (tex_coord) | ||
4126 | { | ||
4127 | *tex_coord = local_texcoord; | ||
4128 | } | ||
4129 | if (bi_normal) | ||
4130 | { | ||
4131 | *bi_normal = local_binormal; | ||
4132 | } | ||
4133 | if (normal) | ||
4134 | { | ||
4135 | *normal = local_normal; | ||
4136 | } | ||
4137 | } | ||
4138 | } | 4135 | } |
4139 | } | 4136 | } |
4140 | } | 4137 | } |
4141 | } | 4138 | } |
4142 | } | 4139 | } |
4143 | 4140 | } | |
4144 | 4141 | ||
4145 | //check all avatar nametags (silly, isn't it?) | 4142 | //check all avatar nametags (silly, isn't it?) |
4146 | for (std::vector< LLCharacter* >::iterator iter = LLCharacter::sInstances.begin(); | 4143 | for (std::vector< LLCharacter* >::iterator iter = LLCharacter::sInstances.begin(); |