diff options
author | Mic Bowman | 2011-08-05 14:53:39 -0700 |
---|---|---|
committer | Mic Bowman | 2011-08-05 14:53:39 -0700 |
commit | 82f41fdcb54d61e78f6ab8efdbbb521dfc5b9217 (patch) | |
tree | b74761e2ea94893d35a2444b807cb9036b84fdae | |
parent | Merge branch 'master' into bulletsim (diff) | |
download | opensim-SC-82f41fdcb54d61e78f6ab8efdbbb521dfc5b9217.zip opensim-SC-82f41fdcb54d61e78f6ab8efdbbb521dfc5b9217.tar.gz opensim-SC-82f41fdcb54d61e78f6ab8efdbbb521dfc5b9217.tar.bz2 opensim-SC-82f41fdcb54d61e78f6ab8efdbbb521dfc5b9217.tar.xz |
BulletSim: fix problem with not convex hulling large objects by creating unit meshes and always scaling in Bullet
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 8 |
1 files changed, 5 insertions, 3 deletions
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 | |||
1013 | // m_log.DebugFormat("{0}: CreateGeom: calling CreateHull. lid={1}, key={2}, hulls={3}", LogHeader, _localID, _hullKey, hullCount); | 1013 | // m_log.DebugFormat("{0}: CreateGeom: calling CreateHull. lid={1}, key={2}, hulls={3}", LogHeader, _localID, _hullKey, hullCount); |
1014 | BulletSimAPI.CreateHull(_scene.WorldID, _hullKey, hullCount, convHulls); | 1014 | BulletSimAPI.CreateHull(_scene.WorldID, _hullKey, hullCount, convHulls); |
1015 | _shapeType = ShapeData.PhysicsShapeType.SHAPE_HULL; | 1015 | _shapeType = ShapeData.PhysicsShapeType.SHAPE_HULL; |
1016 | // meshes are already scaled by the meshmerizer | 1016 | // Let the object be scaled by Bullet (the mesh was created as a unit mesh) |
1017 | _scale = new OMV.Vector3(1f, 1f, 1f); | 1017 | _scale = _size; |
1018 | } | 1018 | } |
1019 | return; | 1019 | return; |
1020 | } | 1020 | } |
@@ -1138,7 +1138,9 @@ public sealed class BSPrim : PhysicsActor | |||
1138 | if (_scene.NeedsMeshing(_pbs)) // linksets with constraints don't need a root mesh | 1138 | if (_scene.NeedsMeshing(_pbs)) // linksets with constraints don't need a root mesh |
1139 | { | 1139 | { |
1140 | // m_log.DebugFormat("{0}: RecreateGeomAndObject: creating mesh", LogHeader); | 1140 | // m_log.DebugFormat("{0}: RecreateGeomAndObject: creating mesh", LogHeader); |
1141 | _mesh = _scene.mesher.CreateMesh(_avName, _pbs, _size, _scene.MeshLOD, _isPhysical); | 1141 | // Make the mesh scaled to 1 and use Bullet's scaling feature to scale it in world |
1142 | OMV.Vector3 scaleFactor = new OMV.Vector3(1.0f, 1.0f, 1.0f); | ||
1143 | _mesh = _scene.mesher.CreateMesh(_avName, _pbs, scaleFactor, _scene.MeshLOD, _isPhysical); | ||
1142 | } | 1144 | } |
1143 | else | 1145 | else |
1144 | { | 1146 | { |