From 00687d5b0fef803bfebed5da2b1841890b589900 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 13 Jul 2016 22:29:09 +0100 Subject: use geometric center and not sog root position in culling --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/UDP') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index c6190dd..2f5d3c8 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -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) -- cgit v1.1