From 82f41fdcb54d61e78f6ab8efdbbb521dfc5b9217 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Fri, 5 Aug 2011 14:53:39 -0700 Subject: BulletSim: fix problem with not convex hulling large objects by creating unit meshes and always scaling in Bullet --- OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 04cb452..c4999f6 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs @@ -1013,8 +1013,8 @@ public sealed class BSPrim : PhysicsActor // m_log.DebugFormat("{0}: CreateGeom: calling CreateHull. lid={1}, key={2}, hulls={3}", LogHeader, _localID, _hullKey, hullCount); BulletSimAPI.CreateHull(_scene.WorldID, _hullKey, hullCount, convHulls); _shapeType = ShapeData.PhysicsShapeType.SHAPE_HULL; - // meshes are already scaled by the meshmerizer - _scale = new OMV.Vector3(1f, 1f, 1f); + // Let the object be scaled by Bullet (the mesh was created as a unit mesh) + _scale = _size; } return; } @@ -1138,7 +1138,9 @@ public sealed class BSPrim : PhysicsActor if (_scene.NeedsMeshing(_pbs)) // linksets with constraints don't need a root mesh { // m_log.DebugFormat("{0}: RecreateGeomAndObject: creating mesh", LogHeader); - _mesh = _scene.mesher.CreateMesh(_avName, _pbs, _size, _scene.MeshLOD, _isPhysical); + // Make the mesh scaled to 1 and use Bullet's scaling feature to scale it in world + OMV.Vector3 scaleFactor = new OMV.Vector3(1.0f, 1.0f, 1.0f); + _mesh = _scene.mesher.CreateMesh(_avName, _pbs, scaleFactor, _scene.MeshLOD, _isPhysical); } else { -- cgit v1.1