diff options
Diffstat (limited to 'OpenSim/Region')
4 files changed, 22 insertions, 11 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index 306928a..965c382 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | |||
@@ -220,7 +220,7 @@ public static class BSParam | |||
220 | (s) => { return BSParam.NumericBool(ShouldUseHullsForPhysicalObjects); }, | 220 | (s) => { return BSParam.NumericBool(ShouldUseHullsForPhysicalObjects); }, |
221 | (s,p,l,v) => { ShouldUseHullsForPhysicalObjects = BSParam.BoolNumeric(v); } ), | 221 | (s,p,l,v) => { ShouldUseHullsForPhysicalObjects = BSParam.BoolNumeric(v); } ), |
222 | new ParameterDefn("ShouldRemoveZeroWidthTriangles", "If true, remove degenerate triangles from meshes", | 222 | new ParameterDefn("ShouldRemoveZeroWidthTriangles", "If true, remove degenerate triangles from meshes", |
223 | ConfigurationParameters.numericFalse, | 223 | ConfigurationParameters.numericTrue, |
224 | (s,cf,p,v) => { ShouldRemoveZeroWidthTriangles = cf.GetBoolean(p, BSParam.BoolNumeric(v)); }, | 224 | (s,cf,p,v) => { ShouldRemoveZeroWidthTriangles = cf.GetBoolean(p, BSParam.BoolNumeric(v)); }, |
225 | (s) => { return BSParam.NumericBool(ShouldRemoveZeroWidthTriangles); }, | 225 | (s) => { return BSParam.NumericBool(ShouldRemoveZeroWidthTriangles); }, |
226 | (s,p,l,v) => { ShouldRemoveZeroWidthTriangles = BSParam.BoolNumeric(v); } ), | 226 | (s,p,l,v) => { ShouldRemoveZeroWidthTriangles = BSParam.BoolNumeric(v); } ), |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index 823402b..ec25aa9 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |||
@@ -75,6 +75,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
75 | PhysicsScene = parentScene; | 75 | PhysicsScene = parentScene; |
76 | LocalID = localID; | 76 | LocalID = localID; |
77 | PhysObjectName = name; | 77 | PhysObjectName = name; |
78 | Name = name; // PhysicsActor also has the name of the object. Someday consolidate. | ||
78 | TypeName = typeName; | 79 | TypeName = typeName; |
79 | 80 | ||
80 | // We don't have any physical representation yet. | 81 | // We don't have any physical representation yet. |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs index fe0f984..15747c9 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs | |||
@@ -608,7 +608,7 @@ public sealed class BSShapeCollection : IDisposable | |||
608 | // Since we're recreating new, get rid of the reference to the previous shape | 608 | // Since we're recreating new, get rid of the reference to the previous shape |
609 | DereferenceShape(prim.PhysShape, shapeCallback); | 609 | DereferenceShape(prim.PhysShape, shapeCallback); |
610 | 610 | ||
611 | newShape = CreatePhysicalMesh(prim.PhysObjectName, newMeshKey, prim.BaseShape, prim.Size, lod); | 611 | newShape = CreatePhysicalMesh(prim, newMeshKey, prim.BaseShape, prim.Size, lod); |
612 | // Take evasive action if the mesh was not constructed. | 612 | // Take evasive action if the mesh was not constructed. |
613 | newShape = VerifyMeshCreated(newShape, prim); | 613 | newShape = VerifyMeshCreated(newShape, prim); |
614 | 614 | ||
@@ -619,7 +619,7 @@ public sealed class BSShapeCollection : IDisposable | |||
619 | return true; // 'true' means a new shape has been added to this prim | 619 | return true; // 'true' means a new shape has been added to this prim |
620 | } | 620 | } |
621 | 621 | ||
622 | private BulletShape CreatePhysicalMesh(string objName, System.UInt64 newMeshKey, PrimitiveBaseShape pbs, OMV.Vector3 size, float lod) | 622 | private BulletShape CreatePhysicalMesh(BSPhysObject prim, System.UInt64 newMeshKey, PrimitiveBaseShape pbs, OMV.Vector3 size, float lod) |
623 | { | 623 | { |
624 | BulletShape newShape = new BulletShape(); | 624 | BulletShape newShape = new BulletShape(); |
625 | 625 | ||
@@ -631,7 +631,7 @@ public sealed class BSShapeCollection : IDisposable | |||
631 | } | 631 | } |
632 | else | 632 | else |
633 | { | 633 | { |
634 | IMesh meshData = PhysicsScene.mesher.CreateMesh(objName, pbs, size, lod, | 634 | IMesh meshData = PhysicsScene.mesher.CreateMesh(prim.PhysObjectName, pbs, size, lod, |
635 | false, // say it is not physical so a bounding box is not built | 635 | false, // say it is not physical so a bounding box is not built |
636 | false // do not cache the mesh and do not use previously built versions | 636 | false // do not cache the mesh and do not use previously built versions |
637 | ); | 637 | ); |
@@ -651,18 +651,20 @@ public sealed class BSShapeCollection : IDisposable | |||
651 | realIndicesIndex = 0; | 651 | realIndicesIndex = 0; |
652 | for (int tri = 0; tri < indices.Length; tri += 3) | 652 | for (int tri = 0; tri < indices.Length; tri += 3) |
653 | { | 653 | { |
654 | // Compute displacements into vertex array for each vertex of the triangle | ||
654 | int v1 = indices[tri + 0] * 3; | 655 | int v1 = indices[tri + 0] * 3; |
655 | int v2 = indices[tri + 1] * 3; | 656 | int v2 = indices[tri + 1] * 3; |
656 | int v3 = indices[tri + 2] * 3; | 657 | int v3 = indices[tri + 2] * 3; |
657 | if (!((verticesAsFloats[v1 + 0] == verticesAsFloats[v2 + 0] | 658 | // Check to see if any two of the vertices are the same |
659 | if (!( ( verticesAsFloats[v1 + 0] == verticesAsFloats[v2 + 0] | ||
658 | && verticesAsFloats[v1 + 1] == verticesAsFloats[v2 + 1] | 660 | && verticesAsFloats[v1 + 1] == verticesAsFloats[v2 + 1] |
659 | && verticesAsFloats[v1 + 2] == verticesAsFloats[v2 + 2]) | 661 | && verticesAsFloats[v1 + 2] == verticesAsFloats[v2 + 2]) |
660 | || (verticesAsFloats[v2 + 0] == verticesAsFloats[v3 + 0] | 662 | || ( verticesAsFloats[v2 + 0] == verticesAsFloats[v3 + 0] |
661 | && verticesAsFloats[v2 + 1] == verticesAsFloats[v3 + 1] | 663 | && verticesAsFloats[v2 + 1] == verticesAsFloats[v3 + 1] |
662 | && verticesAsFloats[v2 + 2] == verticesAsFloats[v3 + 2]) | 664 | && verticesAsFloats[v2 + 2] == verticesAsFloats[v3 + 2]) |
663 | || (verticesAsFloats[v1 + 0] == verticesAsFloats[v3 + 0] | 665 | || ( verticesAsFloats[v1 + 0] == verticesAsFloats[v3 + 0] |
664 | && verticesAsFloats[v1 + 1] == verticesAsFloats[v3 + 1] | 666 | && verticesAsFloats[v1 + 1] == verticesAsFloats[v3 + 1] |
665 | && verticesAsFloats[v1 + 2] == verticesAsFloats[v3 + 2])) | 667 | && verticesAsFloats[v1 + 2] == verticesAsFloats[v3 + 2]) ) |
666 | ) | 668 | ) |
667 | { | 669 | { |
668 | // None of the vertices of the triangles are the same. This is a good triangle; | 670 | // None of the vertices of the triangles are the same. This is a good triangle; |
@@ -676,8 +678,16 @@ public sealed class BSShapeCollection : IDisposable | |||
676 | DetailLog("{0},BSShapeCollection.CreatePhysicalMesh,origTri={1},realTri={2},numVerts={3}", | 678 | DetailLog("{0},BSShapeCollection.CreatePhysicalMesh,origTri={1},realTri={2},numVerts={3}", |
677 | BSScene.DetailLogZero, indices.Length / 3, realIndicesIndex / 3, verticesAsFloats.Length / 3); | 679 | BSScene.DetailLogZero, indices.Length / 3, realIndicesIndex / 3, verticesAsFloats.Length / 3); |
678 | 680 | ||
679 | newShape = PhysicsScene.PE.CreateMeshShape(PhysicsScene.World, | 681 | if (realIndicesIndex != 0) |
680 | realIndicesIndex, indices, verticesAsFloats.Length/3, verticesAsFloats); | 682 | { |
683 | newShape = PhysicsScene.PE.CreateMeshShape(PhysicsScene.World, | ||
684 | realIndicesIndex, indices, verticesAsFloats.Length / 3, verticesAsFloats); | ||
685 | } | ||
686 | else | ||
687 | { | ||
688 | PhysicsScene.Logger.ErrorFormat("{0} All mesh triangles degenerate. Prim {1} at {2} in {3}", | ||
689 | LogHeader, prim.PhysObjectName, prim.RawPosition, PhysicsScene.Name); | ||
690 | } | ||
681 | } | 691 | } |
682 | } | 692 | } |
683 | newShape.shapeKey = newMeshKey; | 693 | newShape.shapeKey = newMeshKey; |
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs index 438ef48..b98b762 100644 --- a/OpenSim/Region/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs | |||
@@ -420,7 +420,7 @@ namespace OpenSim.Region.UserStatistics | |||
420 | Encoding encoding = Encoding.ASCII; | 420 | Encoding encoding = Encoding.ASCII; |
421 | int sizeOfChar = encoding.GetByteCount("\n"); | 421 | int sizeOfChar = encoding.GetByteCount("\n"); |
422 | byte[] buffer = encoding.GetBytes("\n"); | 422 | byte[] buffer = encoding.GetBytes("\n"); |
423 | string logfile = Util.logDir() + "/" + "OpenSim.log"; | 423 | string logfile = Util.logFile(); |
424 | FileStream fs = new FileStream(logfile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); | 424 | FileStream fs = new FileStream(logfile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); |
425 | Int64 tokenCount = 0; | 425 | Int64 tokenCount = 0; |
426 | Int64 endPosition = fs.Length / sizeOfChar; | 426 | Int64 endPosition = fs.Length / sizeOfChar; |