aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs24
1 files changed, 15 insertions, 9 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs
index a977473..5a3008d 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,16 +423,16 @@ 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;
435 // sculpts pseudo convex
430 if (pbs.SculptType != (byte)SculptType.Mesh) 436 if (pbs.SculptType != (byte)SculptType.Mesh)
431 clod = (int)LevelOfDetail.Low; 437 clod = (int)LevelOfDetail.Low;
432 } 438 }
@@ -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;