Merge branch 'avination'
commit
9129a0cce4
|
@ -1673,16 +1673,25 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
Hashtable responseData = (Hashtable)response.Value;
|
Hashtable responseData = (Hashtable)response.Value;
|
||||||
Hashtable requestData = (Hashtable)request.Params[0];
|
Hashtable requestData = (Hashtable)request.Params[0];
|
||||||
|
|
||||||
|
int flags = 0;
|
||||||
|
string text = String.Empty;
|
||||||
|
int health = 0;
|
||||||
responseData["success"] = true;
|
responseData["success"] = true;
|
||||||
|
|
||||||
CheckRegionParams(requestData, responseData);
|
CheckRegionParams(requestData, responseData);
|
||||||
|
|
||||||
Scene scene = null;
|
Scene scene = null;
|
||||||
GetSceneFromRegionParams(requestData, responseData, out scene);
|
try
|
||||||
|
{
|
||||||
|
GetSceneFromRegionParams(requestData, responseData, out scene);
|
||||||
|
health = scene.GetHealth(out flags, out text);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
responseData["error"] = null;
|
||||||
|
}
|
||||||
|
|
||||||
int flags;
|
responseData["success"] = true;
|
||||||
string text;
|
|
||||||
int health = scene.GetHealth(out flags, out text);
|
|
||||||
responseData["health"] = health;
|
responseData["health"] = health;
|
||||||
responseData["flags"] = flags;
|
responseData["flags"] = flags;
|
||||||
responseData["message"] = text;
|
responseData["message"] = text;
|
||||||
|
|
|
@ -188,6 +188,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public static void PartCollisionSound(SceneObjectPart part, List<CollisionForSoundInfo> collidersinfolist)
|
public static void PartCollisionSound(SceneObjectPart part, List<CollisionForSoundInfo> collidersinfolist)
|
||||||
{
|
{
|
||||||
|
// disable for now
|
||||||
|
return;
|
||||||
|
|
||||||
if (collidersinfolist.Count == 0 || part == null)
|
if (collidersinfolist.Count == 0 || part == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -296,7 +299,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AvatarCollisionSound(ScenePresence av, List<CollisionForSoundInfo> collidersinfolist)
|
public static void AvatarCollisionSound(ScenePresence av, List<CollisionForSoundInfo> collidersinfolist)
|
||||||
{
|
{
|
||||||
|
// disable for now
|
||||||
|
return;
|
||||||
|
|
||||||
if (collidersinfolist.Count == 0 || av == null)
|
if (collidersinfolist.Count == 0 || av == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -368,4 +374,4 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -53,12 +53,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
get { return m_instance; }
|
get { return m_instance; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly List<Scene> m_localScenes = new List<Scene>();
|
private readonly DoubleDictionary<UUID, string, Scene> m_localScenes = new DoubleDictionary<UUID, string, Scene>();
|
||||||
private Scene m_currentScene = null;
|
private Scene m_currentScene = null;
|
||||||
|
|
||||||
public List<Scene> Scenes
|
public List<Scene> Scenes
|
||||||
{
|
{
|
||||||
get { return new List<Scene>(m_localScenes); }
|
get { return new List<Scene>(m_localScenes.FindAll(delegate(Scene s) { return true; })); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public Scene CurrentScene
|
public Scene CurrentScene
|
||||||
|
@ -72,13 +72,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
if (m_currentScene == null)
|
if (m_currentScene == null)
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
List<Scene> sceneList = Scenes;
|
||||||
{
|
if (sceneList.Count == 0)
|
||||||
if (m_localScenes.Count > 0)
|
return null;
|
||||||
return m_localScenes[0];
|
return sceneList[0];
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -90,7 +87,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public SceneManager()
|
public SceneManager()
|
||||||
{
|
{
|
||||||
m_instance = this;
|
m_instance = this;
|
||||||
m_localScenes = new List<Scene>();
|
m_localScenes = new DoubleDictionary<UUID, string, Scene>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
|
@ -98,20 +95,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// collect known shared modules in sharedModules
|
// collect known shared modules in sharedModules
|
||||||
Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>();
|
Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>();
|
||||||
|
|
||||||
lock (m_localScenes)
|
List<Scene> sceneList = Scenes;
|
||||||
|
for (int i = 0; i < sceneList.Count; i++)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_localScenes.Count; i++)
|
// extract known shared modules from scene
|
||||||
|
foreach (string k in sceneList[i].Modules.Keys)
|
||||||
{
|
{
|
||||||
// extract known shared modules from scene
|
if (sceneList[i].Modules[k].IsSharedModule &&
|
||||||
foreach (string k in m_localScenes[i].Modules.Keys)
|
!sharedModules.ContainsKey(k))
|
||||||
{
|
sharedModules[k] = sceneList[i].Modules[k];
|
||||||
if (m_localScenes[i].Modules[k].IsSharedModule &&
|
|
||||||
!sharedModules.ContainsKey(k))
|
|
||||||
sharedModules[k] = m_localScenes[i].Modules[k];
|
|
||||||
}
|
|
||||||
// close scene/region
|
|
||||||
m_localScenes[i].Close();
|
|
||||||
}
|
}
|
||||||
|
// close scene/region
|
||||||
|
sceneList[i].Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
// all regions/scenes are now closed, we can now safely
|
// all regions/scenes are now closed, we can now safely
|
||||||
|
@ -120,31 +115,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
mod.Close();
|
mod.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_localScenes.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Close(Scene cscene)
|
public void Close(Scene cscene)
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
if (!m_localScenes.ContainsKey(cscene.RegionInfo.RegionID))
|
||||||
{
|
return;
|
||||||
if (m_localScenes.Contains(cscene))
|
cscene.Close();
|
||||||
{
|
|
||||||
for (int i = 0; i < m_localScenes.Count; i++)
|
|
||||||
{
|
|
||||||
if (m_localScenes[i].Equals(cscene))
|
|
||||||
{
|
|
||||||
m_localScenes[i].Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Add(Scene scene)
|
public void Add(Scene scene)
|
||||||
{
|
{
|
||||||
scene.OnRestart += HandleRestart;
|
scene.OnRestart += HandleRestart;
|
||||||
|
|
||||||
lock (m_localScenes)
|
m_localScenes.Add(scene.RegionInfo.RegionID, scene.RegionInfo.RegionName, scene);
|
||||||
m_localScenes.Add(scene);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HandleRestart(RegionInfo rdata)
|
public void HandleRestart(RegionInfo rdata)
|
||||||
|
@ -152,24 +138,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_log.Error("[SCENEMANAGER]: Got Restart message for region:" + rdata.RegionName + " Sending up to main");
|
m_log.Error("[SCENEMANAGER]: Got Restart message for region:" + rdata.RegionName + " Sending up to main");
|
||||||
int RegionSceneElement = -1;
|
int RegionSceneElement = -1;
|
||||||
|
|
||||||
lock (m_localScenes)
|
m_localScenes.Remove(rdata.RegionID);
|
||||||
{
|
|
||||||
for (int i = 0; i < m_localScenes.Count; i++)
|
|
||||||
{
|
|
||||||
if (rdata.RegionName == m_localScenes[i].RegionInfo.RegionName)
|
|
||||||
{
|
|
||||||
RegionSceneElement = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now we make sure the region is no longer known about by the SceneManager
|
|
||||||
// Prevents duplicates.
|
|
||||||
|
|
||||||
if (RegionSceneElement >= 0)
|
|
||||||
{
|
|
||||||
m_localScenes.RemoveAt(RegionSceneElement);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send signal to main that we're restarting this sim.
|
// Send signal to main that we're restarting this sim.
|
||||||
OnRestartSim(rdata);
|
OnRestartSim(rdata);
|
||||||
|
@ -179,32 +148,29 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
RegionInfo Result = null;
|
RegionInfo Result = null;
|
||||||
|
|
||||||
lock (m_localScenes)
|
Scene s = m_localScenes.FindValue(delegate(Scene x)
|
||||||
|
{
|
||||||
|
if (x.RegionInfo.RegionHandle == regionHandle)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (s != null)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_localScenes.Count; i++)
|
List<Scene> sceneList = Scenes;
|
||||||
|
|
||||||
|
for (int i = 0; i < sceneList.Count; i++)
|
||||||
{
|
{
|
||||||
if (m_localScenes[i].RegionInfo.RegionHandle == regionHandle)
|
if (sceneList[i]!= s)
|
||||||
{
|
{
|
||||||
// Inform other regions to tell their avatar about me
|
// Inform other regions to tell their avatar about me
|
||||||
Result = m_localScenes[i].RegionInfo;
|
//sceneList[i].OtherRegionUp(Result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (Result != null)
|
else
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_localScenes.Count; i++)
|
m_log.Error("[REGION]: Unable to notify Other regions of this Region coming up");
|
||||||
{
|
|
||||||
if (m_localScenes[i].RegionInfo.RegionHandle != regionHandle)
|
|
||||||
{
|
|
||||||
// Inform other regions to tell their avatar about me
|
|
||||||
//m_localScenes[i].OtherRegionUp(Result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_log.Error("[REGION]: Unable to notify Other regions of this Region coming up");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,8 +274,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
if (m_currentScene == null)
|
if (m_currentScene == null)
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
List<Scene> sceneList = Scenes;
|
||||||
m_localScenes.ForEach(func);
|
sceneList.ForEach(func);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -338,16 +304,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
Scene s;
|
||||||
|
|
||||||
|
if (m_localScenes.TryGetValue(regionName, out s))
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_localScenes)
|
m_currentScene = s;
|
||||||
{
|
return true;
|
||||||
if (String.Compare(scene.RegionInfo.RegionName, regionName, true) == 0)
|
|
||||||
{
|
|
||||||
m_currentScene = scene;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -358,16 +320,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
// m_log.Debug("Searching for Region: '" + regionID + "'");
|
// m_log.Debug("Searching for Region: '" + regionID + "'");
|
||||||
|
|
||||||
lock (m_localScenes)
|
Scene s;
|
||||||
|
|
||||||
|
if (m_localScenes.TryGetValue(regionID, out s))
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_localScenes)
|
m_currentScene = s;
|
||||||
{
|
return true;
|
||||||
if (scene.RegionInfo.RegionID == regionID)
|
|
||||||
{
|
|
||||||
m_currentScene = scene;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -375,52 +333,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public bool TryGetScene(string regionName, out Scene scene)
|
public bool TryGetScene(string regionName, out Scene scene)
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
return m_localScenes.TryGetValue(regionName, out scene);
|
||||||
{
|
|
||||||
foreach (Scene mscene in m_localScenes)
|
|
||||||
{
|
|
||||||
if (String.Compare(mscene.RegionInfo.RegionName, regionName, true) == 0)
|
|
||||||
{
|
|
||||||
scene = mscene;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
scene = null;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGetScene(UUID regionID, out Scene scene)
|
public bool TryGetScene(UUID regionID, out Scene scene)
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
return m_localScenes.TryGetValue(regionID, out scene);
|
||||||
{
|
|
||||||
foreach (Scene mscene in m_localScenes)
|
|
||||||
{
|
|
||||||
if (mscene.RegionInfo.RegionID == regionID)
|
|
||||||
{
|
|
||||||
scene = mscene;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
scene = null;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGetScene(uint locX, uint locY, out Scene scene)
|
public bool TryGetScene(uint locX, uint locY, out Scene scene)
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
List<Scene> sceneList = Scenes;
|
||||||
|
foreach (Scene mscene in sceneList)
|
||||||
{
|
{
|
||||||
foreach (Scene mscene in m_localScenes)
|
if (mscene.RegionInfo.RegionLocX == locX &&
|
||||||
|
mscene.RegionInfo.RegionLocY == locY)
|
||||||
{
|
{
|
||||||
if (mscene.RegionInfo.RegionLocX == locX &&
|
scene = mscene;
|
||||||
mscene.RegionInfo.RegionLocY == locY)
|
return true;
|
||||||
{
|
|
||||||
scene = mscene;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -430,16 +360,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public bool TryGetScene(IPEndPoint ipEndPoint, out Scene scene)
|
public bool TryGetScene(IPEndPoint ipEndPoint, out Scene scene)
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
List<Scene> sceneList = Scenes;
|
||||||
|
foreach (Scene mscene in sceneList)
|
||||||
{
|
{
|
||||||
foreach (Scene mscene in m_localScenes)
|
if ((mscene.RegionInfo.InternalEndPoint.Equals(ipEndPoint.Address)) &&
|
||||||
|
(mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port))
|
||||||
{
|
{
|
||||||
if ((mscene.RegionInfo.InternalEndPoint.Equals(ipEndPoint.Address)) &&
|
scene = mscene;
|
||||||
(mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port))
|
return true;
|
||||||
{
|
|
||||||
scene = mscene;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,15 +432,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public RegionInfo GetRegionInfo(UUID regionID)
|
public RegionInfo GetRegionInfo(UUID regionID)
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
Scene s;
|
||||||
|
if (m_localScenes.TryGetValue(regionID, out s))
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_localScenes)
|
return s.RegionInfo;
|
||||||
{
|
|
||||||
if (scene.RegionInfo.RegionID == regionID)
|
|
||||||
{
|
|
||||||
return scene.RegionInfo;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -530,14 +453,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar)
|
public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar)
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
List<Scene> sceneList = Scenes;
|
||||||
|
foreach (Scene scene in sceneList)
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_localScenes)
|
if (scene.TryGetScenePresence(avatarId, out avatar))
|
||||||
{
|
{
|
||||||
if (scene.TryGetScenePresence(avatarId, out avatar))
|
return true;
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -547,15 +468,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public bool TryGetRootScenePresence(UUID avatarId, out ScenePresence avatar)
|
public bool TryGetRootScenePresence(UUID avatarId, out ScenePresence avatar)
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
List<Scene> sceneList = Scenes;
|
||||||
|
foreach (Scene scene in sceneList)
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_localScenes)
|
avatar = scene.GetScenePresence(avatarId);
|
||||||
{
|
|
||||||
avatar = scene.GetScenePresence(avatarId);
|
|
||||||
|
|
||||||
if (avatar != null && !avatar.IsChildAgent)
|
if (avatar != null && !avatar.IsChildAgent)
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
avatar = null;
|
avatar = null;
|
||||||
|
@ -564,22 +483,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public void CloseScene(Scene scene)
|
public void CloseScene(Scene scene)
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
m_localScenes.Remove(scene.RegionInfo.RegionID);
|
||||||
m_localScenes.Remove(scene);
|
|
||||||
|
|
||||||
scene.Close();
|
scene.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar)
|
public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar)
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
List<Scene> sceneList = Scenes;
|
||||||
|
foreach (Scene scene in sceneList)
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_localScenes)
|
if (scene.TryGetAvatarByName(avatarName, out avatar))
|
||||||
{
|
{
|
||||||
if (scene.TryGetAvatarByName(avatarName, out avatar))
|
return true;
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -589,14 +505,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public bool TryGetRootScenePresenceByName(string firstName, string lastName, out ScenePresence sp)
|
public bool TryGetRootScenePresenceByName(string firstName, string lastName, out ScenePresence sp)
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
List<Scene> sceneList = Scenes;
|
||||||
|
foreach (Scene scene in sceneList)
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_localScenes)
|
sp = scene.GetScenePresence(firstName, lastName);
|
||||||
{
|
if (sp != null && !sp.IsChildAgent)
|
||||||
sp = scene.GetScenePresence(firstName, lastName);
|
return true;
|
||||||
if (sp != null && !sp.IsChildAgent)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sp = null;
|
sp = null;
|
||||||
|
@ -605,8 +519,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public void ForEachScene(Action<Scene> action)
|
public void ForEachScene(Action<Scene> action)
|
||||||
{
|
{
|
||||||
lock (m_localScenes)
|
List<Scene> sceneList = Scenes;
|
||||||
m_localScenes.ForEach(action);
|
sceneList.ForEach(action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -294,6 +294,34 @@ namespace OpenSim.Region.Physics.Manager
|
||||||
public abstract Vector3 GeometricCenter { get; }
|
public abstract Vector3 GeometricCenter { get; }
|
||||||
public abstract Vector3 CenterOfMass { get; }
|
public abstract Vector3 CenterOfMass { get; }
|
||||||
|
|
||||||
|
public virtual Vector3 OOBsize
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
Vector3 s=Size;
|
||||||
|
s.X *=0.5f;
|
||||||
|
s.Y *=0.5f;
|
||||||
|
s.Z *=0.5f;
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Vector3 OOBoffset
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Vector3.Zero;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual float OOBRadiusSQ
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Size.LengthSquared() * 0.25f; // ((0.5^2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Velocity of this actor.
|
/// Velocity of this actor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -429,7 +457,6 @@ namespace OpenSim.Region.Physics.Manager
|
||||||
|
|
||||||
public override void VehicleFloatParam(int param, float value)
|
public override void VehicleFloatParam(int param, float value)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void VehicleVectorParam(int param, Vector3 value)
|
public override void VehicleVectorParam(int param, Vector3 value)
|
||||||
|
|
|
@ -522,29 +522,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//UBit mess
|
|
||||||
/* for later use
|
|
||||||
public override Vector3 PrimOOBsize
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
Vector3 s=Size;
|
|
||||||
s.X *=0.5f;
|
|
||||||
s.Y *=0.5f;
|
|
||||||
s.Z *=0.5f;
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Vector3 PrimOOBoffset
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Vector3.Zero;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
public override PrimitiveBaseShape Shape
|
public override PrimitiveBaseShape Shape
|
||||||
{
|
{
|
||||||
set { return; }
|
set { return; }
|
||||||
|
@ -1345,8 +1322,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
m_iscollidingGround = false;
|
m_iscollidingGround = false;
|
||||||
m_iscollidingObj = false;
|
m_iscollidingObj = false;
|
||||||
|
|
||||||
CollisionEventsThisFrame = new CollisionEventUpdate();
|
CollisionEventsThisFrame.Clear();
|
||||||
m_eventsubscription = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changeForce(Vector3 newForce)
|
private void changeForce(Vector3 newForce)
|
||||||
|
|
|
@ -504,8 +504,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
public override Vector3 PrimOOBsize
|
public override Vector3 OOBsize
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -513,7 +513,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 PrimOOBoffset
|
public override Vector3 OOBoffset
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -521,14 +521,14 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float PrimOOBRadiusSQ
|
public override float OOBRadiusSQ
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return primOOBradiusSQ;
|
return primOOBradiusSQ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
public override PrimitiveBaseShape Shape
|
public override PrimitiveBaseShape Shape
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
|
@ -2562,10 +2562,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
{
|
{
|
||||||
d.Quaternion qtmp;
|
d.Quaternion qtmp;
|
||||||
d.GeomCopyQuaternion(prim_geom, out qtmp);
|
d.GeomCopyQuaternion(prim_geom, out qtmp);
|
||||||
_orientation.W = qtmp.W;
|
|
||||||
_orientation.X = qtmp.X;
|
_orientation.X = qtmp.X;
|
||||||
_orientation.Y = qtmp.Y;
|
_orientation.Y = qtmp.Y;
|
||||||
_orientation.Z = qtmp.Z;
|
_orientation.Z = qtmp.Z;
|
||||||
|
_orientation.W = qtmp.W;
|
||||||
|
|
||||||
d.Vector3 lpos = d.GeomGetPosition(prim_geom);
|
d.Vector3 lpos = d.GeomGetPosition(prim_geom);
|
||||||
_position.X = lpos.X;
|
_position.X = lpos.X;
|
||||||
|
|
|
@ -1006,16 +1006,82 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
else
|
else
|
||||||
|
|
||||||
{
|
{
|
||||||
if (dop1foot && (p1.Position.Z - curContact.pos.Z) > (p1.Size.Z - avCapRadius) * 0.5f)
|
|
||||||
p1.IsColliding = true;
|
|
||||||
if (dop2foot && (p2.Position.Z - curContact.pos.Z) > (p2.Size.Z - avCapRadius) * 0.5f)
|
|
||||||
p2.IsColliding = true;
|
|
||||||
|
|
||||||
if (AvanormOverride && curContact.depth > 0.3f)
|
if (AvanormOverride)
|
||||||
{
|
{
|
||||||
curContact.normal.X = normoverride.X;
|
if (curContact.depth > 0.3f)
|
||||||
curContact.normal.Y = normoverride.Y;
|
{
|
||||||
curContact.normal.Z = normoverride.Z;
|
if (dop1foot && (p1.Position.Z - curContact.pos.Z) > (p1.Size.Z - avCapRadius) * 0.5f)
|
||||||
|
p1.IsColliding = true;
|
||||||
|
if (dop2foot && (p2.Position.Z - curContact.pos.Z) > (p2.Size.Z - avCapRadius) * 0.5f)
|
||||||
|
p2.IsColliding = true;
|
||||||
|
curContact.normal.X = normoverride.X;
|
||||||
|
curContact.normal.Y = normoverride.Y;
|
||||||
|
curContact.normal.Z = normoverride.Z;
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (dop1foot)
|
||||||
|
{
|
||||||
|
float sz = p1.Size.Z;
|
||||||
|
Vector3 vtmp = p1.Position;
|
||||||
|
float ppos = curContact.pos.Z - vtmp.Z + (sz - avCapRadius) * 0.5f;
|
||||||
|
if (ppos > 0f)
|
||||||
|
{
|
||||||
|
if (!p1.Flying)
|
||||||
|
{
|
||||||
|
d.AABB aabb;
|
||||||
|
d.GeomGetAABB(g2, out aabb);
|
||||||
|
float tmp = vtmp.Z - sz * .25f;
|
||||||
|
|
||||||
|
if (aabb.MaxZ < tmp)
|
||||||
|
{
|
||||||
|
vtmp.X = curContact.pos.X - vtmp.X;
|
||||||
|
vtmp.Y = curContact.pos.Y - vtmp.Y;
|
||||||
|
vtmp.Z = -0.2f;
|
||||||
|
vtmp.Normalize();
|
||||||
|
curContact.normal.X = vtmp.X;
|
||||||
|
curContact.normal.Y = vtmp.Y;
|
||||||
|
curContact.normal.Z = vtmp.Z;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
p1.IsColliding = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dop2foot)
|
||||||
|
{
|
||||||
|
float sz = p2.Size.Z;
|
||||||
|
Vector3 vtmp = p2.Position;
|
||||||
|
float ppos = curContact.pos.Z - vtmp.Z + (sz - avCapRadius) * 0.5f;
|
||||||
|
if (ppos > 0f)
|
||||||
|
{
|
||||||
|
if (!p2.Flying)
|
||||||
|
{
|
||||||
|
d.AABB aabb;
|
||||||
|
d.GeomGetAABB(g1, out aabb);
|
||||||
|
float tmp = vtmp.Z - sz * .25f;
|
||||||
|
|
||||||
|
if (aabb.MaxZ < tmp)
|
||||||
|
{
|
||||||
|
vtmp.X = curContact.pos.X - vtmp.X;
|
||||||
|
vtmp.Y = curContact.pos.Y - vtmp.Y;
|
||||||
|
vtmp.Z = -0.2f;
|
||||||
|
vtmp.Normalize();
|
||||||
|
curContact.normal.X = vtmp.X;
|
||||||
|
curContact.normal.Y = vtmp.Y;
|
||||||
|
curContact.normal.Z = vtmp.Z;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
p2.IsColliding = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Joint = CreateContacJoint(ref curContact, mu, bounce, cfm, erpscale, dscale);
|
Joint = CreateContacJoint(ref curContact, mu, bounce, cfm, erpscale, dscale);
|
||||||
|
@ -1609,41 +1675,40 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool needsMeshing(PrimitiveBaseShape pbs)
|
public bool needsMeshing(PrimitiveBaseShape pbs)
|
||||||
{
|
{
|
||||||
// most of this is redundant now as the mesher will return null if it cant mesh a prim
|
// check sculpts or meshs
|
||||||
// but we still need to check for sculptie meshing being enabled so this is the most
|
|
||||||
// convenient place to do it for now...
|
|
||||||
|
|
||||||
// //if (pbs.PathCurve == (byte)Primitive.PathCurve.Circle && pbs.ProfileCurve == (byte)Primitive.ProfileCurve.Circle && pbs.PathScaleY <= 0.75f)
|
|
||||||
// //m_log.Debug("needsMeshing: " + " pathCurve: " + pbs.PathCurve.ToString() + " profileCurve: " + pbs.ProfileCurve.ToString() + " pathScaleY: " + Primitive.UnpackPathScale(pbs.PathScaleY).ToString());
|
|
||||||
int iPropertiesNotSupportedDefault = 0;
|
|
||||||
|
|
||||||
if (pbs.SculptEntry)
|
if (pbs.SculptEntry)
|
||||||
{
|
{
|
||||||
if(!meshSculptedPrim)
|
if (meshSculptedPrim)
|
||||||
return false;
|
return true;
|
||||||
|
|
||||||
|
if (pbs.SculptType == (byte)SculptType.Mesh) // always do meshs
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (forceSimplePrimMeshing)
|
||||||
|
return true;
|
||||||
|
|
||||||
// if it's a standard box or sphere with no cuts, hollows, twist or top shear, return false since ODE can use an internal representation for the prim
|
// if it's a standard box or sphere with no cuts, hollows, twist or top shear, return false since ODE can use an internal representation for the prim
|
||||||
if (!forceSimplePrimMeshing && !pbs.SculptEntry)
|
|
||||||
{
|
if ((pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight)
|
||||||
if ((pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight)
|
|
||||||
|| (pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1
|
|| (pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1
|
||||||
&& pbs.Scale.X == pbs.Scale.Y && pbs.Scale.Y == pbs.Scale.Z))
|
&& pbs.Scale.X == pbs.Scale.Y && pbs.Scale.Y == pbs.Scale.Z))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (pbs.ProfileBegin == 0 && pbs.ProfileEnd == 0
|
if (pbs.ProfileBegin == 0 && pbs.ProfileEnd == 0
|
||||||
&& pbs.ProfileHollow == 0
|
&& pbs.ProfileHollow == 0
|
||||||
&& pbs.PathTwist == 0 && pbs.PathTwistBegin == 0
|
&& pbs.PathTwist == 0 && pbs.PathTwistBegin == 0
|
||||||
&& pbs.PathBegin == 0 && pbs.PathEnd == 0
|
&& pbs.PathBegin == 0 && pbs.PathEnd == 0
|
||||||
&& pbs.PathTaperX == 0 && pbs.PathTaperY == 0
|
&& pbs.PathTaperX == 0 && pbs.PathTaperY == 0
|
||||||
&& pbs.PathScaleX == 100 && pbs.PathScaleY == 100
|
&& pbs.PathScaleX == 100 && pbs.PathScaleY == 100
|
||||||
&& pbs.PathShearX == 0 && pbs.PathShearY == 0)
|
&& pbs.PathShearX == 0 && pbs.PathShearY == 0)
|
||||||
{
|
{
|
||||||
#if SPAM
|
#if SPAM
|
||||||
m_log.Warn("NonMesh");
|
m_log.Warn("NonMesh");
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1651,8 +1716,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
// and it's odd.. so for now just return true if asked to force meshs
|
// and it's odd.. so for now just return true if asked to force meshs
|
||||||
// hopefully mesher will fail if doesn't suport so things still get basic boxes
|
// hopefully mesher will fail if doesn't suport so things still get basic boxes
|
||||||
|
|
||||||
if (forceSimplePrimMeshing)
|
int iPropertiesNotSupportedDefault = 0;
|
||||||
return true;
|
|
||||||
|
|
||||||
if (pbs.ProfileHollow != 0)
|
if (pbs.ProfileHollow != 0)
|
||||||
iPropertiesNotSupportedDefault++;
|
iPropertiesNotSupportedDefault++;
|
||||||
|
@ -1721,9 +1785,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pbs.SculptEntry && meshSculptedPrim)
|
|
||||||
iPropertiesNotSupportedDefault++;
|
|
||||||
|
|
||||||
if (iPropertiesNotSupportedDefault == 0)
|
if (iPropertiesNotSupportedDefault == 0)
|
||||||
{
|
{
|
||||||
#if SPAM
|
#if SPAM
|
||||||
|
|
Loading…
Reference in New Issue