* Coded around another Null packet sent by the packet pool
* Condensed 8 calls to unmanaged code in ODE down to 1afrisby
parent
2259bc8ebf
commit
0e460a81cc
|
@ -293,6 +293,8 @@ namespace OpenSim.Region.ClientStack
|
||||||
//MainLog.Instance.Debug("UDPSERVER", e.ToString());
|
//MainLog.Instance.Debug("UDPSERVER", e.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (packet != null)
|
||||||
|
{
|
||||||
// do we already have a circuit for this endpoint
|
// do we already have a circuit for this endpoint
|
||||||
uint circuit;
|
uint circuit;
|
||||||
if (clientCircuits.TryGetValue(epSender, out circuit))
|
if (clientCircuits.TryGetValue(epSender, out circuit))
|
||||||
|
@ -314,6 +316,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
//CFK: This message seems to have served its usefullness as of 12-15 so I am commenting it out for now
|
//CFK: This message seems to have served its usefullness as of 12-15 so I am commenting it out for now
|
||||||
//m_log.Warn("client", "Got a packet from an invalid client - " + epSender.ToString());
|
//m_log.Warn("client", "Got a packet from an invalid client - " + epSender.ToString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
|
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
{
|
{
|
||||||
private PhysicsVector _position;
|
private PhysicsVector _position;
|
||||||
private d.Vector3 _zeroPosition;
|
private d.Vector3 _zeroPosition;
|
||||||
|
private d.Matrix3 m_StandUpRotation;
|
||||||
private bool _zeroFlag = false;
|
private bool _zeroFlag = false;
|
||||||
private bool m_lastUpdateSent = false;
|
private bool m_lastUpdateSent = false;
|
||||||
private PhysicsVector _velocity;
|
private PhysicsVector _velocity;
|
||||||
|
@ -86,6 +87,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
_acceleration = new PhysicsVector();
|
_acceleration = new PhysicsVector();
|
||||||
_parent_scene = parent_scene;
|
_parent_scene = parent_scene;
|
||||||
|
|
||||||
|
m_StandUpRotation = new d.Matrix3(0.8184158f, -0.5744568f, -0.0139677f, 0.5744615f, 0.8185215f, -0.004074608f, 0.01377355f, -0.004689182f, 0.9998941f);
|
||||||
|
|
||||||
for (int i = 0; i < 11; i++)
|
for (int i = 0; i < 11; i++)
|
||||||
{
|
{
|
||||||
m_colliderarr[i] = false;
|
m_colliderarr[i] = false;
|
||||||
|
@ -100,6 +103,14 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
d.BodySetMass(Body, ref ShellMass);
|
d.BodySetMass(Body, ref ShellMass);
|
||||||
d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
|
d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
|
||||||
d.GeomSetBody(Shell, Body);
|
d.GeomSetBody(Shell, Body);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
d.BodySetRotation(Body, ref m_StandUpRotation);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Amotor = d.JointCreateAMotor(parent_scene.world, IntPtr.Zero);
|
Amotor = d.JointCreateAMotor(parent_scene.world, IntPtr.Zero);
|
||||||
d.JointAttach(Amotor, Body, IntPtr.Zero);
|
d.JointAttach(Amotor, Body, IntPtr.Zero);
|
||||||
d.JointSetAMotorMode(Amotor, dAMotorEuler);
|
d.JointSetAMotorMode(Amotor, dAMotorEuler);
|
||||||
|
@ -117,6 +128,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
d.JointSetAMotorParam(Amotor, 3, 0);
|
d.JointSetAMotorParam(Amotor, 3, 0);
|
||||||
d.JointSetAMotorParam(Amotor, 2, 0);
|
d.JointSetAMotorParam(Amotor, 2, 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
m_name = avName;
|
m_name = avName;
|
||||||
parent_scene.geom_name_map[Shell] = avName;
|
parent_scene.geom_name_map[Shell] = avName;
|
||||||
|
@ -381,16 +394,21 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
d.BodyAddForce(Body, force.X, force.Y, force.Z);
|
d.BodyAddForce(Body, force.X, force.Y, force.Z);
|
||||||
|
|
||||||
// ok -- let's stand up straight!
|
// ok -- let's stand up straight!
|
||||||
d.Vector3 feet;
|
//d.Matrix3 StandUpRotationalMatrix = new d.Matrix3(0.8184158f, -0.5744568f, -0.0139677f, 0.5744615f, 0.8185215f, -0.004074608f, 0.01377355f, -0.004689182f, 0.9998941f);
|
||||||
d.Vector3 head;
|
//d.BodySetRotation(Body, ref StandUpRotationalMatrix);
|
||||||
d.BodyGetRelPointPos(Body, 0.0f, 0.0f, -1.0f, out feet);
|
d.BodySetRotation(Body, ref m_StandUpRotation);
|
||||||
d.BodyGetRelPointPos(Body, 0.0f, 0.0f, 1.0f, out head);
|
// The above matrix was generated with the amazing standup routine below by danX0r *cheer*
|
||||||
float posture = head.Z - feet.Z;
|
//d.Vector3 feet;
|
||||||
|
//d.Vector3 head;
|
||||||
|
//d.BodyGetRelPointPos(Body, 0.0f, 0.0f, -1.0f, out feet);
|
||||||
|
//d.BodyGetRelPointPos(Body, 0.0f, 0.0f, 1.0f, out head);
|
||||||
|
//float posture = head.Z - feet.Z;
|
||||||
|
|
||||||
// restoring force proportional to lack of posture:
|
// restoring force proportional to lack of posture:
|
||||||
float servo = (2.5f - posture) * POSTURE_SERVO;
|
//float servo = (2.5f - posture) * POSTURE_SERVO;
|
||||||
d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, servo, 0.0f, 0.0f, 1.0f);
|
//d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, servo, 0.0f, 0.0f, 1.0f);
|
||||||
d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, -servo, 0.0f, 0.0f, -1.0f);
|
//d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, -servo, 0.0f, 0.0f, -1.0f);
|
||||||
|
|
||||||
//m_lastUpdateSent = false;
|
//m_lastUpdateSent = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue