physics messages sync'ing both ways. Value change not happening
parent
a036426f18
commit
7c6bca1668
|
@ -375,20 +375,24 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
{
|
{
|
||||||
uint localID = data["localID"].AsUInteger();
|
uint localID = data["localID"].AsUInteger();
|
||||||
// m_log.DebugFormat("{0}: HandlPhysUpdateAttributes for {1}", LogHeader, localID);
|
// m_log.DebugFormat("{0}: HandlPhysUpdateAttributes for {1}", LogHeader, localID);
|
||||||
|
PhysicsActor pa = FindPhysicsActor(localID);
|
||||||
|
if (pa != null)
|
||||||
|
{
|
||||||
|
pa.Size = data["size"].AsVector3();
|
||||||
|
pa.Position = data["position"].AsVector3();
|
||||||
|
pa.Force = data["force"].AsVector3();
|
||||||
|
pa.Velocity = data["velocity"].AsVector3();
|
||||||
|
pa.Torque = data["torque"].AsVector3();
|
||||||
|
pa.Orientation = data["orientantion"].AsQuaternion();
|
||||||
|
pa.IsPhysical = data["isPhysical"].AsBoolean(); // receive??
|
||||||
|
pa.Flying = data["flying"].AsBoolean(); // receive??
|
||||||
|
pa.Kinematic = data["kinematic"].AsBoolean(); // receive??
|
||||||
|
pa.Buoyancy = (float)(data["buoyancy"].AsReal());
|
||||||
SceneObjectPart sop = m_validLocalScene.GetSceneObjectPart(localID);
|
SceneObjectPart sop = m_validLocalScene.GetSceneObjectPart(localID);
|
||||||
if (sop != null)
|
if (sop != null)
|
||||||
{
|
{
|
||||||
sop.PhysActor.Size = data["size"].AsVector3();
|
pa.Shape = sop.Shape;
|
||||||
sop.PhysActor.Position = data["position"].AsVector3();
|
}
|
||||||
sop.PhysActor.Force = data["force"].AsVector3();
|
|
||||||
sop.PhysActor.Velocity = data["velocity"].AsVector3();
|
|
||||||
sop.PhysActor.Torque = data["torque"].AsVector3();
|
|
||||||
sop.PhysActor.Orientation = data["orientantion"].AsQuaternion();
|
|
||||||
sop.PhysActor.IsPhysical = data["isPhysical"].AsBoolean(); // receive??
|
|
||||||
sop.PhysActor.Flying = data["flying"].AsBoolean(); // receive??
|
|
||||||
sop.PhysActor.Kinematic = data["kinematic"].AsBoolean(); // receive??
|
|
||||||
sop.PhysActor.Buoyancy = (float)(data["buoyancy"].AsReal());
|
|
||||||
sop.PhysActor.Shape = sop.Shape;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -404,9 +408,25 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Find the physics actor whether it is an object or a scene presence
|
||||||
|
private PhysicsActor FindPhysicsActor(uint localID)
|
||||||
|
{
|
||||||
|
SceneObjectPart sop = m_validLocalScene.GetSceneObjectPart(localID);
|
||||||
|
if (sop != null)
|
||||||
|
{
|
||||||
|
return sop.PhysActor;
|
||||||
|
}
|
||||||
|
ScenePresence sp = m_validLocalScene.GetScenePresence(localID);
|
||||||
|
if (sp != null)
|
||||||
|
{
|
||||||
|
return sp.PhysicsActor;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public void SendPhysUpdateAttributes(PhysicsActor pa)
|
public void SendPhysUpdateAttributes(PhysicsActor pa)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("{0}: SendPhysUpdateAttributes for {1}", LogHeader, pa.LocalID);
|
// m_log.DebugFormat("{0}: SendPhysUpdateAttributes for {1}", LogHeader, pa.LocalID);
|
||||||
OSDMap data = new OSDMap(9);
|
OSDMap data = new OSDMap(9);
|
||||||
data["localID"] = OSD.FromUInteger(pa.LocalID);
|
data["localID"] = OSD.FromUInteger(pa.LocalID);
|
||||||
data["size"] = OSD.FromVector3(pa.Size);
|
data["size"] = OSD.FromVector3(pa.Size);
|
||||||
|
|
|
@ -133,6 +133,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
|
m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
|
||||||
InstallInterfaces();
|
InstallInterfaces();
|
||||||
|
|
||||||
|
SyncStart(null); // fake a 'phys start' to get things going
|
||||||
|
|
||||||
m_log.Warn(LogHeader + " Initialised");
|
m_log.Warn(LogHeader + " Initialised");
|
||||||
|
|
||||||
// collect all the scenes for later routing
|
// collect all the scenes for later routing
|
||||||
|
@ -198,15 +200,28 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsPhysEngineScene
|
bool IPhysEngineToSceneConnectorModule.IsPhysEngineActor()
|
||||||
{
|
{
|
||||||
get { return SceneToPhysEngineSyncServer.IsPhysEngineScene; }
|
return PhysEngineToSceneConnectorModule.IsPhysEngineActorS;
|
||||||
}
|
}
|
||||||
public static bool IsActivePhysEngineScene
|
bool IPhysEngineToSceneConnectorModule.IsPhysEngineScene()
|
||||||
{
|
{
|
||||||
get { return SceneToPhysEngineSyncServer.IsActivePhysEngineScene; }
|
return PhysEngineToSceneConnectorModule.IsPhysEngineSceneS;
|
||||||
}
|
}
|
||||||
public static bool IsPhysEngineActor
|
bool IPhysEngineToSceneConnectorModule.IsActivePhysEngineScene()
|
||||||
|
{
|
||||||
|
return PhysEngineToSceneConnectorModule.IsActivePhysEngineSceneS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsPhysEngineSceneS
|
||||||
|
{
|
||||||
|
get { return SceneToPhysEngineSyncServer.IsPhysEngineScene2S(); }
|
||||||
|
}
|
||||||
|
public static bool IsActivePhysEngineSceneS
|
||||||
|
{
|
||||||
|
get { return SceneToPhysEngineSyncServer.IsActivePhysEngineScene2S(); }
|
||||||
|
}
|
||||||
|
public static bool IsPhysEngineActorS
|
||||||
{
|
{
|
||||||
get { return (m_activeActors != 0); }
|
get { return (m_activeActors != 0); }
|
||||||
}
|
}
|
||||||
|
@ -249,7 +264,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine("RouteUpdate: no SOP found");
|
Console.WriteLine("RouteUpdate: no SOP found for {0}", pa.LocalID);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,6 +307,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
//RegionSyncMessage.HandleSuccess(LogHeader, msg, String.Format("Object \"{0}\" ({1}) ({1}) updated.", sog.Name, sog.UUID.ToString(), sog.LocalId.ToString()));
|
//RegionSyncMessage.HandleSuccess(LogHeader, msg, String.Format("Object \"{0}\" ({1}) ({1}) updated.", sog.Name, sog.UUID.ToString(), sog.LocalId.ToString()));
|
||||||
//else
|
//else
|
||||||
//RegionSyncMessage.HandleSuccess(LogHeader, msg, String.Format("Object \"{0}\" ({1}) ({1}) added.", sog.Name, sog.UUID.ToString(), sog.LocalId.ToString()));
|
//RegionSyncMessage.HandleSuccess(LogHeader, msg, String.Format("Object \"{0}\" ({1}) ({1}) added.", sog.Name, sog.UUID.ToString(), sog.LocalId.ToString()));
|
||||||
|
|
||||||
sog.ScheduleGroupForFullUpdate();
|
sog.ScheduleGroupForFullUpdate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -351,6 +352,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
UUID agentID = data["agentID"].AsUUID();
|
UUID agentID = data["agentID"].AsUUID();
|
||||||
string first = data["first"].AsString();
|
string first = data["first"].AsString();
|
||||||
string last = data["last"].AsString();
|
string last = data["last"].AsString();
|
||||||
|
uint localID = data["localID"].AsUInteger();
|
||||||
Vector3 startPos = data["startPos"].AsVector3();
|
Vector3 startPos = data["startPos"].AsVector3();
|
||||||
if (agentID == null || agentID == UUID.Zero || first == null || last == null || startPos == null)
|
if (agentID == null || agentID == UUID.Zero || first == null || last == null || startPos == null)
|
||||||
{
|
{
|
||||||
|
@ -384,6 +386,12 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sp.IsSyncedAvatar = true;
|
sp.IsSyncedAvatar = true;
|
||||||
|
m_log.DebugFormat("{0}: Setting avatar local ID to {1}", LogHeader, localID);
|
||||||
|
sp.LocalId = localID;
|
||||||
|
if (sp.PhysicsActor != null)
|
||||||
|
{
|
||||||
|
sp.PhysicsActor.LocalID = localID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//RegionSyncMessage.HandlerDebug(LogHeader, msg, String.Format("Added new remote avatar \"{0}\" ({1})", first + " " + last, agentID));
|
//RegionSyncMessage.HandlerDebug(LogHeader, msg, String.Format("Added new remote avatar \"{0}\" ({1})", first + " " + last, agentID));
|
||||||
RegionSyncMessage.HandleSuccess(LogHeader, msg, String.Format("Added new remote avatar \"{0}\" ({1})", first + " " + last, agentID));
|
RegionSyncMessage.HandleSuccess(LogHeader, msg, String.Format("Added new remote avatar \"{0}\" ({1})", first + " " + last, agentID));
|
||||||
|
|
|
@ -331,6 +331,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
// Let the client managers know about this avatar
|
// Let the client managers know about this avatar
|
||||||
OSDMap data = new OSDMap(1);
|
OSDMap data = new OSDMap(1);
|
||||||
data["agentID"] = OSD.FromUUID(presence.ControllingClient.AgentId);
|
data["agentID"] = OSD.FromUUID(presence.ControllingClient.AgentId);
|
||||||
|
data["localID"] = OSD.FromUInteger(presence.LocalId);
|
||||||
data["first"] = OSD.FromString(presence.ControllingClient.FirstName);
|
data["first"] = OSD.FromString(presence.ControllingClient.FirstName);
|
||||||
data["last"] = OSD.FromString(presence.ControllingClient.LastName);
|
data["last"] = OSD.FromString(presence.ControllingClient.LastName);
|
||||||
data["startPos"] = OSD.FromVector3(presence.ControllingClient.StartPos);
|
data["startPos"] = OSD.FromVector3(presence.ControllingClient.StartPos);
|
||||||
|
|
|
@ -701,6 +701,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
// Let the client managers know that a new agent has connected
|
// Let the client managers know that a new agent has connected
|
||||||
OSDMap data = new OSDMap(1);
|
OSDMap data = new OSDMap(1);
|
||||||
data["agentID"] = OSD.FromUUID(client.AgentId);
|
data["agentID"] = OSD.FromUUID(client.AgentId);
|
||||||
|
data["localID"] = OSD.FromUInteger(m_scene.GetScenePresence(client.AgentId).LocalId);
|
||||||
data["first"] = OSD.FromString(client.FirstName);
|
data["first"] = OSD.FromString(client.FirstName);
|
||||||
data["last"] = OSD.FromString(client.LastName);
|
data["last"] = OSD.FromString(client.LastName);
|
||||||
data["startPos"] = OSD.FromVector3(client.StartPos);
|
data["startPos"] = OSD.FromVector3(client.StartPos);
|
||||||
|
|
|
@ -318,20 +318,20 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
uint localID = data["localID"].AsUInteger();
|
uint localID = data["localID"].AsUInteger();
|
||||||
m_log.DebugFormat("{0}: received PhysUpdateAttributes for {1}", LogHeader, localID);
|
// m_log.DebugFormat("{0}: received PhysUpdateAttributes for {1}", LogHeader, localID);
|
||||||
SceneObjectPart sop = m_scene.GetSceneObjectPart(localID);
|
PhysicsActor pa = FindPhysicsActor(localID);
|
||||||
if (sop != null)
|
if (pa != null)
|
||||||
{
|
{
|
||||||
sop.PhysActor.Size = data["size"].AsVector3();
|
pa.Size = data["size"].AsVector3();
|
||||||
sop.PhysActor.Position = data["position"].AsVector3();
|
pa.Position = data["position"].AsVector3();
|
||||||
sop.PhysActor.Force = data["force"].AsVector3();
|
pa.Force = data["force"].AsVector3();
|
||||||
sop.PhysActor.Velocity = data["velocity"].AsVector3();
|
pa.Velocity = data["velocity"].AsVector3();
|
||||||
sop.PhysActor.Torque = data["torque"].AsVector3();
|
pa.Torque = data["torque"].AsVector3();
|
||||||
sop.PhysActor.Orientation = data["orientantion"].AsQuaternion();
|
pa.Orientation = data["orientantion"].AsQuaternion();
|
||||||
sop.PhysActor.IsPhysical = data["isPhysical"].AsBoolean(); // receive??
|
pa.IsPhysical = data["isPhysical"].AsBoolean(); // receive??
|
||||||
sop.PhysActor.Flying = data["flying"].AsBoolean(); // receive??
|
pa.Flying = data["flying"].AsBoolean(); // receive??
|
||||||
sop.PhysActor.Kinematic = data["kinematic"].AsBoolean(); // receive??
|
pa.Kinematic = data["kinematic"].AsBoolean(); // receive??
|
||||||
sop.PhysActor.Buoyancy = (float)(data["buoyancy"].AsReal());
|
pa.Buoyancy = (float)(data["buoyancy"].AsReal());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -347,6 +347,22 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Find the physics actor whether it is an object or a scene presence
|
||||||
|
private PhysicsActor FindPhysicsActor(uint localID)
|
||||||
|
{
|
||||||
|
SceneObjectPart sop = m_scene.GetSceneObjectPart(localID);
|
||||||
|
if (sop != null)
|
||||||
|
{
|
||||||
|
return sop.PhysActor;
|
||||||
|
}
|
||||||
|
ScenePresence sp = m_scene.GetScenePresence(localID);
|
||||||
|
if (sp != null)
|
||||||
|
{
|
||||||
|
return sp.PhysicsActor;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public void SendPhysUpdateAttributes(PhysicsActor pa)
|
public void SendPhysUpdateAttributes(PhysicsActor pa)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("{0}: sending PhysUpdateAttributes for {1}", LogHeader, pa.LocalID);
|
// m_log.DebugFormat("{0}: sending PhysUpdateAttributes for {1}", LogHeader, pa.LocalID);
|
||||||
|
|
|
@ -182,19 +182,23 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// Check if any of the client views are in a connected state
|
// Check if any of the client views are in a connected state
|
||||||
|
public bool IsPhysEngineScene() { return SceneToPhysEngineSyncServer.IsPhysEngineScene2S(); }
|
||||||
|
public bool IsActivePhysEngineScene() { return SceneToPhysEngineSyncServer.IsActivePhysEngineScene2S(); }
|
||||||
|
public bool IsPhysEngineActor() { return SceneToPhysEngineSyncServer.IsPhysEngineActorS; }
|
||||||
|
|
||||||
public bool Synced
|
public bool Synced
|
||||||
{
|
{
|
||||||
get { return (m_physEngineConnectors.Count > 0); }
|
get { return (m_physEngineConnectors.Count > 0); }
|
||||||
}
|
}
|
||||||
public static bool IsPhysEngineScene
|
public static bool IsPhysEngineSceneS
|
||||||
{
|
{
|
||||||
get { return (SceneToPhysEngineSyncServer.m_syncServerInitialized > 0); }
|
get { return (SceneToPhysEngineSyncServer.m_syncServerInitialized > 0); }
|
||||||
}
|
}
|
||||||
public static bool IsPhysEngineScene2()
|
public static bool IsPhysEngineScene2S()
|
||||||
{
|
{
|
||||||
return (SceneToPhysEngineSyncServer.m_syncServerInitialized > 0);
|
return (SceneToPhysEngineSyncServer.m_syncServerInitialized > 0);
|
||||||
}
|
}
|
||||||
public static bool IsActivePhysEngineScene
|
public static bool IsActivePhysEngineSceneS
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
System.Console.WriteLine("IsActivePhysEngineScene: si={0} tc={1}",
|
System.Console.WriteLine("IsActivePhysEngineScene: si={0} tc={1}",
|
||||||
|
@ -204,14 +208,14 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
&& SceneToPhysEngineSyncServer.m_totalConnections > 0);
|
&& SceneToPhysEngineSyncServer.m_totalConnections > 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static bool IsActivePhysEngineScene2()
|
public static bool IsActivePhysEngineScene2S()
|
||||||
{
|
{
|
||||||
return (SceneToPhysEngineSyncServer.m_syncServerInitialized > 0
|
return (SceneToPhysEngineSyncServer.m_syncServerInitialized > 0
|
||||||
&& SceneToPhysEngineSyncServer.m_totalConnections > 0);
|
&& SceneToPhysEngineSyncServer.m_totalConnections > 0);
|
||||||
}
|
}
|
||||||
public static bool IsPhysEngineActor
|
public static bool IsPhysEngineActorS
|
||||||
{
|
{
|
||||||
get { return PhysEngineToSceneConnectorModule.IsPhysEngineActor; }
|
get { return PhysEngineToSceneConnectorModule.IsPhysEngineActorS; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -238,6 +242,15 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
s = ss;
|
s = ss;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ScenePresence sp = ss.GetScenePresence(pa.LocalID);
|
||||||
|
if (sp != null)
|
||||||
|
{
|
||||||
|
s = ss;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (s != null)
|
if (s != null)
|
||||||
{
|
{
|
||||||
|
@ -252,7 +265,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine("RouteUpdate: no SOP for update");
|
Console.WriteLine("RouteUpdate: no SOP for update of {0}", pa.LocalID);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,9 +37,9 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
//the interface for Scene to sync with Script Engine
|
//the interface for Scene to sync with Script Engine
|
||||||
public interface IPhysEngineToSceneConnectorModule
|
public interface IPhysEngineToSceneConnectorModule
|
||||||
{
|
{
|
||||||
// static bool IsPhysEngineScene { get; }
|
bool IsPhysEngineScene();
|
||||||
// static bool IsActivePhysEngineScene { get; }
|
bool IsActivePhysEngineScene();
|
||||||
// static bool IsPhysEngineActor { get; }
|
bool IsPhysEngineActor();
|
||||||
bool DebugWithViewer { get; }
|
bool DebugWithViewer { get; }
|
||||||
void SendUpdate(PhysicsActor pa);
|
void SendUpdate(PhysicsActor pa);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,9 +37,9 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
//the interface for Scene to sync with Script Engine
|
//the interface for Scene to sync with Script Engine
|
||||||
public interface ISceneToPhysEngineServer
|
public interface ISceneToPhysEngineServer
|
||||||
{
|
{
|
||||||
// static bool IsPhysEngineScene { get; }
|
bool IsPhysEngineScene();
|
||||||
// static bool IsActivePhysEngineScene { get; }
|
bool IsActivePhysEngineScene();
|
||||||
// static bool IsPhysEngineActor { get; }
|
bool IsPhysEngineActor();
|
||||||
void SendUpdate(PhysicsActor pa);
|
void SendUpdate(PhysicsActor pa);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -427,6 +427,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
set { m_sceneToPhysEngineSyncServer = value; }
|
set { m_sceneToPhysEngineSyncServer = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// depending on what mode we're in, the different modules are available
|
||||||
|
protected bool IsPhysEngineActor()
|
||||||
|
{
|
||||||
|
if (PhysEngineToSceneConnectorModule != null)
|
||||||
|
{
|
||||||
|
return this.PhysEngineToSceneConnectorModule.IsPhysEngineActor();
|
||||||
|
}
|
||||||
|
if (SceneToPhysEngineSyncServer != null)
|
||||||
|
{
|
||||||
|
return this.SceneToPhysEngineSyncServer.IsPhysEngineActor();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
//This function should only be called by an actor who's local Scene is just a cache of the authorative Scene.
|
//This function should only be called by an actor who's local Scene is just a cache of the authorative Scene.
|
||||||
|
@ -1670,7 +1684,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
int tmpPhysicsMS2 = Util.EnvironmentTickCount();
|
int tmpPhysicsMS2 = Util.EnvironmentTickCount();
|
||||||
// Do not simulate physics locally if this is a synced client
|
// Do not simulate physics locally if this is a synced client
|
||||||
if (!IsSyncedClient())
|
if (!IsSyncedClient() || this.IsPhysEngineActor())
|
||||||
{
|
{
|
||||||
if ((m_frame % m_update_physics == 0) && m_physics_enabled)
|
if ((m_frame % m_update_physics == 0) && m_physics_enabled)
|
||||||
m_sceneGraph.UpdatePreparePhysics();
|
m_sceneGraph.UpdatePreparePhysics();
|
||||||
|
@ -1678,7 +1692,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
physicsMS2 = Util.EnvironmentTickCountSubtract(tmpPhysicsMS2);
|
physicsMS2 = Util.EnvironmentTickCountSubtract(tmpPhysicsMS2);
|
||||||
|
|
||||||
// Do not simulate physics locally if this is a synced client
|
// Do not simulate physics locally if this is a synced client
|
||||||
if (!IsSyncedClient())
|
if (!IsSyncedClient() || this.IsPhysEngineActor())
|
||||||
{
|
{
|
||||||
if (m_frame % m_update_entitymovement == 0)
|
if (m_frame % m_update_entitymovement == 0)
|
||||||
m_sceneGraph.UpdateScenePresenceMovement();
|
m_sceneGraph.UpdateScenePresenceMovement();
|
||||||
|
@ -1686,7 +1700,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
int tmpPhysicsMS = Util.EnvironmentTickCount();
|
int tmpPhysicsMS = Util.EnvironmentTickCount();
|
||||||
// Do not simulate physics locally if this is a synced client
|
// Do not simulate physics locally if this is a synced client
|
||||||
if (!IsSyncedClient())
|
if (!IsSyncedClient() || this.IsPhysEngineActor())
|
||||||
{
|
{
|
||||||
if (m_frame % m_update_physics == 0)
|
if (m_frame % m_update_physics == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -121,6 +121,7 @@ namespace OpenSim.Region.Physics.Manager
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public struct PhysActorLastValues
|
public struct PhysActorLastValues
|
||||||
{
|
{
|
||||||
|
public uint updateTime;
|
||||||
public uint localID;
|
public uint localID;
|
||||||
public Vector3 size;
|
public Vector3 size;
|
||||||
public Vector3 position;
|
public Vector3 position;
|
||||||
|
@ -176,7 +177,11 @@ namespace OpenSim.Region.Physics.Manager
|
||||||
public abstract PrimitiveBaseShape Shape { set; }
|
public abstract PrimitiveBaseShape Shape { set; }
|
||||||
|
|
||||||
// RA: used to be abstract but changed to allow 'get' without changing all the phys engines
|
// RA: used to be abstract but changed to allow 'get' without changing all the phys engines
|
||||||
public virtual uint LocalID { set { return; } get { return 0; } }
|
uint m_baseLocalID;
|
||||||
|
public virtual uint LocalID {
|
||||||
|
set { m_baseLocalID = value; }
|
||||||
|
get { return m_baseLocalID; }
|
||||||
|
}
|
||||||
public PhysActorLastValues lastValues;
|
public PhysActorLastValues lastValues;
|
||||||
|
|
||||||
public abstract bool Grabbed { set; }
|
public abstract bool Grabbed { set; }
|
||||||
|
|
|
@ -205,7 +205,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
public override void RequestPhysicsterseUpdate()
|
public override void RequestPhysicsterseUpdate()
|
||||||
{
|
{
|
||||||
if (PhysEngineToSceneConnectorModule.IsPhysEngineActor)
|
if (PhysEngineToSceneConnectorModule.IsPhysEngineActorS)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[ODE CHARACTER]: Sending terse update for {0}", LocalID);
|
m_log.DebugFormat("[ODE CHARACTER]: Sending terse update for {0}", LocalID);
|
||||||
PhysEngineToSceneConnectorModule.RouteUpdate(this);
|
PhysEngineToSceneConnectorModule.RouteUpdate(this);
|
||||||
|
@ -234,6 +234,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
public override uint LocalID
|
public override uint LocalID
|
||||||
{
|
{
|
||||||
set { m_localID = value; }
|
set { m_localID = value; }
|
||||||
|
get { return m_localID; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Grabbed
|
public override bool Grabbed
|
||||||
|
@ -1191,6 +1192,11 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
m_hackSentFall = false;
|
m_hackSentFall = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!m_lastUpdateSent)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[ODE CHARACTER] UpdatePositionAndVelocity");
|
||||||
|
this.RequestPhysicsterseUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1357,7 +1363,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
_position.Z = m_taintPosition.Z;
|
_position.Z = m_taintPosition.Z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Console.WriteLine("ODECharacter: ProcessTaints: doing update");
|
||||||
|
this.RequestPhysicsterseUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void AddCollisionFrameTime(int p)
|
internal void AddCollisionFrameTime(int p)
|
||||||
|
|
|
@ -256,8 +256,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
public override void RequestPhysicsterseUpdate()
|
public override void RequestPhysicsterseUpdate()
|
||||||
{
|
{
|
||||||
if (PhysEngineToSceneConnectorModule.IsPhysEngineActor)
|
if (PhysEngineToSceneConnectorModule.IsPhysEngineActorS)
|
||||||
{
|
{
|
||||||
|
if (this.lastValues.Changed(this))
|
||||||
PhysEngineToSceneConnectorModule.RouteUpdate(this);
|
PhysEngineToSceneConnectorModule.RouteUpdate(this);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -283,6 +284,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
set {
|
set {
|
||||||
//m_log.Info("[PHYSICS]: Setting TrackerID: " + value);
|
//m_log.Info("[PHYSICS]: Setting TrackerID: " + value);
|
||||||
m_localID = value; }
|
m_localID = value; }
|
||||||
|
get { return m_localID; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Grabbed
|
public override bool Grabbed
|
||||||
|
@ -2655,7 +2657,7 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
_position = l_position;
|
_position = l_position;
|
||||||
//_parent_scene.remActivePrim(this);
|
//_parent_scene.remActivePrim(this);
|
||||||
if (_parent == null)
|
if (_parent == null)
|
||||||
RequestPhysicsterseUpdate();
|
this.RequestPhysicsterseUpdate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2690,7 +2692,7 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
m_rotationalVelocity.Z = 0;
|
m_rotationalVelocity.Z = 0;
|
||||||
|
|
||||||
if (_parent == null)
|
if (_parent == null)
|
||||||
RequestPhysicsterseUpdate();
|
this.RequestPhysicsterseUpdate();
|
||||||
|
|
||||||
m_throttleUpdates = false;
|
m_throttleUpdates = false;
|
||||||
throttleCounter = 0;
|
throttleCounter = 0;
|
||||||
|
@ -2743,7 +2745,7 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
|
|
||||||
if (_parent == null)
|
if (_parent == null)
|
||||||
{
|
{
|
||||||
RequestPhysicsterseUpdate();
|
this.RequestPhysicsterseUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lastUpdateSent = true;
|
m_lastUpdateSent = true;
|
||||||
|
@ -2755,7 +2757,7 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
{
|
{
|
||||||
if (_parent == null)
|
if (_parent == null)
|
||||||
{
|
{
|
||||||
RequestPhysicsterseUpdate();
|
this.RequestPhysicsterseUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2790,7 +2792,7 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
{
|
{
|
||||||
if (_parent == null)
|
if (_parent == null)
|
||||||
{
|
{
|
||||||
RequestPhysicsterseUpdate();
|
this.RequestPhysicsterseUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -127,7 +127,7 @@ public sealed class PEPrim : PhysicsActor
|
||||||
public override Vector3 Position {
|
public override Vector3 Position {
|
||||||
get { return _position; }
|
get { return _position; }
|
||||||
set { _position = value;
|
set { _position = value;
|
||||||
m_log.Debug("[RPE] PEPrim set Position");
|
// m_log.Debug("[RPE] PEPrim set Position");
|
||||||
Prop.Set(_localID, PropType.Position, _position);
|
Prop.Set(_localID, PropType.Position, _position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ public sealed class PEPrim : PhysicsActor
|
||||||
public override Vector3 Force {
|
public override Vector3 Force {
|
||||||
get { return _force; }
|
get { return _force; }
|
||||||
set { _force = value;
|
set { _force = value;
|
||||||
m_log.Debug("[RPE] PEPrim set Force");
|
// m_log.Debug("[RPE] PEPrim set Force");
|
||||||
Prop.Set(_localID, PropType.Force, _force);
|
Prop.Set(_localID, PropType.Force, _force);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,9 +101,9 @@ public class PEScene : PhysicsScene
|
||||||
public override float Simulate(float timeStep)
|
public override float Simulate(float timeStep)
|
||||||
{
|
{
|
||||||
// if we are a physics engine server, send update information
|
// if we are a physics engine server, send update information
|
||||||
if (SceneToPhysEngineSyncServer.IsPhysEngineScene2())
|
if (SceneToPhysEngineSyncServer.IsPhysEngineScene2S())
|
||||||
{
|
{
|
||||||
if (SceneToPhysEngineSyncServer.IsActivePhysEngineScene2())
|
if (SceneToPhysEngineSyncServer.IsActivePhysEngineScene2S())
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[RPE]: Simulate. p={0}, a={1}", m_prims.Count, m_avatars.Count);
|
// m_log.DebugFormat("[RPE]: Simulate. p={0}, a={1}", m_prims.Count, m_avatars.Count);
|
||||||
foreach (PEPrim prim in m_prims)
|
foreach (PEPrim prim in m_prims)
|
||||||
|
@ -115,10 +115,13 @@ public class PEScene : PhysicsScene
|
||||||
}
|
}
|
||||||
foreach (PECharacter actor in m_avatars)
|
foreach (PECharacter actor in m_avatars)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[RPE]: Simulate. p={0}, a={1}", m_prims.Count, m_avatars.Count);
|
// m_log.DebugFormat("[RPE]: Simulate. p={0}, a={1}", m_prims.Count, m_avatars.Count);
|
||||||
|
if (actor.lastValues.Changed(actor))
|
||||||
|
{
|
||||||
SceneToPhysEngineSyncServer.RouteUpdate(actor);
|
SceneToPhysEngineSyncServer.RouteUpdate(actor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 60f;
|
return 60f;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue