update ODE binaries for windows. Other platforms need to compile from opensim-libs repo, folder ODE-OpenSim-0.13.2, read file OPENSIM-README.txt. Remove code to reduce bounce on non physical placement, new unmanaged should handle that

httptests
UbitUmarov 2017-04-18 00:50:55 +01:00
parent 9354e60df0
commit 49884b94a7
3 changed files with 77 additions and 122 deletions

View File

@ -111,7 +111,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
private int m_body_autodisable_frames;
public int m_bodydisablecontrol = 0;
public int m_bodyMoveCoolDown = 0;
private float m_gravmod = 1.0f;
// Default we're a Geometry
@ -1029,8 +1028,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
d.AllocateODEDataForThread(0);
if(Body != IntPtr.Zero)
{
if(m_bodyMoveCoolDown >= 0)
{
d.Vector3 dtmp = d.BodyGetAngularVel(Body);
m_rotationalVelocity.X = dtmp.X;
@ -1041,7 +1038,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
_velocity.X = dtmp.X;
_velocity.Y = dtmp.Y;
_velocity.Z = dtmp.Z;
}
d.BodySetLinearVel(Body, 0, 0, 0); // stop it
d.BodySetAngularVel(Body, 0, 0, 0);
}
@ -1345,7 +1342,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
bounce = parent_scene.m_materialContactsData[(int)Material.Wood].bounce;
m_building = true; // control must set this to false when done
m_bodyMoveCoolDown = 0;
AddChange(changes.Add, null);
@ -2144,14 +2140,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
}
else
{
/*
d.BodySetAngularVel(Body, m_rotationalVelocity.X, m_rotationalVelocity.Y, m_rotationalVelocity.Z);
d.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z);
*/
_zeroFlag = false;
m_bodydisablecontrol = 0;
}
m_bodyMoveCoolDown = -5;
_parent_scene.addActiveGroups(this);
}
@ -2244,7 +2238,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
}
m_mass = primMass;
m_collisionscore = 0;
m_bodyMoveCoolDown = 0;
}
private void FixInertia(Vector3 NewPos,Quaternion newrot)
@ -2907,7 +2900,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
_zeroFlag = true;
d.BodyEnable(Body);
m_bodyMoveCoolDown = -5;
}
}
// else if (_parent != null)
@ -2950,8 +2942,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
d.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z);
_position = newPos;
if (Body != IntPtr.Zero && !m_disabled)
m_bodyMoveCoolDown = -5;
}
if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
{
@ -3016,7 +3006,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
if(m_angularlocks != 0)
createAMotor(m_angularlocks);
m_bodyMoveCoolDown = -5;
}
}
if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
@ -3391,8 +3380,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
enableBodySoft();
else if (!d.BodyIsEnabled(Body))
d.BodyEnable(Body);
if(m_bodyMoveCoolDown >= 0)
d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z);
}
//resetCollisionAccounting();
}
@ -3416,9 +3403,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
enableBodySoft();
else if (!d.BodyIsEnabled(Body))
d.BodyEnable(Body);
if(m_bodyMoveCoolDown >= 0);
d.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z);
}
//resetCollisionAccounting();
}
@ -3569,26 +3553,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
if (!childPrim && m_isphysical && Body != IntPtr.Zero &&
!m_disabled && !m_isSelected && !m_building && !m_outbounds)
{
if(m_bodyMoveCoolDown < 0)
{
m_bodyMoveCoolDown++;
// if(!IsColliding)
// m_bodyCoolDown +=2;
if(m_bodyMoveCoolDown >= 0)
{
d.BodySetAngularVel(Body, m_rotationalVelocity.X, m_rotationalVelocity.Y, m_rotationalVelocity.Z);
d.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z);
}
else
{
d.BodySetAngularVel(Body, 0, 0, 0);
d.BodySetLinearVel(Body, 0, 0, 0);
m_forceacc = Vector3.Zero;
m_angularForceacc = Vector3.Zero;
_zeroFlag = false;
return;
}
}
if (!d.BodyIsEnabled(Body))
{
// let vehicles sleep
@ -3844,8 +3808,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
m_lastposition = _position;
m_lastorientation = _orientation;
if(m_bodyMoveCoolDown >= 0)
{
d.Vector3 dtmp = d.BodyGetAngularVel(Body);
m_rotationalVelocity.X = dtmp.X;
m_rotationalVelocity.Y = dtmp.Y;
@ -3855,7 +3817,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
_velocity.X = dtmp.X;
_velocity.Y = dtmp.Y;
_velocity.Z = dtmp.Z;
}
d.BodySetLinearVel(Body, 0, 0, 0); // stop it
d.BodySetAngularVel(Body, 0, 0, 0);
@ -3879,8 +3840,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
_zeroFlag = true;
}
else
{
if(m_bodyMoveCoolDown >= 0)
{
float poserror;
float angerror;
@ -3907,7 +3866,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
else
_zeroFlag = false;
}
}
// update position
if (!(_zeroFlag && lastZeroFlag))
@ -3931,8 +3889,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
m_rotationalVelocity = Vector3.Zero;
}
else
{
if(m_bodyMoveCoolDown >= 0)
{
d.Vector3 vel = d.BodyGetLinearVel(Body);
@ -3976,7 +3932,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
m_rotationalVelocity.Z = vel.Z;
}
}
}
if (_zeroFlag)
{

Binary file not shown.

Binary file not shown.