* Mostly ODE update. Things are a bit more behaved then the last experimental update.
parent
205001ab8d
commit
5e36feada2
|
@ -812,7 +812,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_physicsActor == null)
|
if (m_physicsActor == null)
|
||||||
|
{
|
||||||
AddToPhysicalScene();
|
AddToPhysicalScene();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
m_pos += m_parentPosition + new LLVector3(0.0f, 0.0f, 2.0f*m_sitAvatarHeight);
|
m_pos += m_parentPosition + new LLVector3(0.0f, 0.0f, 2.0f*m_sitAvatarHeight);
|
||||||
m_parentPosition = new LLVector3();
|
m_parentPosition = new LLVector3();
|
||||||
|
@ -820,6 +823,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
m_parentID = 0;
|
m_parentID = 0;
|
||||||
SendFullUpdateToAllClients();
|
SendFullUpdateToAllClients();
|
||||||
|
|
||||||
|
if (m_physicsActor != null)
|
||||||
|
{
|
||||||
|
SetHeight(m_avHeight);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetMovementAnimation(Animations.AnimsLLUUID["STAND"], 1);
|
SetMovementAnimation(Animations.AnimsLLUUID["STAND"], 1);
|
||||||
|
|
|
@ -112,11 +112,11 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
if (System.Environment.OSVersion.Platform == PlatformID.Unix)
|
if (System.Environment.OSVersion.Platform == PlatformID.Unix)
|
||||||
{
|
{
|
||||||
m_foundDebian = true;
|
m_foundDebian = true;
|
||||||
m_tensor = 1000000f;
|
m_tensor = 2000000f;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_tensor = 1000000f;
|
m_tensor = 1300000f;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_StandUpRotation =
|
m_StandUpRotation =
|
||||||
|
@ -366,7 +366,17 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
/// <param name="npositionZ"></param>
|
/// <param name="npositionZ"></param>
|
||||||
private void AvatarGeomAndBodyCreation(float npositionX, float npositionY, float npositionZ, float tensor)
|
private void AvatarGeomAndBodyCreation(float npositionX, float npositionY, float npositionZ, float tensor)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (System.Environment.OSVersion.Platform == PlatformID.Unix)
|
||||||
|
{
|
||||||
|
m_foundDebian = true;
|
||||||
|
m_tensor = 2000000f;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_tensor = 550000f;
|
||||||
|
}
|
||||||
|
|
||||||
int dAMotorEuler = 1;
|
int dAMotorEuler = 1;
|
||||||
Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH);
|
Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH);
|
||||||
d.MassSetCapsuleTotal(out ShellMass, m_mass, 2, CAPSULE_RADIUS, CAPSULE_LENGTH);
|
d.MassSetCapsuleTotal(out ShellMass, m_mass, 2, CAPSULE_RADIUS, CAPSULE_LENGTH);
|
||||||
|
@ -561,7 +571,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
// If the PID Controller isn't active then we set our force
|
// If the PID Controller isn't active then we set our force
|
||||||
// calculating base velocity to the current position
|
// calculating base velocity to the current position
|
||||||
|
PID_D = 2200.0f;
|
||||||
|
PID_P = 900.0f;
|
||||||
|
|
||||||
if (m_pidControllerActive == false)
|
if (m_pidControllerActive == false)
|
||||||
{
|
{
|
||||||
|
@ -599,8 +610,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
// Prim to avatar collisions
|
// Prim to avatar collisions
|
||||||
|
|
||||||
d.Vector3 pos = d.BodyGetPosition(Body);
|
d.Vector3 pos = d.BodyGetPosition(Body);
|
||||||
vec.X = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * PID_P;
|
vec.X = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * (PID_P * 2);
|
||||||
vec.Y = (_target_velocity.Y - vel.Y)*(PID_D) + (_zeroPosition.Y - pos.Y)*PID_P;
|
vec.Y = (_target_velocity.Y - vel.Y)*(PID_D) + (_zeroPosition.Y - pos.Y)* (PID_P * 2);
|
||||||
if (flying)
|
if (flying)
|
||||||
{
|
{
|
||||||
vec.Z = (_target_velocity.Z - vel.Z) * (PID_D) + (_zeroPosition.Z - pos.Z) * PID_P;
|
vec.Z = (_target_velocity.Z - vel.Z) * (PID_D) + (_zeroPosition.Z - pos.Z) * PID_P;
|
||||||
|
@ -612,12 +623,25 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
{
|
{
|
||||||
m_pidControllerActive = true;
|
m_pidControllerActive = true;
|
||||||
_zeroFlag = false;
|
_zeroFlag = false;
|
||||||
if (m_iscolliding || flying)
|
if (m_iscolliding && !flying)
|
||||||
{
|
{
|
||||||
// We're flying and colliding with something
|
// We're flying and colliding with something
|
||||||
vec.X = ((_target_velocity.X/movementdivisor) - vel.X)*PID_D;
|
vec.X = ((_target_velocity.X / movementdivisor) - vel.X) * (PID_D);
|
||||||
vec.Y = ((_target_velocity.Y/movementdivisor) - vel.Y)*PID_D;
|
vec.Y = ((_target_velocity.Y / movementdivisor) - vel.Y) * (PID_D);
|
||||||
}
|
}
|
||||||
|
else if (m_iscolliding && flying)
|
||||||
|
{
|
||||||
|
// We're flying and colliding with something
|
||||||
|
vec.X = ((_target_velocity.X/movementdivisor) - vel.X)*(PID_D / 16);
|
||||||
|
vec.Y = ((_target_velocity.Y/movementdivisor) - vel.Y)*(PID_D / 16);
|
||||||
|
}
|
||||||
|
else if (!m_iscolliding && flying)
|
||||||
|
{
|
||||||
|
// We're flying and colliding with something
|
||||||
|
vec.X = ((_target_velocity.X / movementdivisor) - vel.X) * (PID_D/6);
|
||||||
|
vec.Y = ((_target_velocity.Y / movementdivisor) - vel.Y) * (PID_D/6);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_iscolliding && !flying && _target_velocity.Z > 0.0f)
|
if (m_iscolliding && !flying && _target_velocity.Z > 0.0f)
|
||||||
{
|
{
|
||||||
// We're colliding with something and we're not flying but we're moving
|
// We're colliding with something and we're not flying but we're moving
|
||||||
|
|
|
@ -338,7 +338,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
{
|
{
|
||||||
//This is disabled at the moment only because it needs more tweaking
|
//This is disabled at the moment only because it needs more tweaking
|
||||||
//It will eventually be uncommented
|
//It will eventually be uncommented
|
||||||
/*
|
|
||||||
if (contacts[i].depth >= 1.00f)
|
if (contacts[i].depth >= 1.00f)
|
||||||
{
|
{
|
||||||
//MainLog.Instance.Debug("PHYSICS",contacts[i].depth.ToString());
|
//MainLog.Instance.Debug("PHYSICS",contacts[i].depth.ToString());
|
||||||
|
@ -350,6 +350,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
(p1.PhysicsActorType == (int) ActorTypes.Agent &&
|
(p1.PhysicsActorType == (int) ActorTypes.Agent &&
|
||||||
p2.PhysicsActorType == (int) ActorTypes.Prim))
|
p2.PhysicsActorType == (int) ActorTypes.Prim))
|
||||||
{
|
{
|
||||||
|
//contacts[i].depth = contacts[i].depth * 4.15f;
|
||||||
|
/*
|
||||||
if (p2.PhysicsActorType == (int) ActorTypes.Agent)
|
if (p2.PhysicsActorType == (int) ActorTypes.Agent)
|
||||||
{
|
{
|
||||||
p2.CollidingObj = true;
|
p2.CollidingObj = true;
|
||||||
|
@ -380,8 +382,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
//contacts[i].depth = 0.0000000f;
|
//contacts[i].depth = 0.0000000f;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// If you interpenetrate a prim with another prim
|
// If you interpenetrate a prim with another prim
|
||||||
if (p1.PhysicsActorType == (int) ActorTypes.Prim && p2.PhysicsActorType == (int) ActorTypes.Prim)
|
if (p1.PhysicsActorType == (int) ActorTypes.Prim && p2.PhysicsActorType == (int) ActorTypes.Prim)
|
||||||
|
|
Loading…
Reference in New Issue