aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs50
1 files changed, 50 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index bd6369c..e84ab05 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4236,6 +4236,56 @@ namespace OpenSim.Region.Framework.Scenes
4236 ScheduleFullUpdate(); 4236 ScheduleFullUpdate();
4237 } 4237 }
4238 4238
4239 public void UpdateSlice(float begin, float end)
4240 {
4241 if (end < begin)
4242 {
4243 float temp = begin;
4244 begin = end;
4245 end = temp;
4246 }
4247 end = Math.Min(1f, Math.Max(0f, end));
4248 begin = Math.Min(Math.Min(1f, Math.Max(0f, begin)), end - 0.02f);
4249 if (begin < 0.02f && end < 0.02f)
4250 {
4251 begin = 0f;
4252 end = 0.02f;
4253 }
4254
4255 ushort uBegin = (ushort)(50000.0 * begin);
4256 ushort uEnd = (ushort)(50000.0 * (1f - end));
4257 bool updatePossiblyNeeded = false;
4258 if (GetPrimType() == PrimType.SPHERE)
4259 {
4260 if (m_shape.ProfileBegin != uBegin || m_shape.ProfileEnd != uEnd)
4261 {
4262 m_shape.ProfileBegin = uBegin;
4263 m_shape.ProfileEnd = uEnd;
4264 updatePossiblyNeeded = true;
4265 }
4266 }
4267 else if (m_shape.PathBegin != uBegin || m_shape.PathEnd != uEnd)
4268 {
4269 m_shape.PathBegin = uBegin;
4270 m_shape.PathEnd = uEnd;
4271 updatePossiblyNeeded = true;
4272 }
4273
4274 if (updatePossiblyNeeded && ParentGroup != null)
4275 {
4276 ParentGroup.HasGroupChanged = true;
4277 }
4278 if (updatePossiblyNeeded && PhysActor != null)
4279 {
4280 PhysActor.Shape = m_shape;
4281 ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
4282 }
4283 if (updatePossiblyNeeded)
4284 {
4285 ScheduleFullUpdate();
4286 }
4287 }
4288
4239 /// <summary> 4289 /// <summary>
4240 /// If the part is a sculpt/mesh, retrieve the mesh data and reinsert it into the shape so that the physics 4290 /// If the part is a sculpt/mesh, retrieve the mesh data and reinsert it into the shape so that the physics
4241 /// engine can use it. 4291 /// engine can use it.