use geometric center and not sog root position in culling

This commit is contained in:
UbitUmarov
2016-07-13 22:29:09 +01:00
parent e0a1025497
commit 00687d5b0f
2 changed files with 25 additions and 17 deletions

View File

@@ -4115,12 +4115,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if(!inview)
{
Vector3 partpos = grp.AbsolutePosition;
float bradius = grp.GetBoundsRadius(); // needs to be called before getBoundsCenter
Vector3 partpos = grp.AbsolutePosition + grp.getBoundsCenter();
// float dcam = (partpos - mycamera).LengthSquared();
float dpos = (partpos - mypos).LengthSquared();
// if(dcam < dpos)
// dpos = dcam;
dpos = (float)Math.Sqrt(dpos) - grp.GetBoundsRadius();
dpos = (float)Math.Sqrt(dpos) - bradius;
if(dpos > cullingrange)
continue;
@@ -4418,13 +4419,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if(grp.IsDeleted || grp.IsAttachment)
continue;
Vector3 grppos = grp.AbsolutePosition;
float bradius = grp.GetBoundsRadius(); // needs to be called before getBoundsCenter
Vector3 grppos = grp.AbsolutePosition + grp.getBoundsCenter();
// float dcam = (grppos - mycamera).LengthSquared();
float dpos = (grppos - mypos).LengthSquared();
// if(dcam < dpos)
// dpos = dcam;
dpos = (float)Math.Sqrt(dpos) - grp.GetBoundsRadius();
dpos = (float)Math.Sqrt(dpos) - bradius;
bool inview;
lock(GroupsInView)