Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
commit
55a9bbc6ce
|
@ -2315,7 +2315,7 @@ namespace OpenSim.Framework
|
|||
|
||||
// It's possible that the thread won't abort. To make sure the thread pool isn't
|
||||
// depleted, increase the pool size.
|
||||
m_ThreadPool.MaxThreads++;
|
||||
// m_ThreadPool.MaxThreads++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2430,6 +2430,7 @@ namespace OpenSim.Framework
|
|||
long numQueued = Interlocked.Increment(ref numQueuedThreadFuncs);
|
||||
try
|
||||
{
|
||||
/*
|
||||
long numRunning = numRunningThreadFuncs;
|
||||
|
||||
if (m_ThreadPool != null && LogOverloads)
|
||||
|
@ -2462,6 +2463,7 @@ namespace OpenSim.Framework
|
|||
}
|
||||
}
|
||||
else
|
||||
*/
|
||||
{
|
||||
// Since we didn't log "Queue threadfunc", don't log "Run threadfunc" or "End threadfunc" either.
|
||||
// Those log lines aren't useful when we don't know which function is running in the thread.
|
||||
|
|
|
@ -1028,9 +1028,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
// for now viwers do send fixed defaults
|
||||
// but this may change
|
||||
// int physicsShapeType = inner_instance_list["physics_shape_type"].AsInteger();
|
||||
byte physicsShapeType = (byte)PhysShapeType.prim; // default for mesh is simple convex
|
||||
if(hasmesh)
|
||||
physicsShapeType = (byte) PhysShapeType.convex; // default for mesh is simple convex
|
||||
byte physicsShapeType = (byte)PhysShapeType.convex; // default is simple convex
|
||||
// int material = inner_instance_list["material"].AsInteger();
|
||||
byte material = (byte)Material.Wood;
|
||||
|
||||
|
|
|
@ -158,11 +158,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
if (Double.IsNaN(value) || Double.IsInfinity(value))
|
||||
return;
|
||||
if (value < 0)
|
||||
value = 0;
|
||||
else
|
||||
if (value > 655.35)
|
||||
value = 655.35;
|
||||
|
||||
m_terrainData[x, y] = (float)value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -485,13 +485,20 @@ public abstract class BSPhysObject : PhysicsActor
|
|||
CollisionsLastTick = new CollisionEventUpdate();
|
||||
CollisionsLastTickStep = PhysScene.SimulationStep;
|
||||
}
|
||||
|
||||
CollisionsLastTick.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
|
||||
|
||||
// If someone has subscribed for collision events log the collision so it will be reported up
|
||||
if (SubscribedEvents()) {
|
||||
ContactPoint newContact = new ContactPoint(contactPoint, contactNormal, pentrationDepth);
|
||||
|
||||
// make collision sound work just setting a speed
|
||||
// see ubOde
|
||||
newContact.RelativeSpeed = 2.0f;
|
||||
|
||||
lock (PhysScene.CollisionLock)
|
||||
{
|
||||
CollisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
|
||||
CollisionCollection.AddCollider(collidingWith, newContact);
|
||||
}
|
||||
DetailLog("{0},{1}.Collision.AddCollider,call,with={2},point={3},normal={4},depth={5},colliderMoving={6}",
|
||||
LocalID, TypeName, collidingWith, contactPoint, contactNormal, pentrationDepth, ColliderIsMoving);
|
||||
|
|
|
@ -279,7 +279,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
|
|||
|
||||
public override bool IsPhysical
|
||||
{
|
||||
get { return false; }
|
||||
get { return m_isPhysical; }
|
||||
set { return; }
|
||||
}
|
||||
|
||||
|
|
|
@ -125,6 +125,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
|
|||
/// .../opensim/bin/libode-x86_64.so(_Z12dCollideCCTLP6dxGeomS0_iP12dContactGeomi+0x92) [0x7f03b44bcf82]
|
||||
/// </remarks>
|
||||
internal static Object UniversalColliderSyncObject = new Object();
|
||||
internal static Object SimulationLock = new Object();
|
||||
|
||||
/// <summary>
|
||||
/// Is stats collecting enabled for this ODE scene?
|
||||
|
@ -647,7 +648,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
|
|||
physics_logging_interval = physicsconfig.GetInt("physics_logging_interval", 0);
|
||||
physics_logging_append_existing_logfile = physicsconfig.GetBoolean("physics_logging_append_existing_logfile", false);
|
||||
|
||||
m_NINJA_physics_joints_enabled = physicsconfig.GetBoolean("use_NINJA_physics_joints", false);
|
||||
// m_NINJA_physics_joints_enabled = physicsconfig.GetBoolean("use_NINJA_physics_joints", false);
|
||||
minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", 3f);
|
||||
maximumMassObject = physicsconfig.GetFloat("maximum_mass_object", 10000.01f);
|
||||
}
|
||||
|
@ -1441,9 +1442,28 @@ namespace OpenSim.Region.PhysicsModule.ODE
|
|||
obj2LocalID = 0;
|
||||
//ctype = 0;
|
||||
//cStartStop = 0;
|
||||
if (!p2.SubscribedEvents() && !p1.SubscribedEvents())
|
||||
// if (!p2.SubscribedEvents() && !p1.SubscribedEvents())
|
||||
// return;
|
||||
bool p1events = p1.SubscribedEvents();
|
||||
bool p2events = p2.SubscribedEvents();
|
||||
|
||||
if (p1.IsVolumeDtc)
|
||||
p2events = false;
|
||||
if (p2.IsVolumeDtc)
|
||||
p1events = false;
|
||||
|
||||
if (!p2events && !p1events)
|
||||
return;
|
||||
|
||||
Vector3 vel = Vector3.Zero;
|
||||
if (p2 != null && p2.IsPhysical)
|
||||
vel = p2.Velocity;
|
||||
|
||||
if (p1 != null && p1.IsPhysical)
|
||||
vel -= p1.Velocity;
|
||||
|
||||
contact.RelativeSpeed = Vector3.Dot(vel, contact.SurfaceNormal);
|
||||
|
||||
switch ((ActorTypes)p2.PhysicsActorType)
|
||||
{
|
||||
case ActorTypes.Agent:
|
||||
|
@ -2714,6 +2734,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
|
|||
CreateRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks
|
||||
}
|
||||
|
||||
|
||||
lock (OdeLock)
|
||||
{
|
||||
d.AllocateODEDataForThread(~0U);
|
||||
|
@ -2867,6 +2888,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
|
|||
tempTick = tempTick2;
|
||||
}
|
||||
|
||||
lock(SimulationLock)
|
||||
d.WorldQuickStep(world, ODE_STEPSIZE);
|
||||
|
||||
if (CollectStats)
|
||||
|
@ -3377,7 +3399,8 @@ namespace OpenSim.Region.PhysicsModule.ODE
|
|||
[HandleProcessCorruptedStateExceptions]
|
||||
public override void Dispose()
|
||||
{
|
||||
lock (OdeLock)
|
||||
lock(SimulationLock)
|
||||
lock(OdeLock)
|
||||
{
|
||||
if(world == IntPtr.Zero)
|
||||
return;
|
||||
|
@ -3425,7 +3448,6 @@ namespace OpenSim.Region.PhysicsModule.ODE
|
|||
{
|
||||
m_log.ErrorFormat("[ODE SCENE]: exception {0}", e.Message);
|
||||
}
|
||||
//d.CloseODE();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3550,19 +3550,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
m_host.AddScriptLPS(1);
|
||||
|
||||
// Get the normalized vector to the target
|
||||
LSL_Vector d1 = llVecNorm(target - llGetPos());
|
||||
LSL_Vector from = llGetPos();
|
||||
|
||||
// Get the bearing (yaw)
|
||||
LSL_Vector a1 = new LSL_Vector(0,0,0);
|
||||
a1.z = llAtan2(d1.y, d1.x);
|
||||
// normalized direction to target
|
||||
LSL_Vector dir = llVecNorm(target - from);
|
||||
|
||||
// Get the elevation (pitch)
|
||||
LSL_Vector a2 = new LSL_Vector(0,0,0);
|
||||
a2.y= -llAtan2(d1.z, llSqrt((d1.x * d1.x) + (d1.y * d1.y)));
|
||||
// use vertical to help compute left axis
|
||||
// LSL_Vector up = new LSL_Vector(0.0, 0.0, 1.0);
|
||||
// find normalized left axis parallel to horizon
|
||||
// LSL_Vector left = llVecNorm(LSL_Vector.Cross(up, dir));
|
||||
|
||||
LSL_Rotation r1 = llEuler2Rot(a1);
|
||||
LSL_Rotation r2 = llEuler2Rot(a2);
|
||||
LSL_Rotation r3 = new LSL_Rotation(0.000000, 0.707107, 0.000000, 0.707107);
|
||||
LSL_Vector left = new LSL_Vector(-dir.y, dir.x, 0.0f);
|
||||
left = llVecNorm(left);
|
||||
// make up orthogonal to left and dir
|
||||
LSL_Vector up = LSL_Vector.Cross(dir, left);
|
||||
|
||||
// compute rotation based on orthogonal axes
|
||||
// and rotate so Z points to target with X below horizont
|
||||
LSL_Rotation rot = new LSL_Rotation(0.0, 0.707107, 0.0, 0.707107) * llAxes2Rot(dir, left, up);
|
||||
|
||||
if (m_host.PhysActor == null || !m_host.PhysActor.IsPhysical)
|
||||
{
|
||||
|
@ -3570,17 +3575,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
if (strength <= 0.0 || damping <= 0.0)
|
||||
return;
|
||||
|
||||
llSetRot(r3 * r2 * r1);
|
||||
llSetRot(rot);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strength == 0)
|
||||
{
|
||||
llSetRot(r3 * r2 * r1);
|
||||
llSetRot(rot);
|
||||
return;
|
||||
}
|
||||
|
||||
m_host.StartLookAt((Quaternion)(r3 * r2 * r1), (float)strength, (float)damping);
|
||||
m_host.StartLookAt(rot, (float)strength, (float)damping);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -871,6 +871,9 @@
|
|||
;; Time a thread must be idle (in seconds) before it dies
|
||||
; IdleTimeout = 60
|
||||
|
||||
;; llSetTimerEvent minimum value. Default 0.5s, 0.05s whould be more resonable
|
||||
; MinTimerInterval = 0.5
|
||||
|
||||
;# {Priority} {Enabled:true} {Priority for script engine threads?} {Lowest BelowNormal Normal AboveNormal Highest} BelowNormal
|
||||
;; Thread priority ("Lowest", "BelowNormal", "Normal", "AboveNormal",
|
||||
;; "Highest")
|
||||
|
|
Loading…
Reference in New Issue