Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

0.7.4.1
Justin Clark-Casey (justincc) 2012-08-01 00:40:31 +01:00
commit 69a5beeabc
7 changed files with 14 additions and 12 deletions

View File

@ -86,7 +86,7 @@ public class BSConstraint : IDisposable
public bool SetCFMAndERP(float cfm, float erp)
{
bool ret = false;
bool ret = true;
BulletSimAPI.SetConstraintParam2(m_constraint.Ptr, ConstraintParams.BT_CONSTRAINT_STOP_CFM, cfm, ConstraintParamAxis.AXIS_ALL);
BulletSimAPI.SetConstraintParam2(m_constraint.Ptr, ConstraintParams.BT_CONSTRAINT_STOP_ERP, erp, ConstraintParamAxis.AXIS_ALL);
BulletSimAPI.SetConstraintParam2(m_constraint.Ptr, ConstraintParams.BT_CONSTRAINT_CFM, cfm, ConstraintParamAxis.AXIS_ALL);

View File

@ -187,6 +187,7 @@ public sealed class BSPrim : PhysicsActor
{
_mass = CalculateMass(); // changing size changes the mass
BulletSimAPI.SetObjectScaleMass(_scene.WorldID, _localID, _scale, (IsPhysical ? _mass : 0f), IsPhysical);
DetailLog("{0}: setSize: size={1}, mass={2}, physical={3}", LocalID, _size, _mass, IsPhysical);
RecreateGeomAndObject();
});
}
@ -972,7 +973,7 @@ public sealed class BSPrim : PhysicsActor
if (_size.X == _size.Y && _size.Y == _size.Z && _size.X == _size.Z)
{
// m_log.DebugFormat("{0}: CreateGeom: Defaulting to sphere of size {1}", LogHeader, _size);
if (_shapeType != ShapeData.PhysicsShapeType.SHAPE_SPHERE)
if (forceRebuild || (_shapeType != ShapeData.PhysicsShapeType.SHAPE_SPHERE))
{
DetailLog("{0},CreateGeom,sphere", LocalID);
_shapeType = ShapeData.PhysicsShapeType.SHAPE_SPHERE;
@ -986,7 +987,7 @@ public sealed class BSPrim : PhysicsActor
else
{
// m_log.DebugFormat("{0}: CreateGeom: Defaulting to box. lid={1}, type={2}, size={3}", LogHeader, LocalID, _shapeType, _size);
if (_shapeType != ShapeData.PhysicsShapeType.SHAPE_BOX)
if (forceRebuild || (_shapeType != ShapeData.PhysicsShapeType.SHAPE_BOX))
{
DetailLog("{0},CreateGeom,box", LocalID);
_shapeType = ShapeData.PhysicsShapeType.SHAPE_BOX;
@ -1201,7 +1202,8 @@ public sealed class BSPrim : PhysicsActor
// Create an object in Bullet if it has not already been created
// No locking here because this is done when the physics engine is not simulating
private void CreateObject()
// Returns 'true' if an object was actually created.
private bool CreateObject()
{
// this routine is called when objects are rebuilt.
@ -1209,10 +1211,12 @@ public sealed class BSPrim : PhysicsActor
ShapeData shape;
FillShapeInfo(out shape);
// m_log.DebugFormat("{0}: CreateObject: lID={1}, shape={2}", LogHeader, _localID, shape.Type);
BulletSimAPI.CreateObject(_scene.WorldID, shape);
bool ret = BulletSimAPI.CreateObject(_scene.WorldID, shape);
// the CreateObject() may have recreated the rigid body. Make sure we have the latest.
m_body.Ptr = BulletSimAPI.GetBodyHandle2(_scene.World.Ptr, LocalID);
return ret;
}
// Copy prim's info into the BulletSim shape description structure
@ -1327,7 +1331,6 @@ public sealed class BSPrim : PhysicsActor
base.RequestPhysicsterseUpdate();
}
/*
else
{
// For debugging, we can also report the movement of children
@ -1335,7 +1338,6 @@ public sealed class BSPrim : PhysicsActor
LocalID, entprop.Position, entprop.Rotation, entprop.Velocity,
entprop.Acceleration, entprop.RotationalVelocity);
}
*/
}
// I've collided with something

View File

@ -87,12 +87,12 @@ public struct ShapeData
public System.UInt64 MeshKey;
public float Friction;
public float Restitution;
public int Collidable;
public int Static; // true if a static object. Otherwise gravity, etc.
public float Collidable; // true of things bump into this
public float Static; // true if a static object. Otherwise gravity, etc.
// note that bools are passed as ints since bool size changes by language and architecture
public const int numericTrue = 1;
public const int numericFalse = 0;
// note that bools are passed as floats since bool size changes by language and architecture
public const float numericTrue = 1f;
public const float numericFalse = 0f;
}
[StructLayout(LayoutKind.Sequential)]
public struct SweepHit

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.