Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
commit
2e2634896d
|
@ -89,6 +89,7 @@ what it is today.
|
||||||
* Fernando Oliveira
|
* Fernando Oliveira
|
||||||
* Fly-Man
|
* Fly-Man
|
||||||
* Flyte Xevious
|
* Flyte Xevious
|
||||||
|
* Garmin Kawaguichi
|
||||||
* Imaze Rhiano
|
* Imaze Rhiano
|
||||||
* Intimidated
|
* Intimidated
|
||||||
* Jeremy Bongio (IBM)
|
* Jeremy Bongio (IBM)
|
||||||
|
|
|
@ -1197,8 +1197,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||||
saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer");
|
saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer");
|
||||||
saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file",
|
saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file",
|
||||||
"Integer");
|
"Integer");
|
||||||
saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first section on the file",
|
|
||||||
"Integer");
|
|
||||||
saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first tile on the file\n"
|
saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first tile on the file\n"
|
||||||
+ "= Example =\n"
|
+ "= Example =\n"
|
||||||
+ "To save a PNG file for a set of map tiles 2 regions wide and 3 regions high from map co-ordinate (9910,10234)\n"
|
+ "To save a PNG file for a set of map tiles 2 regions wide and 3 regions high from map co-ordinate (9910,10234)\n"
|
||||||
|
|
|
@ -426,6 +426,8 @@ public class BSCharacter : PhysicsActor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Called by the scene when a collision with this object is reported
|
||||||
|
CollisionEventUpdate collisionCollection = null;
|
||||||
public void Collide(uint collidingWith, ActorTypes type, Vector3 contactPoint, Vector3 contactNormal, float pentrationDepth)
|
public void Collide(uint collidingWith, ActorTypes type, Vector3 contactPoint, Vector3 contactNormal, float pentrationDepth)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith);
|
// m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith);
|
||||||
|
@ -443,10 +445,24 @@ public class BSCharacter : PhysicsActor
|
||||||
if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return;
|
if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return;
|
||||||
_lastCollisionTime = nowTime;
|
_lastCollisionTime = nowTime;
|
||||||
|
|
||||||
Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>();
|
if (collisionCollection == null)
|
||||||
contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
|
collisionCollection = new CollisionEventUpdate();
|
||||||
CollisionEventUpdate args = new CollisionEventUpdate(contactPoints);
|
collisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
|
||||||
base.SendCollisionUpdate(args);
|
}
|
||||||
|
|
||||||
|
public void SendCollisions()
|
||||||
|
{
|
||||||
|
// if (collisionCollection != null)
|
||||||
|
// {
|
||||||
|
// base.SendCollisionUpdate(collisionCollection);
|
||||||
|
// collisionCollection = null;
|
||||||
|
// }
|
||||||
|
// Kludge to make a collision call even if there are no collisions.
|
||||||
|
// This causes the avatar animation to get updated.
|
||||||
|
if (collisionCollection == null)
|
||||||
|
collisionCollection = new CollisionEventUpdate();
|
||||||
|
base.SendCollisionUpdate(collisionCollection);
|
||||||
|
collisionCollection = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1326,6 +1326,7 @@ public sealed class BSPrim : PhysicsActor
|
||||||
}
|
}
|
||||||
|
|
||||||
// I've collided with something
|
// I've collided with something
|
||||||
|
CollisionEventUpdate collisionCollection = null;
|
||||||
public void Collide(uint collidingWith, ActorTypes type, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth)
|
public void Collide(uint collidingWith, ActorTypes type, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith);
|
// m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith);
|
||||||
|
@ -1343,11 +1344,18 @@ public sealed class BSPrim : PhysicsActor
|
||||||
if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return;
|
if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return;
|
||||||
_lastCollisionTime = nowTime;
|
_lastCollisionTime = nowTime;
|
||||||
|
|
||||||
// create the event for the collision
|
if (collisionCollection == null)
|
||||||
Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>();
|
collisionCollection = new CollisionEventUpdate();
|
||||||
contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
|
collisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
|
||||||
CollisionEventUpdate args = new CollisionEventUpdate(contactPoints);
|
}
|
||||||
base.SendCollisionUpdate(args);
|
|
||||||
|
public void SendCollisions()
|
||||||
|
{
|
||||||
|
if (collisionCollection != null)
|
||||||
|
{
|
||||||
|
base.SendCollisionUpdate(collisionCollection);
|
||||||
|
collisionCollection = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,8 @@ public class BSScene : PhysicsScene, IPhysicsParameters
|
||||||
|
|
||||||
private Dictionary<uint, BSCharacter> m_avatars = new Dictionary<uint, BSCharacter>();
|
private Dictionary<uint, BSCharacter> m_avatars = new Dictionary<uint, BSCharacter>();
|
||||||
private Dictionary<uint, BSPrim> m_prims = new Dictionary<uint, BSPrim>();
|
private Dictionary<uint, BSPrim> m_prims = new Dictionary<uint, BSPrim>();
|
||||||
|
private HashSet<BSCharacter> m_avatarsWithCollisions = new HashSet<BSCharacter>();
|
||||||
|
private HashSet<BSPrim> m_primsWithCollisions = new HashSet<BSPrim>();
|
||||||
private List<BSPrim> m_vehicles = new List<BSPrim>();
|
private List<BSPrim> m_vehicles = new List<BSPrim>();
|
||||||
private float[] m_heightMap;
|
private float[] m_heightMap;
|
||||||
private float m_waterLevel;
|
private float m_waterLevel;
|
||||||
|
@ -435,6 +437,17 @@ public class BSScene : PhysicsScene, IPhysicsParameters
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The SendCollision's batch up the collisions on the objects. Now push the collisions into the simulator.
|
||||||
|
foreach (BSPrim bsp in m_primsWithCollisions)
|
||||||
|
bsp.SendCollisions();
|
||||||
|
m_primsWithCollisions.Clear();
|
||||||
|
// foreach (BSCharacter bsc in m_avatarsWithCollisions)
|
||||||
|
// bsc.SendCollisions();
|
||||||
|
// This is a kludge to get avatar movement updated. ODE sends collisions even if there isn't any
|
||||||
|
foreach (KeyValuePair<uint, BSCharacter> kvp in m_avatars)
|
||||||
|
kvp.Value.SendCollisions();
|
||||||
|
m_avatarsWithCollisions.Clear();
|
||||||
|
|
||||||
// If any of the objects had updated properties, tell the object it has been changed by the physics engine
|
// If any of the objects had updated properties, tell the object it has been changed by the physics engine
|
||||||
if (updatedEntityCount > 0)
|
if (updatedEntityCount > 0)
|
||||||
{
|
{
|
||||||
|
@ -485,11 +498,13 @@ public class BSScene : PhysicsScene, IPhysicsParameters
|
||||||
BSPrim prim;
|
BSPrim prim;
|
||||||
if (m_prims.TryGetValue(localID, out prim)) {
|
if (m_prims.TryGetValue(localID, out prim)) {
|
||||||
prim.Collide(collidingWith, type, collidePoint, collideNormal, penitration);
|
prim.Collide(collidingWith, type, collidePoint, collideNormal, penitration);
|
||||||
|
m_primsWithCollisions.Add(prim);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BSCharacter actor;
|
BSCharacter actor;
|
||||||
if (m_avatars.TryGetValue(localID, out actor)) {
|
if (m_avatars.TryGetValue(localID, out actor)) {
|
||||||
actor.Collide(collidingWith, type, collidePoint, collideNormal, penitration);
|
actor.Collide(collidingWith, type, collidePoint, collideNormal, penitration);
|
||||||
|
m_avatarsWithCollisions.Add(actor);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -864,8 +864,9 @@
|
||||||
CcdMotionThreshold = 0.0
|
CcdMotionThreshold = 0.0
|
||||||
CcdSweptSphereRadius = 0.0
|
CcdSweptSphereRadius = 0.0
|
||||||
ContactProcessingThreshold = 0.1
|
ContactProcessingThreshold = 0.1
|
||||||
|
; If setting a pool size, also disable dynamic allocation (default pool size is 4096 with dynamic alloc)
|
||||||
MaxPersistantManifoldPoolSize = 0;
|
MaxPersistantManifoldPoolSize = 0;
|
||||||
ShouldDisableContactPoolDynamicAllocation = True;
|
ShouldDisableContactPoolDynamicAllocation = False;
|
||||||
ShouldForceUpdateAllAabbs = False;
|
ShouldForceUpdateAllAabbs = False;
|
||||||
ShouldRandomizeSolverOrder = False;
|
ShouldRandomizeSolverOrder = False;
|
||||||
ShouldSplitSimulationIslands = False;
|
ShouldSplitSimulationIslands = False;
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue