testing
parent
76d9040ed4
commit
d8f691664a
|
@ -103,6 +103,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
private float m_buoyancy = 0f;
|
private float m_buoyancy = 0f;
|
||||||
|
|
||||||
|
private bool m_freemove = false;
|
||||||
// private CollisionLocker ode;
|
// private CollisionLocker ode;
|
||||||
|
|
||||||
private string m_name = String.Empty;
|
private string m_name = String.Empty;
|
||||||
|
@ -687,6 +688,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
_zeroFlag = false;
|
_zeroFlag = false;
|
||||||
m_pidControllerActive = true;
|
m_pidControllerActive = true;
|
||||||
|
m_freemove = false;
|
||||||
|
|
||||||
d.BodySetAutoDisableFlag(Body, false);
|
d.BodySetAutoDisableFlag(Body, false);
|
||||||
d.BodySetPosition(Body, npositionX, npositionY, npositionZ);
|
d.BodySetPosition(Body, npositionX, npositionY, npositionZ);
|
||||||
|
@ -789,7 +791,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
qtmp.Z = 0;
|
qtmp.Z = 0;
|
||||||
d.BodySetQuaternion(Body, ref qtmp);
|
d.BodySetQuaternion(Body, ref qtmp);
|
||||||
|
|
||||||
if (m_pidControllerActive == false)
|
if (m_pidControllerActive == false && !m_freemove)
|
||||||
{
|
{
|
||||||
_zeroPosition = localpos;
|
_zeroPosition = localpos;
|
||||||
}
|
}
|
||||||
|
@ -861,6 +863,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
float terrainheight = _parent_scene.GetTerrainHeightAtXY(posch.X, posch.Y);
|
float terrainheight = _parent_scene.GetTerrainHeightAtXY(posch.X, posch.Y);
|
||||||
if (chrminZ < terrainheight)
|
if (chrminZ < terrainheight)
|
||||||
{
|
{
|
||||||
|
m_freemove = false;
|
||||||
float depth = terrainheight - chrminZ;
|
float depth = terrainheight - chrminZ;
|
||||||
if (!flying)
|
if (!flying)
|
||||||
{
|
{
|
||||||
|
@ -896,9 +899,16 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
//******************************************
|
//******************************************
|
||||||
|
|
||||||
|
bool tviszero = (_target_velocity.X == 0.0f && _target_velocity.Y == 0.0f && _target_velocity.Z == 0.0f);
|
||||||
|
|
||||||
|
if(!tviszero || !m_iscolliding)
|
||||||
|
m_freemove = false;
|
||||||
|
|
||||||
|
if (!m_freemove)
|
||||||
|
{
|
||||||
|
|
||||||
// if velocity is zero, use position control; otherwise, velocity control
|
// if velocity is zero, use position control; otherwise, velocity control
|
||||||
if (_target_velocity.X == 0.0f && _target_velocity.Y == 0.0f && _target_velocity.Z == 0.0f
|
if (tviszero && m_iscolliding)
|
||||||
&& m_iscolliding)
|
|
||||||
{
|
{
|
||||||
// keep track of where we stopped. No more slippin' & slidin'
|
// keep track of where we stopped. No more slippin' & slidin'
|
||||||
if (!_zeroFlag)
|
if (!_zeroFlag)
|
||||||
|
@ -924,6 +934,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
m_freemove = false;
|
||||||
m_pidControllerActive = true;
|
m_pidControllerActive = true;
|
||||||
_zeroFlag = false;
|
_zeroFlag = false;
|
||||||
|
|
||||||
|
@ -970,6 +981,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (flying)
|
if (flying)
|
||||||
{
|
{
|
||||||
|
@ -1274,6 +1286,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
{
|
{
|
||||||
_velocity = newmomentum;
|
_velocity = newmomentum;
|
||||||
_target_velocity = Vector3.Zero;
|
_target_velocity = Vector3.Zero;
|
||||||
|
m_freemove = true;
|
||||||
m_pidControllerActive = true;
|
m_pidControllerActive = true;
|
||||||
m_colliderfilter = 0;
|
m_colliderfilter = 0;
|
||||||
m_colliderObjectfilter = 0;
|
m_colliderObjectfilter = 0;
|
||||||
|
|
Loading…
Reference in New Issue