BulletSim: fix problem with not convex hulling large objects by creating unit meshes and always scaling in Bullet
parent
c3f579046c
commit
82f41fdcb5
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue