aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs
diff options
context:
space:
mode:
authorUbitUmarov2016-12-14 13:35:53 +0000
committerUbitUmarov2016-12-14 13:35:53 +0000
commit18a292ad02e590619760a71aeb1514e6916b257f (patch)
tree584faa43265cc20ee36d92b2bc14cb1c55435ef0 /OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs
parentMerge branch 'master' into httptests (diff)
parentfix: check for region_handle before region_id, viewers are so funny.. (diff)
downloadopensim-SC-18a292ad02e590619760a71aeb1514e6916b257f.zip
opensim-SC-18a292ad02e590619760a71aeb1514e6916b257f.tar.gz
opensim-SC-18a292ad02e590619760a71aeb1514e6916b257f.tar.bz2
opensim-SC-18a292ad02e590619760a71aeb1514e6916b257f.tar.xz
Merge branch 'master' into httptests
Diffstat (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs')
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs26
1 files changed, 16 insertions, 10 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs
index a977473..bb661e5 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs
@@ -239,7 +239,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
239 { 239 {
240 if (m_scene.haveActor(repData.actor)) 240 if (m_scene.haveActor(repData.actor))
241 { 241 {
242 if (needsMeshing(repData.pbs)) // no need for pbs now? 242 if (needsMeshing(repData)) // no need for pbs now?
243 { 243 {
244 repData.comand = meshWorkerCmnds.changefull; 244 repData.comand = meshWorkerCmnds.changefull;
245 createqueue.Enqueue(repData); 245 createqueue.Enqueue(repData);
@@ -284,8 +284,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
284 /// </summary> 284 /// </summary>
285 /// <param name="pbs"></param> 285 /// <param name="pbs"></param>
286 /// <returns></returns> 286 /// <returns></returns>
287 public bool needsMeshing(PrimitiveBaseShape pbs) 287 public bool needsMeshing(ODEPhysRepData repData)
288 { 288 {
289 PrimitiveBaseShape pbs = repData.pbs;
289 // check sculpts or meshs 290 // check sculpts or meshs
290 if (pbs.SculptEntry) 291 if (pbs.SculptEntry)
291 { 292 {
@@ -301,6 +302,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde
301 if (forceSimplePrimMeshing) 302 if (forceSimplePrimMeshing)
302 return true; 303 return true;
303 304
305 // convex shapes have no holes
306 ushort profilehollow = pbs.ProfileHollow;
307 if(repData.shapetype == 2)
308 profilehollow = 0;
309
304 // if it's a standard box or sphere with no cuts, hollows, twist or top shear, return false since ODE can use an internal representation for the prim 310 // if it's a standard box or sphere with no cuts, hollows, twist or top shear, return false since ODE can use an internal representation for the prim
305 311
306 if ((pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight) 312 if ((pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight)
@@ -309,7 +315,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
309 { 315 {
310 316
311 if (pbs.ProfileBegin == 0 && pbs.ProfileEnd == 0 317 if (pbs.ProfileBegin == 0 && pbs.ProfileEnd == 0
312 && pbs.ProfileHollow == 0 318 && profilehollow == 0
313 && pbs.PathTwist == 0 && pbs.PathTwistBegin == 0 319 && pbs.PathTwist == 0 && pbs.PathTwistBegin == 0
314 && pbs.PathBegin == 0 && pbs.PathEnd == 0 320 && pbs.PathBegin == 0 && pbs.PathEnd == 0
315 && pbs.PathTaperX == 0 && pbs.PathTaperY == 0 321 && pbs.PathTaperX == 0 && pbs.PathTaperY == 0
@@ -326,7 +332,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
326 332
327 int iPropertiesNotSupportedDefault = 0; 333 int iPropertiesNotSupportedDefault = 0;
328 334
329 if (pbs.ProfileHollow != 0) 335 if (profilehollow != 0)
330 iPropertiesNotSupportedDefault++; 336 iPropertiesNotSupportedDefault++;
331 337
332 if ((pbs.PathBegin != 0) || pbs.PathEnd != 0) 338 if ((pbs.PathBegin != 0) || pbs.PathEnd != 0)
@@ -407,7 +413,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
407 PhysicsActor actor = repData.actor; 413 PhysicsActor actor = repData.actor;
408 PrimitiveBaseShape pbs = repData.pbs; 414 PrimitiveBaseShape pbs = repData.pbs;
409 415
410 if (!needsMeshing(pbs)) 416 if (!needsMeshing(repData))
411 { 417 {
412 repData.meshState = MeshState.noNeed; 418 repData.meshState = MeshState.noNeed;
413 repData.hasOBB = false; 419 repData.hasOBB = false;
@@ -417,17 +423,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde
417 IMesh mesh = null; 423 IMesh mesh = null;
418 424
419 Vector3 size = repData.size; 425 Vector3 size = repData.size;
420 byte shapetype = repData.shapetype;
421
422 bool convex;
423 426
424 int clod = (int)LevelOfDetail.High; 427 int clod = (int)LevelOfDetail.High;
428 bool convex;
429 byte shapetype = repData.shapetype;
425 if (shapetype == 0) 430 if (shapetype == 0)
426 convex = false; 431 convex = false;
427 else 432 else
428 { 433 {
429 convex = true; 434 convex = true;
430 if (pbs.SculptType != (byte)SculptType.Mesh) 435 // sculpts pseudo convex
436 if (pbs.SculptEntry && pbs.SculptType != (byte)SculptType.Mesh)
431 clod = (int)LevelOfDetail.Low; 437 clod = (int)LevelOfDetail.Low;
432 } 438 }
433 439
@@ -483,7 +489,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
483 repData.mesh = null; 489 repData.mesh = null;
484 repData.hasOBB = false; 490 repData.hasOBB = false;
485 491
486 if (!needsMeshing(pbs)) 492 if (!needsMeshing(repData))
487 { 493 {
488 repData.meshState = MeshState.noNeed; 494 repData.meshState = MeshState.noNeed;
489 return; 495 return;