diff options
author | UbitUmarov | 2016-07-13 22:29:09 +0100 |
---|---|---|
committer | UbitUmarov | 2016-07-13 22:29:09 +0100 |
commit | 00687d5b0fef803bfebed5da2b1841890b589900 (patch) | |
tree | 5d95ca7d3c16d61c21042cd82ca27db0c3419dc8 /OpenSim/Region/ClientStack/Linden | |
parent | Oops that was not slower (diff) | |
download | opensim-SC-00687d5b0fef803bfebed5da2b1841890b589900.zip opensim-SC-00687d5b0fef803bfebed5da2b1841890b589900.tar.gz opensim-SC-00687d5b0fef803bfebed5da2b1841890b589900.tar.bz2 opensim-SC-00687d5b0fef803bfebed5da2b1841890b589900.tar.xz |
use geometric center and not sog root position in culling
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 10 |
1 files changed, 6 insertions, 4 deletions
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 | |||
4115 | 4115 | ||
4116 | if(!inview) | 4116 | if(!inview) |
4117 | { | 4117 | { |
4118 | Vector3 partpos = grp.AbsolutePosition; | 4118 | float bradius = grp.GetBoundsRadius(); // needs to be called before getBoundsCenter |
4119 | Vector3 partpos = grp.AbsolutePosition + grp.getBoundsCenter(); | ||
4119 | // float dcam = (partpos - mycamera).LengthSquared(); | 4120 | // float dcam = (partpos - mycamera).LengthSquared(); |
4120 | float dpos = (partpos - mypos).LengthSquared(); | 4121 | float dpos = (partpos - mypos).LengthSquared(); |
4121 | // if(dcam < dpos) | 4122 | // if(dcam < dpos) |
4122 | // dpos = dcam; | 4123 | // dpos = dcam; |
4123 | dpos = (float)Math.Sqrt(dpos) - grp.GetBoundsRadius(); | 4124 | dpos = (float)Math.Sqrt(dpos) - bradius; |
4124 | if(dpos > cullingrange) | 4125 | if(dpos > cullingrange) |
4125 | continue; | 4126 | continue; |
4126 | 4127 | ||
@@ -4418,13 +4419,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4418 | if(grp.IsDeleted || grp.IsAttachment) | 4419 | if(grp.IsDeleted || grp.IsAttachment) |
4419 | continue; | 4420 | continue; |
4420 | 4421 | ||
4421 | Vector3 grppos = grp.AbsolutePosition; | 4422 | float bradius = grp.GetBoundsRadius(); // needs to be called before getBoundsCenter |
4423 | Vector3 grppos = grp.AbsolutePosition + grp.getBoundsCenter(); | ||
4422 | // float dcam = (grppos - mycamera).LengthSquared(); | 4424 | // float dcam = (grppos - mycamera).LengthSquared(); |
4423 | float dpos = (grppos - mypos).LengthSquared(); | 4425 | float dpos = (grppos - mypos).LengthSquared(); |
4424 | // if(dcam < dpos) | 4426 | // if(dcam < dpos) |
4425 | // dpos = dcam; | 4427 | // dpos = dcam; |
4426 | 4428 | ||
4427 | dpos = (float)Math.Sqrt(dpos) - grp.GetBoundsRadius(); | 4429 | dpos = (float)Math.Sqrt(dpos) - bradius; |
4428 | 4430 | ||
4429 | bool inview; | 4431 | bool inview; |
4430 | lock(GroupsInView) | 4432 | lock(GroupsInView) |