diff options
author | Melanie | 2013-02-06 02:22:12 +0000 |
---|---|---|
committer | Melanie | 2013-02-06 02:22:12 +0000 |
commit | f567ff9f51aebe522c210b5d34b26754de157c91 (patch) | |
tree | eac712a0ba78ca92b3178e2d532307c4ed489b06 | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Remove unused ScriptEngineLoader and ScriptEngineInterface in OpenSim.Region.... (diff) | |
download | opensim-SC_OLD-f567ff9f51aebe522c210b5d34b26754de157c91.zip opensim-SC_OLD-f567ff9f51aebe522c210b5d34b26754de157c91.tar.gz opensim-SC_OLD-f567ff9f51aebe522c210b5d34b26754de157c91.tar.bz2 opensim-SC_OLD-f567ff9f51aebe522c210b5d34b26754de157c91.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
24 files changed, 373 insertions, 462 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6d50c13..b69c1c4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -4687,19 +4687,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
4687 | 4687 | ||
4688 | #region Script Engine | 4688 | #region Script Engine |
4689 | 4689 | ||
4690 | private List<ScriptEngineInterface> ScriptEngines = new List<ScriptEngineInterface>(); | ||
4691 | public bool DumpAssetsToFile; | 4690 | public bool DumpAssetsToFile; |
4692 | 4691 | ||
4693 | /// <summary> | ||
4694 | /// | ||
4695 | /// </summary> | ||
4696 | /// <param name="scriptEngine"></param> | ||
4697 | public void AddScriptEngine(ScriptEngineInterface scriptEngine) | ||
4698 | { | ||
4699 | ScriptEngines.Add(scriptEngine); | ||
4700 | scriptEngine.InitializeEngine(this); | ||
4701 | } | ||
4702 | |||
4703 | private bool ScriptDanger(SceneObjectPart part,Vector3 pos) | 4692 | private bool ScriptDanger(SceneObjectPart part,Vector3 pos) |
4704 | { | 4693 | { |
4705 | ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y); | 4694 | ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y); |
diff --git a/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineInterface.cs b/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineInterface.cs deleted file mode 100644 index 812a21c..0000000 --- a/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineInterface.cs +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | //TODO: WHERE TO PLACE THIS? | ||
29 | |||
30 | namespace OpenSim.Region.Framework.Scenes.Scripting | ||
31 | { | ||
32 | public interface ScriptEngineInterface | ||
33 | { | ||
34 | void InitializeEngine(Scene Sceneworld); | ||
35 | void Shutdown(); | ||
36 | // void StartScript(string ScriptID, IScriptHost ObjectID); | ||
37 | } | ||
38 | } | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineLoader.cs b/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineLoader.cs deleted file mode 100644 index c58ccc5..0000000 --- a/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineLoader.cs +++ /dev/null | |||
@@ -1,119 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | /* Original code: Tedd Hansen */ | ||
29 | using System; | ||
30 | using System.IO; | ||
31 | using System.Reflection; | ||
32 | using log4net; | ||
33 | |||
34 | namespace OpenSim.Region.Framework.Scenes.Scripting | ||
35 | { | ||
36 | public class ScriptEngineLoader | ||
37 | { | ||
38 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
39 | |||
40 | public ScriptEngineInterface LoadScriptEngine(string EngineName) | ||
41 | { | ||
42 | ScriptEngineInterface ret = null; | ||
43 | try | ||
44 | { | ||
45 | ret = | ||
46 | LoadAndInitAssembly( | ||
47 | Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine." + EngineName + ".dll"), | ||
48 | "OpenSim.Region.ScriptEngine." + EngineName + ".ScriptEngine"); | ||
49 | } | ||
50 | catch (Exception e) | ||
51 | { | ||
52 | m_log.Error("[ScriptEngine]: " + | ||
53 | "Error loading assembly \"" + EngineName + "\": " + e.Message + ", " + | ||
54 | e.StackTrace.ToString()); | ||
55 | } | ||
56 | return ret; | ||
57 | } | ||
58 | |||
59 | /// <summary> | ||
60 | /// Does actual loading and initialization of script Assembly | ||
61 | /// </summary> | ||
62 | /// <param name="FreeAppDomain">AppDomain to load script into</param> | ||
63 | /// <param name="FileName">FileName of script assembly (.dll)</param> | ||
64 | /// <returns></returns> | ||
65 | private ScriptEngineInterface LoadAndInitAssembly(string FileName, string NameSpace) | ||
66 | { | ||
67 | //Common.SendToDebug("Loading ScriptEngine Assembly " + FileName); | ||
68 | // Load .Net Assembly (.dll) | ||
69 | // Initialize and return it | ||
70 | |||
71 | // TODO: Add error handling | ||
72 | |||
73 | Assembly a; | ||
74 | //try | ||
75 | //{ | ||
76 | |||
77 | |||
78 | // Load to default appdomain (temporary) | ||
79 | a = Assembly.LoadFrom(FileName); | ||
80 | // Load to specified appdomain | ||
81 | // TODO: Insert security | ||
82 | //a = FreeAppDomain.Load(FileName); | ||
83 | //} | ||
84 | //catch (Exception e) | ||
85 | //{ | ||
86 | // m_log.Error("[ScriptEngine]: Error loading assembly \String.Empty + FileName + "\": " + e.ToString()); | ||
87 | //} | ||
88 | |||
89 | |||
90 | //m_log.Debug("Loading: " + FileName); | ||
91 | //foreach (Type _t in a.GetTypes()) | ||
92 | //{ | ||
93 | // m_log.Debug("Type: " + _t.ToString()); | ||
94 | //} | ||
95 | |||
96 | Type t; | ||
97 | //try | ||
98 | //{ | ||
99 | t = a.GetType(NameSpace, true); | ||
100 | //} | ||
101 | //catch (Exception e) | ||
102 | //{ | ||
103 | // m_log.Error("[ScriptEngine]: Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString()); | ||
104 | //} | ||
105 | |||
106 | ScriptEngineInterface ret; | ||
107 | //try | ||
108 | //{ | ||
109 | ret = (ScriptEngineInterface) Activator.CreateInstance(t); | ||
110 | //} | ||
111 | //catch (Exception e) | ||
112 | //{ | ||
113 | // m_log.Error("[ScriptEngine]: Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString()); | ||
114 | //} | ||
115 | |||
116 | return ret; | ||
117 | } | ||
118 | } | ||
119 | } | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs b/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs new file mode 100644 index 0000000..f08ba59 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs | |||
@@ -0,0 +1,107 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenMetaverse; | ||
31 | using OpenSim.Framework; | ||
32 | |||
33 | namespace OpenSim.Region.Framework.Scenes.Scripting | ||
34 | { | ||
35 | /// <summary> | ||
36 | /// Utility functions for use by scripts manipulating the scene. | ||
37 | /// </summary> | ||
38 | public static class ScriptUtils | ||
39 | { | ||
40 | /// <summary> | ||
41 | /// Get an asset id given an item name and an item type. | ||
42 | /// </summary> | ||
43 | /// <returns>UUID.Zero if the name and type did not match any item.</returns> | ||
44 | /// <param name='part'></param> | ||
45 | /// <param name='name'></param> | ||
46 | /// <param name='type'></param> | ||
47 | public static UUID GetAssetIdFromItemName(SceneObjectPart part, string name, int type) | ||
48 | { | ||
49 | TaskInventoryItem item = part.Inventory.GetInventoryItem(name); | ||
50 | |||
51 | if (item != null && item.Type == type) | ||
52 | return item.AssetID; | ||
53 | else | ||
54 | return UUID.Zero; | ||
55 | } | ||
56 | |||
57 | /// <summary> | ||
58 | /// accepts a valid UUID, -or- a name of an inventory item. | ||
59 | /// Returns a valid UUID or UUID.Zero if key invalid and item not found | ||
60 | /// in prim inventory. | ||
61 | /// </summary> | ||
62 | /// <param name="part">Scene object part to search for inventory item</param> | ||
63 | /// <param name="key"></param> | ||
64 | /// <returns></returns> | ||
65 | public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, string identifier) | ||
66 | { | ||
67 | UUID key; | ||
68 | |||
69 | // if we can parse the string as a key, use it. | ||
70 | // else try to locate the name in inventory of object. found returns key, | ||
71 | // not found returns UUID.Zero | ||
72 | if (!UUID.TryParse(identifier, out key)) | ||
73 | { | ||
74 | TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier); | ||
75 | |||
76 | if (item != null) | ||
77 | key = item.AssetID; | ||
78 | else | ||
79 | key = UUID.Zero; | ||
80 | } | ||
81 | |||
82 | return key; | ||
83 | } | ||
84 | |||
85 | /// <summary> | ||
86 | /// Return the UUID of the asset matching the specified key or name | ||
87 | /// and asset type. | ||
88 | /// </summary> | ||
89 | /// <param name="part">Scene object part to search for inventory item</param> | ||
90 | /// <param name="identifier"></param> | ||
91 | /// <param name="type"></param> | ||
92 | /// <returns></returns> | ||
93 | public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, string identifier, AssetType type) | ||
94 | { | ||
95 | UUID key; | ||
96 | |||
97 | if (!UUID.TryParse(identifier, out key)) | ||
98 | { | ||
99 | TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier); | ||
100 | if (item != null && item.Type == (int)type) | ||
101 | key = item.AssetID; | ||
102 | } | ||
103 | |||
104 | return key; | ||
105 | } | ||
106 | } | ||
107 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs index 5b7a79d..ec880a7 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs | |||
@@ -39,6 +39,7 @@ using OpenMetaverse.StructuredData; | |||
39 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
40 | using OpenSim.Region.Framework.Interfaces; | 40 | using OpenSim.Region.Framework.Interfaces; |
41 | using OpenSim.Region.Framework.Scenes; | 41 | using OpenSim.Region.Framework.Scenes; |
42 | using OpenSim.Region.Framework.Scenes.Scripting; | ||
42 | using System.Collections.Generic; | 43 | using System.Collections.Generic; |
43 | using System.Text.RegularExpressions; | 44 | using System.Text.RegularExpressions; |
44 | 45 | ||
@@ -256,10 +257,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
256 | /// </summary> | 257 | /// </summary> |
257 | // ----------------------------------------------------------------- | 258 | // ----------------------------------------------------------------- |
258 | [ScriptInvocation] | 259 | [ScriptInvocation] |
259 | public UUID JsonReadNotecard(UUID hostID, UUID scriptID, UUID storeID, string path, UUID assetID) | 260 | public UUID JsonReadNotecard(UUID hostID, UUID scriptID, UUID storeID, string path, string notecardIdentifier) |
260 | { | 261 | { |
261 | UUID reqID = UUID.Random(); | 262 | UUID reqID = UUID.Random(); |
262 | Util.FireAndForget(delegate(object o) { DoJsonReadNotecard(reqID,hostID,scriptID,storeID,path,assetID); }); | 263 | Util.FireAndForget(o => DoJsonReadNotecard(reqID, hostID, scriptID, storeID, path, notecardIdentifier)); |
263 | return reqID; | 264 | return reqID; |
264 | } | 265 | } |
265 | 266 | ||
@@ -463,14 +464,23 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
463 | /// | 464 | /// |
464 | /// </summary> | 465 | /// </summary> |
465 | // ----------------------------------------------------------------- | 466 | // ----------------------------------------------------------------- |
466 | private void DoJsonReadNotecard(UUID reqID, UUID hostID, UUID scriptID, UUID storeID, string path, UUID assetID) | 467 | private void DoJsonReadNotecard( |
468 | UUID reqID, UUID hostID, UUID scriptID, UUID storeID, string path, string notecardIdentifier) | ||
467 | { | 469 | { |
470 | UUID assetID; | ||
471 | |||
472 | if (!UUID.TryParse(notecardIdentifier, out assetID)) | ||
473 | { | ||
474 | SceneObjectPart part = m_scene.GetSceneObjectPart(hostID); | ||
475 | assetID = ScriptUtils.GetAssetIdFromItemName(part, notecardIdentifier, (int)AssetType.Notecard); | ||
476 | } | ||
477 | |||
468 | AssetBase a = m_scene.AssetService.Get(assetID.ToString()); | 478 | AssetBase a = m_scene.AssetService.Get(assetID.ToString()); |
469 | if (a == null) | 479 | if (a == null) |
470 | GenerateRuntimeError(String.Format("Unable to find notecard asset {0}",assetID)); | 480 | GenerateRuntimeError(String.Format("Unable to find notecard asset {0}", assetID)); |
471 | 481 | ||
472 | if (a.Type != (sbyte)AssetType.Notecard) | 482 | if (a.Type != (sbyte)AssetType.Notecard) |
473 | GenerateRuntimeError(String.Format("Invalid notecard asset {0}",assetID)); | 483 | GenerateRuntimeError(String.Format("Invalid notecard asset {0}", assetID)); |
474 | 484 | ||
475 | m_log.DebugFormat("[JsonStoreScripts]: read notecard in context {0}",storeID); | 485 | m_log.DebugFormat("[JsonStoreScripts]: read notecard in context {0}",storeID); |
476 | 486 | ||
@@ -483,11 +493,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
483 | } | 493 | } |
484 | catch (Exception e) | 494 | catch (Exception e) |
485 | { | 495 | { |
486 | m_log.WarnFormat("[JsonStoreScripts]: Json parsing failed; {0}",e.Message); | 496 | m_log.WarnFormat("[JsonStoreScripts]: Json parsing failed; {0}", e.Message); |
487 | } | 497 | } |
488 | 498 | ||
489 | GenerateRuntimeError(String.Format("Json parsing failed for {0}",assetID.ToString())); | 499 | GenerateRuntimeError(String.Format("Json parsing failed for {0}", assetID)); |
490 | m_comms.DispatchReply(scriptID,0,"",reqID.ToString()); | 500 | m_comms.DispatchReply(scriptID, 0, "", reqID.ToString()); |
491 | } | 501 | } |
492 | 502 | ||
493 | // ----------------------------------------------------------------- | 503 | // ----------------------------------------------------------------- |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs b/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs index 04e77b8..39e62dd 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs | |||
@@ -1088,7 +1088,7 @@ private sealed class BulletConstraintXNA : BulletConstraint | |||
1088 | { | 1088 | { |
1089 | CollisionWorld.WorldData.ParamData p = new CollisionWorld.WorldData.ParamData(); | 1089 | CollisionWorld.WorldData.ParamData p = new CollisionWorld.WorldData.ParamData(); |
1090 | 1090 | ||
1091 | p.angularDamping = o[0].XangularDamping; | 1091 | p.angularDamping = BSParam.AngularDamping; |
1092 | p.defaultFriction = o[0].defaultFriction; | 1092 | p.defaultFriction = o[0].defaultFriction; |
1093 | p.defaultFriction = o[0].defaultFriction; | 1093 | p.defaultFriction = o[0].defaultFriction; |
1094 | p.defaultDensity = o[0].defaultDensity; | 1094 | p.defaultDensity = o[0].defaultDensity; |
@@ -1096,32 +1096,32 @@ private sealed class BulletConstraintXNA : BulletConstraint | |||
1096 | p.collisionMargin = o[0].collisionMargin; | 1096 | p.collisionMargin = o[0].collisionMargin; |
1097 | p.gravity = o[0].gravity; | 1097 | p.gravity = o[0].gravity; |
1098 | 1098 | ||
1099 | p.linearDamping = o[0].XlinearDamping; | 1099 | p.linearDamping = BSParam.LinearDamping; |
1100 | p.angularDamping = o[0].XangularDamping; | 1100 | p.angularDamping = BSParam.AngularDamping; |
1101 | p.deactivationTime = o[0].XdeactivationTime; | 1101 | p.deactivationTime = BSParam.DeactivationTime; |
1102 | p.linearSleepingThreshold = o[0].XlinearSleepingThreshold; | 1102 | p.linearSleepingThreshold = BSParam.LinearSleepingThreshold; |
1103 | p.angularSleepingThreshold = o[0].XangularSleepingThreshold; | 1103 | p.angularSleepingThreshold = BSParam.AngularSleepingThreshold; |
1104 | p.ccdMotionThreshold = o[0].XccdMotionThreshold; | 1104 | p.ccdMotionThreshold = BSParam.CcdMotionThreshold; |
1105 | p.ccdSweptSphereRadius = o[0].XccdSweptSphereRadius; | 1105 | p.ccdSweptSphereRadius = BSParam.CcdSweptSphereRadius; |
1106 | p.contactProcessingThreshold = o[0].XcontactProcessingThreshold; | 1106 | p.contactProcessingThreshold = BSParam.ContactProcessingThreshold; |
1107 | 1107 | ||
1108 | p.terrainImplementation = o[0].XterrainImplementation; | 1108 | p.terrainImplementation = BSParam.TerrainImplementation; |
1109 | p.terrainFriction = o[0].XterrainFriction; | 1109 | p.terrainFriction = BSParam.TerrainFriction; |
1110 | 1110 | ||
1111 | p.terrainHitFraction = o[0].XterrainHitFraction; | 1111 | p.terrainHitFraction = BSParam.TerrainHitFraction; |
1112 | p.terrainRestitution = o[0].XterrainRestitution; | 1112 | p.terrainRestitution = BSParam.TerrainRestitution; |
1113 | p.terrainCollisionMargin = o[0].XterrainCollisionMargin; | 1113 | p.terrainCollisionMargin = BSParam.TerrainCollisionMargin; |
1114 | 1114 | ||
1115 | p.avatarFriction = o[0].XavatarFriction; | 1115 | p.avatarFriction = BSParam.AvatarFriction; |
1116 | p.avatarStandingFriction = o[0].XavatarStandingFriction; | 1116 | p.avatarStandingFriction = BSParam.AvatarStandingFriction; |
1117 | p.avatarDensity = o[0].XavatarDensity; | 1117 | p.avatarDensity = BSParam.AvatarDensity; |
1118 | p.avatarRestitution = o[0].XavatarRestitution; | 1118 | p.avatarRestitution = BSParam.AvatarRestitution; |
1119 | p.avatarCapsuleWidth = o[0].XavatarCapsuleWidth; | 1119 | p.avatarCapsuleWidth = BSParam.AvatarCapsuleWidth; |
1120 | p.avatarCapsuleDepth = o[0].XavatarCapsuleDepth; | 1120 | p.avatarCapsuleDepth = BSParam.AvatarCapsuleDepth; |
1121 | p.avatarCapsuleHeight = o[0].XavatarCapsuleHeight; | 1121 | p.avatarCapsuleHeight = BSParam.AvatarCapsuleHeight; |
1122 | p.avatarContactProcessingThreshold = o[0].XavatarContactProcessingThreshold; | 1122 | p.avatarContactProcessingThreshold = BSParam.AvatarContactProcessingThreshold; |
1123 | 1123 | ||
1124 | p.vehicleAngularDamping = o[0].XvehicleAngularDamping; | 1124 | p.vehicleAngularDamping = BSParam.VehicleAngularDamping; |
1125 | 1125 | ||
1126 | p.maxPersistantManifoldPoolSize = o[0].maxPersistantManifoldPoolSize; | 1126 | p.maxPersistantManifoldPoolSize = o[0].maxPersistantManifoldPoolSize; |
1127 | p.maxCollisionAlgorithmPoolSize = o[0].maxCollisionAlgorithmPoolSize; | 1127 | p.maxCollisionAlgorithmPoolSize = o[0].maxCollisionAlgorithmPoolSize; |
@@ -1132,15 +1132,15 @@ private sealed class BulletConstraintXNA : BulletConstraint | |||
1132 | p.shouldEnableFrictionCaching = o[0].shouldEnableFrictionCaching; | 1132 | p.shouldEnableFrictionCaching = o[0].shouldEnableFrictionCaching; |
1133 | p.numberOfSolverIterations = o[0].numberOfSolverIterations; | 1133 | p.numberOfSolverIterations = o[0].numberOfSolverIterations; |
1134 | 1134 | ||
1135 | p.linksetImplementation = o[0].XlinksetImplementation; | 1135 | p.linksetImplementation = BSParam.LinksetImplementation; |
1136 | p.linkConstraintUseFrameOffset = o[0].XlinkConstraintUseFrameOffset; | 1136 | p.linkConstraintUseFrameOffset = BSParam.LinkConstraintUseFrameOffset; |
1137 | p.linkConstraintEnableTransMotor = o[0].XlinkConstraintEnableTransMotor; | 1137 | p.linkConstraintEnableTransMotor = BSParam.LinkConstraintEnableTransMotor; |
1138 | p.linkConstraintTransMotorMaxVel = o[0].XlinkConstraintTransMotorMaxVel; | 1138 | p.linkConstraintTransMotorMaxVel = BSParam.LinkConstraintTransMotorMaxVel; |
1139 | p.linkConstraintTransMotorMaxForce = o[0].XlinkConstraintTransMotorMaxForce; | 1139 | p.linkConstraintTransMotorMaxForce = BSParam.LinkConstraintTransMotorMaxForce; |
1140 | p.linkConstraintERP = o[0].XlinkConstraintERP; | 1140 | p.linkConstraintERP = BSParam.LinkConstraintERP; |
1141 | p.linkConstraintCFM = o[0].XlinkConstraintCFM; | 1141 | p.linkConstraintCFM = BSParam.LinkConstraintCFM; |
1142 | p.linkConstraintSolverIterations = o[0].XlinkConstraintSolverIterations; | 1142 | p.linkConstraintSolverIterations = BSParam.LinkConstraintSolverIterations; |
1143 | p.physicsLoggingFrames = o[0].XphysicsLoggingFrames; | 1143 | p.physicsLoggingFrames = o[0].physicsLoggingFrames; |
1144 | DefaultCollisionConstructionInfo ccci = new DefaultCollisionConstructionInfo(); | 1144 | DefaultCollisionConstructionInfo ccci = new DefaultCollisionConstructionInfo(); |
1145 | 1145 | ||
1146 | DefaultCollisionConfiguration cci = new DefaultCollisionConfiguration(); | 1146 | DefaultCollisionConfiguration cci = new DefaultCollisionConfiguration(); |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs b/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs index abbd22c..5e06c1e 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs | |||
@@ -174,32 +174,6 @@ public struct ConfigurationParameters | |||
174 | public float collisionMargin; | 174 | public float collisionMargin; |
175 | public float gravity; | 175 | public float gravity; |
176 | 176 | ||
177 | public float XlinearDamping; | ||
178 | public float XangularDamping; | ||
179 | public float XdeactivationTime; | ||
180 | public float XlinearSleepingThreshold; | ||
181 | public float XangularSleepingThreshold; | ||
182 | public float XccdMotionThreshold; | ||
183 | public float XccdSweptSphereRadius; | ||
184 | public float XcontactProcessingThreshold; | ||
185 | |||
186 | public float XterrainImplementation; | ||
187 | public float XterrainFriction; | ||
188 | public float XterrainHitFraction; | ||
189 | public float XterrainRestitution; | ||
190 | public float XterrainCollisionMargin; | ||
191 | |||
192 | public float XavatarFriction; | ||
193 | public float XavatarStandingFriction; | ||
194 | public float XavatarDensity; | ||
195 | public float XavatarRestitution; | ||
196 | public float XavatarCapsuleWidth; | ||
197 | public float XavatarCapsuleDepth; | ||
198 | public float XavatarCapsuleHeight; | ||
199 | public float XavatarContactProcessingThreshold; | ||
200 | |||
201 | public float XvehicleAngularDamping; | ||
202 | |||
203 | public float maxPersistantManifoldPoolSize; | 177 | public float maxPersistantManifoldPoolSize; |
204 | public float maxCollisionAlgorithmPoolSize; | 178 | public float maxCollisionAlgorithmPoolSize; |
205 | public float shouldDisableContactPoolDynamicAllocation; | 179 | public float shouldDisableContactPoolDynamicAllocation; |
@@ -208,17 +182,9 @@ public struct ConfigurationParameters | |||
208 | public float shouldSplitSimulationIslands; | 182 | public float shouldSplitSimulationIslands; |
209 | public float shouldEnableFrictionCaching; | 183 | public float shouldEnableFrictionCaching; |
210 | public float numberOfSolverIterations; | 184 | public float numberOfSolverIterations; |
185 | public float useSingleSidedMeshes; | ||
211 | 186 | ||
212 | public float XlinksetImplementation; | 187 | public float physicsLoggingFrames; |
213 | public float XlinkConstraintUseFrameOffset; | ||
214 | public float XlinkConstraintEnableTransMotor; | ||
215 | public float XlinkConstraintTransMotorMaxVel; | ||
216 | public float XlinkConstraintTransMotorMaxForce; | ||
217 | public float XlinkConstraintERP; | ||
218 | public float XlinkConstraintCFM; | ||
219 | public float XlinkConstraintSolverIterations; | ||
220 | |||
221 | public float XphysicsLoggingFrames; | ||
222 | 188 | ||
223 | public const float numericTrue = 1f; | 189 | public const float numericTrue = 1f; |
224 | public const float numericFalse = 0f; | 190 | public const float numericFalse = 0f; |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index 8ecf2ff..b51e9fd 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -1326,7 +1326,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1326 | // If verticalError.Z is negative, the vehicle is upside down. Add additional push. | 1326 | // If verticalError.Z is negative, the vehicle is upside down. Add additional push. |
1327 | if (verticalError.Z < 0f) | 1327 | if (verticalError.Z < 0f) |
1328 | { | 1328 | { |
1329 | vertContributionV.X += PIOverFour; | 1329 | vertContributionV.X += Math.Sign(vertContributionV.X) * PIOverFour; |
1330 | // vertContribution.Y -= PIOverFour; | 1330 | // vertContribution.Y -= PIOverFour; |
1331 | } | 1331 | } |
1332 | 1332 | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index 8c098b2..306928a 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | |||
@@ -39,6 +39,7 @@ public static class BSParam | |||
39 | { | 39 | { |
40 | // Level of Detail values kept as float because that's what the Meshmerizer wants | 40 | // Level of Detail values kept as float because that's what the Meshmerizer wants |
41 | public static float MeshLOD { get; private set; } | 41 | public static float MeshLOD { get; private set; } |
42 | public static float MeshCircularLOD { get; private set; } | ||
42 | public static float MeshMegaPrimLOD { get; private set; } | 43 | public static float MeshMegaPrimLOD { get; private set; } |
43 | public static float MeshMegaPrimThreshold { get; private set; } | 44 | public static float MeshMegaPrimThreshold { get; private set; } |
44 | public static float SculptLOD { get; private set; } | 45 | public static float SculptLOD { get; private set; } |
@@ -61,6 +62,7 @@ public static class BSParam | |||
61 | public static bool ShouldMeshSculptedPrim { get; private set; } // cause scuplted prims to get meshed | 62 | public static bool ShouldMeshSculptedPrim { get; private set; } // cause scuplted prims to get meshed |
62 | public static bool ShouldForceSimplePrimMeshing { get; private set; } // if a cube or sphere, let Bullet do internal shapes | 63 | public static bool ShouldForceSimplePrimMeshing { get; private set; } // if a cube or sphere, let Bullet do internal shapes |
63 | public static bool ShouldUseHullsForPhysicalObjects { get; private set; } // 'true' if should create hulls for physical objects | 64 | public static bool ShouldUseHullsForPhysicalObjects { get; private set; } // 'true' if should create hulls for physical objects |
65 | public static bool ShouldRemoveZeroWidthTriangles { get; private set; } | ||
64 | 66 | ||
65 | public static float TerrainImplementation { get; private set; } | 67 | public static float TerrainImplementation { get; private set; } |
66 | public static float TerrainFriction { get; private set; } | 68 | public static float TerrainFriction { get; private set; } |
@@ -68,6 +70,24 @@ public static class BSParam | |||
68 | public static float TerrainRestitution { get; private set; } | 70 | public static float TerrainRestitution { get; private set; } |
69 | public static float TerrainCollisionMargin { get; private set; } | 71 | public static float TerrainCollisionMargin { get; private set; } |
70 | 72 | ||
73 | public static float DefaultFriction; | ||
74 | public static float DefaultDensity; | ||
75 | public static float DefaultRestitution; | ||
76 | public static float CollisionMargin; | ||
77 | public static float Gravity; | ||
78 | |||
79 | // Physics Engine operation | ||
80 | public static float MaxPersistantManifoldPoolSize; | ||
81 | public static float MaxCollisionAlgorithmPoolSize; | ||
82 | public static float ShouldDisableContactPoolDynamicAllocation; | ||
83 | public static float ShouldForceUpdateAllAabbs; | ||
84 | public static float ShouldRandomizeSolverOrder; | ||
85 | public static float ShouldSplitSimulationIslands; | ||
86 | public static float ShouldEnableFrictionCaching; | ||
87 | public static float NumberOfSolverIterations; | ||
88 | public static bool UseSingleSidedMeshes { get { return UseSingleSidedMeshesF != ConfigurationParameters.numericFalse; } } | ||
89 | public static float UseSingleSidedMeshesF; | ||
90 | |||
71 | // Avatar parameters | 91 | // Avatar parameters |
72 | public static float AvatarFriction { get; private set; } | 92 | public static float AvatarFriction { get; private set; } |
73 | public static float AvatarStandingFriction { get; private set; } | 93 | public static float AvatarStandingFriction { get; private set; } |
@@ -199,22 +219,32 @@ public static class BSParam | |||
199 | (s,cf,p,v) => { ShouldUseHullsForPhysicalObjects = cf.GetBoolean(p, BSParam.BoolNumeric(v)); }, | 219 | (s,cf,p,v) => { ShouldUseHullsForPhysicalObjects = cf.GetBoolean(p, BSParam.BoolNumeric(v)); }, |
200 | (s) => { return BSParam.NumericBool(ShouldUseHullsForPhysicalObjects); }, | 220 | (s) => { return BSParam.NumericBool(ShouldUseHullsForPhysicalObjects); }, |
201 | (s,p,l,v) => { ShouldUseHullsForPhysicalObjects = BSParam.BoolNumeric(v); } ), | 221 | (s,p,l,v) => { ShouldUseHullsForPhysicalObjects = BSParam.BoolNumeric(v); } ), |
222 | new ParameterDefn("ShouldRemoveZeroWidthTriangles", "If true, remove degenerate triangles from meshes", | ||
223 | ConfigurationParameters.numericFalse, | ||
224 | (s,cf,p,v) => { ShouldRemoveZeroWidthTriangles = cf.GetBoolean(p, BSParam.BoolNumeric(v)); }, | ||
225 | (s) => { return BSParam.NumericBool(ShouldRemoveZeroWidthTriangles); }, | ||
226 | (s,p,l,v) => { ShouldRemoveZeroWidthTriangles = BSParam.BoolNumeric(v); } ), | ||
202 | 227 | ||
203 | new ParameterDefn("MeshLevelOfDetail", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)", | 228 | new ParameterDefn("MeshLevelOfDetail", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)", |
204 | 8f, | 229 | 32f, |
205 | (s,cf,p,v) => { MeshLOD = (float)cf.GetInt(p, (int)v); }, | 230 | (s,cf,p,v) => { MeshLOD = (float)cf.GetInt(p, (int)v); }, |
206 | (s) => { return MeshLOD; }, | 231 | (s) => { return MeshLOD; }, |
207 | (s,p,l,v) => { MeshLOD = v; } ), | 232 | (s,p,l,v) => { MeshLOD = v; } ), |
208 | new ParameterDefn("MeshLevelOfDetailMegaPrim", "Level of detail to render meshes larger than threshold meters", | 233 | new ParameterDefn("MeshLevelOfDetailCircular", "Level of detail for prims with circular cuts or shapes", |
209 | 16f, | 234 | 32f, |
210 | (s,cf,p,v) => { MeshMegaPrimLOD = (float)cf.GetInt(p, (int)v); }, | 235 | (s,cf,p,v) => { MeshCircularLOD = (float)cf.GetInt(p, (int)v); }, |
211 | (s) => { return MeshMegaPrimLOD; }, | 236 | (s) => { return MeshCircularLOD; }, |
212 | (s,p,l,v) => { MeshMegaPrimLOD = v; } ), | 237 | (s,p,l,v) => { MeshCircularLOD = v; } ), |
213 | new ParameterDefn("MeshLevelOfDetailMegaPrimThreshold", "Size (in meters) of a mesh before using MeshMegaPrimLOD", | 238 | new ParameterDefn("MeshLevelOfDetailMegaPrimThreshold", "Size (in meters) of a mesh before using MeshMegaPrimLOD", |
214 | 10f, | 239 | 10f, |
215 | (s,cf,p,v) => { MeshMegaPrimThreshold = (float)cf.GetInt(p, (int)v); }, | 240 | (s,cf,p,v) => { MeshMegaPrimThreshold = (float)cf.GetInt(p, (int)v); }, |
216 | (s) => { return MeshMegaPrimThreshold; }, | 241 | (s) => { return MeshMegaPrimThreshold; }, |
217 | (s,p,l,v) => { MeshMegaPrimThreshold = v; } ), | 242 | (s,p,l,v) => { MeshMegaPrimThreshold = v; } ), |
243 | new ParameterDefn("MeshLevelOfDetailMegaPrim", "Level of detail to render meshes larger than threshold meters", | ||
244 | 32f, | ||
245 | (s,cf,p,v) => { MeshMegaPrimLOD = (float)cf.GetInt(p, (int)v); }, | ||
246 | (s) => { return MeshMegaPrimLOD; }, | ||
247 | (s,p,l,v) => { MeshMegaPrimLOD = v; } ), | ||
218 | new ParameterDefn("SculptLevelOfDetail", "Level of detail to render sculpties (32, 16, 8 or 4. 32=most detailed)", | 248 | new ParameterDefn("SculptLevelOfDetail", "Level of detail to render sculpties (32, 16, 8 or 4. 32=most detailed)", |
219 | 32f, | 249 | 32f, |
220 | (s,cf,p,v) => { SculptLOD = (float)cf.GetInt(p, (int)v); }, | 250 | (s,cf,p,v) => { SculptLOD = (float)cf.GetInt(p, (int)v); }, |
@@ -287,29 +317,29 @@ public static class BSParam | |||
287 | 317 | ||
288 | new ParameterDefn("DefaultFriction", "Friction factor used on new objects", | 318 | new ParameterDefn("DefaultFriction", "Friction factor used on new objects", |
289 | 0.2f, | 319 | 0.2f, |
290 | (s,cf,p,v) => { s.UnmanagedParams[0].defaultFriction = cf.GetFloat(p, v); }, | 320 | (s,cf,p,v) => { DefaultFriction = cf.GetFloat(p, v); }, |
291 | (s) => { return s.UnmanagedParams[0].defaultFriction; }, | 321 | (s) => { return DefaultFriction; }, |
292 | (s,p,l,v) => { s.UnmanagedParams[0].defaultFriction = v; } ), | 322 | (s,p,l,v) => { DefaultFriction = v; s.UnmanagedParams[0].defaultFriction = v; } ), |
293 | new ParameterDefn("DefaultDensity", "Density for new objects" , | 323 | new ParameterDefn("DefaultDensity", "Density for new objects" , |
294 | 10.000006836f, // Aluminum g/cm3 | 324 | 10.000006836f, // Aluminum g/cm3 |
295 | (s,cf,p,v) => { s.UnmanagedParams[0].defaultDensity = cf.GetFloat(p, v); }, | 325 | (s,cf,p,v) => { DefaultDensity = cf.GetFloat(p, v); }, |
296 | (s) => { return s.UnmanagedParams[0].defaultDensity; }, | 326 | (s) => { return DefaultDensity; }, |
297 | (s,p,l,v) => { s.UnmanagedParams[0].defaultDensity = v; } ), | 327 | (s,p,l,v) => { DefaultDensity = v; s.UnmanagedParams[0].defaultDensity = v; } ), |
298 | new ParameterDefn("DefaultRestitution", "Bouncyness of an object" , | 328 | new ParameterDefn("DefaultRestitution", "Bouncyness of an object" , |
299 | 0f, | 329 | 0f, |
300 | (s,cf,p,v) => { s.UnmanagedParams[0].defaultRestitution = cf.GetFloat(p, v); }, | 330 | (s,cf,p,v) => { DefaultRestitution = cf.GetFloat(p, v); }, |
301 | (s) => { return s.UnmanagedParams[0].defaultRestitution; }, | 331 | (s) => { return DefaultRestitution; }, |
302 | (s,p,l,v) => { s.UnmanagedParams[0].defaultRestitution = v; } ), | 332 | (s,p,l,v) => { DefaultRestitution = v; s.UnmanagedParams[0].defaultRestitution = v; } ), |
303 | new ParameterDefn("CollisionMargin", "Margin around objects before collisions are calculated (must be zero!)", | 333 | new ParameterDefn("CollisionMargin", "Margin around objects before collisions are calculated (must be zero!)", |
304 | 0.04f, | 334 | 0.04f, |
305 | (s,cf,p,v) => { s.UnmanagedParams[0].collisionMargin = cf.GetFloat(p, v); }, | 335 | (s,cf,p,v) => { CollisionMargin = cf.GetFloat(p, v); }, |
306 | (s) => { return s.UnmanagedParams[0].collisionMargin; }, | 336 | (s) => { return CollisionMargin; }, |
307 | (s,p,l,v) => { s.UnmanagedParams[0].collisionMargin = v; } ), | 337 | (s,p,l,v) => { CollisionMargin = v; s.UnmanagedParams[0].collisionMargin = v; } ), |
308 | new ParameterDefn("Gravity", "Vertical force of gravity (negative means down)", | 338 | new ParameterDefn("Gravity", "Vertical force of gravity (negative means down)", |
309 | -9.80665f, | 339 | -9.80665f, |
310 | (s,cf,p,v) => { s.UnmanagedParams[0].gravity = cf.GetFloat(p, v); }, | 340 | (s,cf,p,v) => { Gravity = cf.GetFloat(p, v); }, |
311 | (s) => { return s.UnmanagedParams[0].gravity; }, | 341 | (s) => { return Gravity; }, |
312 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{s.UnmanagedParams[0].gravity=x;}, p, PhysParameterEntry.APPLY_TO_NONE, v); }, | 342 | (s,p,l,v) => { Gravity = v; s.UnmanagedParams[0].gravity = v; }, |
313 | (s,o,v) => { s.PE.SetGravity(o.PhysBody, new Vector3(0f,0f,v)); } ), | 343 | (s,o,v) => { s.PE.SetGravity(o.PhysBody, new Vector3(0f,0f,v)); } ), |
314 | 344 | ||
315 | 345 | ||
@@ -317,49 +347,49 @@ public static class BSParam | |||
317 | 0f, | 347 | 0f, |
318 | (s,cf,p,v) => { LinearDamping = cf.GetFloat(p, v); }, | 348 | (s,cf,p,v) => { LinearDamping = cf.GetFloat(p, v); }, |
319 | (s) => { return LinearDamping; }, | 349 | (s) => { return LinearDamping; }, |
320 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{LinearDamping=x;}, p, l, v); }, | 350 | (s,p,l,v) => { LinearDamping = v; }, |
321 | (s,o,v) => { s.PE.SetDamping(o.PhysBody, v, AngularDamping); } ), | 351 | (s,o,v) => { s.PE.SetDamping(o.PhysBody, v, AngularDamping); } ), |
322 | new ParameterDefn("AngularDamping", "Factor to damp angular movement per second (0.0 - 1.0)", | 352 | new ParameterDefn("AngularDamping", "Factor to damp angular movement per second (0.0 - 1.0)", |
323 | 0f, | 353 | 0f, |
324 | (s,cf,p,v) => { AngularDamping = cf.GetFloat(p, v); }, | 354 | (s,cf,p,v) => { AngularDamping = cf.GetFloat(p, v); }, |
325 | (s) => { return AngularDamping; }, | 355 | (s) => { return AngularDamping; }, |
326 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{AngularDamping=x;}, p, l, v); }, | 356 | (s,p,l,v) => { AngularDamping = v; }, |
327 | (s,o,v) => { s.PE.SetDamping(o.PhysBody, LinearDamping, v); } ), | 357 | (s,o,v) => { s.PE.SetDamping(o.PhysBody, LinearDamping, v); } ), |
328 | new ParameterDefn("DeactivationTime", "Seconds before considering an object potentially static", | 358 | new ParameterDefn("DeactivationTime", "Seconds before considering an object potentially static", |
329 | 0.2f, | 359 | 0.2f, |
330 | (s,cf,p,v) => { DeactivationTime = cf.GetFloat(p, v); }, | 360 | (s,cf,p,v) => { DeactivationTime = cf.GetFloat(p, v); }, |
331 | (s) => { return DeactivationTime; }, | 361 | (s) => { return DeactivationTime; }, |
332 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{DeactivationTime=x;}, p, l, v); }, | 362 | (s,p,l,v) => { DeactivationTime = v; }, |
333 | (s,o,v) => { s.PE.SetDeactivationTime(o.PhysBody, v); } ), | 363 | (s,o,v) => { s.PE.SetDeactivationTime(o.PhysBody, v); } ), |
334 | new ParameterDefn("LinearSleepingThreshold", "Seconds to measure linear movement before considering static", | 364 | new ParameterDefn("LinearSleepingThreshold", "Seconds to measure linear movement before considering static", |
335 | 0.8f, | 365 | 0.8f, |
336 | (s,cf,p,v) => { LinearSleepingThreshold = cf.GetFloat(p, v); }, | 366 | (s,cf,p,v) => { LinearSleepingThreshold = cf.GetFloat(p, v); }, |
337 | (s) => { return LinearSleepingThreshold; }, | 367 | (s) => { return LinearSleepingThreshold; }, |
338 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{LinearSleepingThreshold=x;}, p, l, v); }, | 368 | (s,p,l,v) => { LinearSleepingThreshold = v;}, |
339 | (s,o,v) => { s.PE.SetSleepingThresholds(o.PhysBody, v, v); } ), | 369 | (s,o,v) => { s.PE.SetSleepingThresholds(o.PhysBody, v, v); } ), |
340 | new ParameterDefn("AngularSleepingThreshold", "Seconds to measure angular movement before considering static", | 370 | new ParameterDefn("AngularSleepingThreshold", "Seconds to measure angular movement before considering static", |
341 | 1.0f, | 371 | 1.0f, |
342 | (s,cf,p,v) => { AngularSleepingThreshold = cf.GetFloat(p, v); }, | 372 | (s,cf,p,v) => { AngularSleepingThreshold = cf.GetFloat(p, v); }, |
343 | (s) => { return AngularSleepingThreshold; }, | 373 | (s) => { return AngularSleepingThreshold; }, |
344 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{AngularSleepingThreshold=x;}, p, l, v); }, | 374 | (s,p,l,v) => { AngularSleepingThreshold = v;}, |
345 | (s,o,v) => { s.PE.SetSleepingThresholds(o.PhysBody, v, v); } ), | 375 | (s,o,v) => { s.PE.SetSleepingThresholds(o.PhysBody, v, v); } ), |
346 | new ParameterDefn("CcdMotionThreshold", "Continuious collision detection threshold (0 means no CCD)" , | 376 | new ParameterDefn("CcdMotionThreshold", "Continuious collision detection threshold (0 means no CCD)" , |
347 | 0.0f, // set to zero to disable | 377 | 0.0f, // set to zero to disable |
348 | (s,cf,p,v) => { CcdMotionThreshold = cf.GetFloat(p, v); }, | 378 | (s,cf,p,v) => { CcdMotionThreshold = cf.GetFloat(p, v); }, |
349 | (s) => { return CcdMotionThreshold; }, | 379 | (s) => { return CcdMotionThreshold; }, |
350 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{CcdMotionThreshold=x;}, p, l, v); }, | 380 | (s,p,l,v) => { CcdMotionThreshold = v;}, |
351 | (s,o,v) => { s.PE.SetCcdMotionThreshold(o.PhysBody, v); } ), | 381 | (s,o,v) => { s.PE.SetCcdMotionThreshold(o.PhysBody, v); } ), |
352 | new ParameterDefn("CcdSweptSphereRadius", "Continuious collision detection test radius" , | 382 | new ParameterDefn("CcdSweptSphereRadius", "Continuious collision detection test radius" , |
353 | 0.2f, | 383 | 0.2f, |
354 | (s,cf,p,v) => { CcdSweptSphereRadius = cf.GetFloat(p, v); }, | 384 | (s,cf,p,v) => { CcdSweptSphereRadius = cf.GetFloat(p, v); }, |
355 | (s) => { return CcdSweptSphereRadius; }, | 385 | (s) => { return CcdSweptSphereRadius; }, |
356 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{CcdSweptSphereRadius=x;}, p, l, v); }, | 386 | (s,p,l,v) => { CcdSweptSphereRadius = v;}, |
357 | (s,o,v) => { s.PE.SetCcdSweptSphereRadius(o.PhysBody, v); } ), | 387 | (s,o,v) => { s.PE.SetCcdSweptSphereRadius(o.PhysBody, v); } ), |
358 | new ParameterDefn("ContactProcessingThreshold", "Distance above which contacts can be discarded (0 means no discard)" , | 388 | new ParameterDefn("ContactProcessingThreshold", "Distance above which contacts can be discarded (0 means no discard)" , |
359 | 0.0f, | 389 | 0.0f, |
360 | (s,cf,p,v) => { ContactProcessingThreshold = cf.GetFloat(p, v); }, | 390 | (s,cf,p,v) => { ContactProcessingThreshold = cf.GetFloat(p, v); }, |
361 | (s) => { return ContactProcessingThreshold; }, | 391 | (s) => { return ContactProcessingThreshold; }, |
362 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{ContactProcessingThreshold=x;}, p, l, v); }, | 392 | (s,p,l,v) => { ContactProcessingThreshold = v;}, |
363 | (s,o,v) => { s.PE.SetContactProcessingThreshold(o.PhysBody, v); } ), | 393 | (s,o,v) => { s.PE.SetContactProcessingThreshold(o.PhysBody, v); } ), |
364 | 394 | ||
365 | new ParameterDefn("TerrainImplementation", "Type of shape to use for terrain (0=heightmap, 1=mesh)", | 395 | new ParameterDefn("TerrainImplementation", "Type of shape to use for terrain (0=heightmap, 1=mesh)", |
@@ -392,7 +422,7 @@ public static class BSParam | |||
392 | 0.2f, | 422 | 0.2f, |
393 | (s,cf,p,v) => { AvatarFriction = cf.GetFloat(p, v); }, | 423 | (s,cf,p,v) => { AvatarFriction = cf.GetFloat(p, v); }, |
394 | (s) => { return AvatarFriction; }, | 424 | (s) => { return AvatarFriction; }, |
395 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarFriction=x;}, p, l, v); } ), | 425 | (s,p,l,v) => { AvatarFriction = v; } ), |
396 | new ParameterDefn("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.", | 426 | new ParameterDefn("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.", |
397 | 10.0f, | 427 | 10.0f, |
398 | (s,cf,p,v) => { AvatarStandingFriction = cf.GetFloat(p, v); }, | 428 | (s,cf,p,v) => { AvatarStandingFriction = cf.GetFloat(p, v); }, |
@@ -407,32 +437,32 @@ public static class BSParam | |||
407 | 3.5f, | 437 | 3.5f, |
408 | (s,cf,p,v) => { AvatarDensity = cf.GetFloat(p, v); }, | 438 | (s,cf,p,v) => { AvatarDensity = cf.GetFloat(p, v); }, |
409 | (s) => { return AvatarDensity; }, | 439 | (s) => { return AvatarDensity; }, |
410 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarDensity=x;}, p, l, v); } ), | 440 | (s,p,l,v) => { AvatarDensity = v; } ), |
411 | new ParameterDefn("AvatarRestitution", "Bouncyness. Changed on avatar recreation.", | 441 | new ParameterDefn("AvatarRestitution", "Bouncyness. Changed on avatar recreation.", |
412 | 0f, | 442 | 0f, |
413 | (s,cf,p,v) => { AvatarRestitution = cf.GetFloat(p, v); }, | 443 | (s,cf,p,v) => { AvatarRestitution = cf.GetFloat(p, v); }, |
414 | (s) => { return AvatarRestitution; }, | 444 | (s) => { return AvatarRestitution; }, |
415 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarRestitution=x;}, p, l, v); } ), | 445 | (s,p,l,v) => { AvatarRestitution = v; } ), |
416 | new ParameterDefn("AvatarCapsuleWidth", "The distance between the sides of the avatar capsule", | 446 | new ParameterDefn("AvatarCapsuleWidth", "The distance between the sides of the avatar capsule", |
417 | 0.6f, | 447 | 0.6f, |
418 | (s,cf,p,v) => { AvatarCapsuleWidth = cf.GetFloat(p, v); }, | 448 | (s,cf,p,v) => { AvatarCapsuleWidth = cf.GetFloat(p, v); }, |
419 | (s) => { return AvatarCapsuleWidth; }, | 449 | (s) => { return AvatarCapsuleWidth; }, |
420 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarCapsuleWidth=x;}, p, l, v); } ), | 450 | (s,p,l,v) => { AvatarCapsuleWidth = v; } ), |
421 | new ParameterDefn("AvatarCapsuleDepth", "The distance between the front and back of the avatar capsule", | 451 | new ParameterDefn("AvatarCapsuleDepth", "The distance between the front and back of the avatar capsule", |
422 | 0.45f, | 452 | 0.45f, |
423 | (s,cf,p,v) => { AvatarCapsuleDepth = cf.GetFloat(p, v); }, | 453 | (s,cf,p,v) => { AvatarCapsuleDepth = cf.GetFloat(p, v); }, |
424 | (s) => { return AvatarCapsuleDepth; }, | 454 | (s) => { return AvatarCapsuleDepth; }, |
425 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarCapsuleDepth=x;}, p, l, v); } ), | 455 | (s,p,l,v) => { AvatarCapsuleDepth = v; } ), |
426 | new ParameterDefn("AvatarCapsuleHeight", "Default height of space around avatar", | 456 | new ParameterDefn("AvatarCapsuleHeight", "Default height of space around avatar", |
427 | 1.5f, | 457 | 1.5f, |
428 | (s,cf,p,v) => { AvatarCapsuleHeight = cf.GetFloat(p, v); }, | 458 | (s,cf,p,v) => { AvatarCapsuleHeight = cf.GetFloat(p, v); }, |
429 | (s) => { return AvatarCapsuleHeight; }, | 459 | (s) => { return AvatarCapsuleHeight; }, |
430 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarCapsuleHeight=x;}, p, l, v); } ), | 460 | (s,p,l,v) => { AvatarCapsuleHeight = v; } ), |
431 | new ParameterDefn("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions", | 461 | new ParameterDefn("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions", |
432 | 0.1f, | 462 | 0.1f, |
433 | (s,cf,p,v) => { AvatarContactProcessingThreshold = cf.GetFloat(p, v); }, | 463 | (s,cf,p,v) => { AvatarContactProcessingThreshold = cf.GetFloat(p, v); }, |
434 | (s) => { return AvatarContactProcessingThreshold; }, | 464 | (s) => { return AvatarContactProcessingThreshold; }, |
435 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarContactProcessingThreshold=x;}, p, l, v); } ), | 465 | (s,p,l,v) => { AvatarContactProcessingThreshold = v; } ), |
436 | new ParameterDefn("AvatarStepHeight", "Height of a step obstacle to consider step correction", | 466 | new ParameterDefn("AvatarStepHeight", "Height of a step obstacle to consider step correction", |
437 | 0.3f, | 467 | 0.3f, |
438 | (s,cf,p,v) => { AvatarStepHeight = cf.GetFloat(p, v); }, | 468 | (s,cf,p,v) => { AvatarStepHeight = cf.GetFloat(p, v); }, |
@@ -497,44 +527,49 @@ public static class BSParam | |||
497 | 527 | ||
498 | new ParameterDefn("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)", | 528 | new ParameterDefn("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)", |
499 | 0f, | 529 | 0f, |
500 | (s,cf,p,v) => { s.UnmanagedParams[0].maxPersistantManifoldPoolSize = cf.GetFloat(p, v); }, | 530 | (s,cf,p,v) => { MaxPersistantManifoldPoolSize = cf.GetFloat(p, v); }, |
501 | (s) => { return s.UnmanagedParams[0].maxPersistantManifoldPoolSize; }, | 531 | (s) => { return MaxPersistantManifoldPoolSize; }, |
502 | (s,p,l,v) => { s.UnmanagedParams[0].maxPersistantManifoldPoolSize = v; } ), | 532 | (s,p,l,v) => { MaxPersistantManifoldPoolSize = v; s.UnmanagedParams[0].maxPersistantManifoldPoolSize = v; } ), |
503 | new ParameterDefn("MaxCollisionAlgorithmPoolSize", "Number of collisions pooled (0 means default of 4096)", | 533 | new ParameterDefn("MaxCollisionAlgorithmPoolSize", "Number of collisions pooled (0 means default of 4096)", |
504 | 0f, | 534 | 0f, |
505 | (s,cf,p,v) => { s.UnmanagedParams[0].maxCollisionAlgorithmPoolSize = cf.GetFloat(p, v); }, | 535 | (s,cf,p,v) => { MaxCollisionAlgorithmPoolSize = cf.GetFloat(p, v); }, |
506 | (s) => { return s.UnmanagedParams[0].maxCollisionAlgorithmPoolSize; }, | 536 | (s) => { return MaxCollisionAlgorithmPoolSize; }, |
507 | (s,p,l,v) => { s.UnmanagedParams[0].maxCollisionAlgorithmPoolSize = v; } ), | 537 | (s,p,l,v) => { MaxCollisionAlgorithmPoolSize = v; s.UnmanagedParams[0].maxCollisionAlgorithmPoolSize = v; } ), |
508 | new ParameterDefn("ShouldDisableContactPoolDynamicAllocation", "Enable to allow large changes in object count", | 538 | new ParameterDefn("ShouldDisableContactPoolDynamicAllocation", "Enable to allow large changes in object count", |
509 | ConfigurationParameters.numericFalse, | 539 | ConfigurationParameters.numericFalse, |
510 | (s,cf,p,v) => { s.UnmanagedParams[0].shouldDisableContactPoolDynamicAllocation = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, | 540 | (s,cf,p,v) => { ShouldDisableContactPoolDynamicAllocation = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, |
511 | (s) => { return s.UnmanagedParams[0].shouldDisableContactPoolDynamicAllocation; }, | 541 | (s) => { return ShouldDisableContactPoolDynamicAllocation; }, |
512 | (s,p,l,v) => { s.UnmanagedParams[0].shouldDisableContactPoolDynamicAllocation = v; } ), | 542 | (s,p,l,v) => { ShouldDisableContactPoolDynamicAllocation = v; s.UnmanagedParams[0].shouldDisableContactPoolDynamicAllocation = v; } ), |
513 | new ParameterDefn("ShouldForceUpdateAllAabbs", "Enable to recomputer AABBs every simulator step", | 543 | new ParameterDefn("ShouldForceUpdateAllAabbs", "Enable to recomputer AABBs every simulator step", |
514 | ConfigurationParameters.numericFalse, | 544 | ConfigurationParameters.numericFalse, |
515 | (s,cf,p,v) => { s.UnmanagedParams[0].shouldForceUpdateAllAabbs = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, | 545 | (s,cf,p,v) => { ShouldForceUpdateAllAabbs = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, |
516 | (s) => { return s.UnmanagedParams[0].shouldForceUpdateAllAabbs; }, | 546 | (s) => { return ShouldForceUpdateAllAabbs; }, |
517 | (s,p,l,v) => { s.UnmanagedParams[0].shouldForceUpdateAllAabbs = v; } ), | 547 | (s,p,l,v) => { ShouldForceUpdateAllAabbs = v; s.UnmanagedParams[0].shouldForceUpdateAllAabbs = v; } ), |
518 | new ParameterDefn("ShouldRandomizeSolverOrder", "Enable for slightly better stacking interaction", | 548 | new ParameterDefn("ShouldRandomizeSolverOrder", "Enable for slightly better stacking interaction", |
519 | ConfigurationParameters.numericTrue, | 549 | ConfigurationParameters.numericTrue, |
520 | (s,cf,p,v) => { s.UnmanagedParams[0].shouldRandomizeSolverOrder = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, | 550 | (s,cf,p,v) => { ShouldRandomizeSolverOrder = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, |
521 | (s) => { return s.UnmanagedParams[0].shouldRandomizeSolverOrder; }, | 551 | (s) => { return ShouldRandomizeSolverOrder; }, |
522 | (s,p,l,v) => { s.UnmanagedParams[0].shouldRandomizeSolverOrder = v; } ), | 552 | (s,p,l,v) => { ShouldRandomizeSolverOrder = v; s.UnmanagedParams[0].shouldRandomizeSolverOrder = v; } ), |
523 | new ParameterDefn("ShouldSplitSimulationIslands", "Enable splitting active object scanning islands", | 553 | new ParameterDefn("ShouldSplitSimulationIslands", "Enable splitting active object scanning islands", |
524 | ConfigurationParameters.numericTrue, | 554 | ConfigurationParameters.numericTrue, |
525 | (s,cf,p,v) => { s.UnmanagedParams[0].shouldSplitSimulationIslands = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, | 555 | (s,cf,p,v) => { ShouldSplitSimulationIslands = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, |
526 | (s) => { return s.UnmanagedParams[0].shouldSplitSimulationIslands; }, | 556 | (s) => { return ShouldSplitSimulationIslands; }, |
527 | (s,p,l,v) => { s.UnmanagedParams[0].shouldSplitSimulationIslands = v; } ), | 557 | (s,p,l,v) => { ShouldSplitSimulationIslands = v; s.UnmanagedParams[0].shouldSplitSimulationIslands = v; } ), |
528 | new ParameterDefn("ShouldEnableFrictionCaching", "Enable friction computation caching", | 558 | new ParameterDefn("ShouldEnableFrictionCaching", "Enable friction computation caching", |
529 | ConfigurationParameters.numericTrue, | 559 | ConfigurationParameters.numericTrue, |
530 | (s,cf,p,v) => { s.UnmanagedParams[0].shouldEnableFrictionCaching = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, | 560 | (s,cf,p,v) => { ShouldEnableFrictionCaching = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, |
531 | (s) => { return s.UnmanagedParams[0].shouldEnableFrictionCaching; }, | 561 | (s) => { return ShouldEnableFrictionCaching; }, |
532 | (s,p,l,v) => { s.UnmanagedParams[0].shouldEnableFrictionCaching = v; } ), | 562 | (s,p,l,v) => { ShouldEnableFrictionCaching = v; s.UnmanagedParams[0].shouldEnableFrictionCaching = v; } ), |
533 | new ParameterDefn("NumberOfSolverIterations", "Number of internal iterations (0 means default)", | 563 | new ParameterDefn("NumberOfSolverIterations", "Number of internal iterations (0 means default)", |
534 | 0f, // zero says use Bullet default | 564 | 0f, // zero says use Bullet default |
535 | (s,cf,p,v) => { s.UnmanagedParams[0].numberOfSolverIterations = cf.GetFloat(p, v); }, | 565 | (s,cf,p,v) => { NumberOfSolverIterations = cf.GetFloat(p, v); }, |
536 | (s) => { return s.UnmanagedParams[0].numberOfSolverIterations; }, | 566 | (s) => { return NumberOfSolverIterations; }, |
537 | (s,p,l,v) => { s.UnmanagedParams[0].numberOfSolverIterations = v; } ), | 567 | (s,p,l,v) => { NumberOfSolverIterations = v; s.UnmanagedParams[0].numberOfSolverIterations = v; } ), |
568 | new ParameterDefn("UseSingleSidedMeshes", "Whether to compute collisions based on single sided meshes.", | ||
569 | ConfigurationParameters.numericTrue, | ||
570 | (s,cf,p,v) => { UseSingleSidedMeshesF = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, | ||
571 | (s) => { return UseSingleSidedMeshesF; }, | ||
572 | (s,p,l,v) => { UseSingleSidedMeshesF = v; s.UnmanagedParams[0].useSingleSidedMeshes = v; } ), | ||
538 | 573 | ||
539 | new ParameterDefn("LinksetImplementation", "Type of linkset implementation (0=Constraint, 1=Compound, 2=Manual)", | 574 | new ParameterDefn("LinksetImplementation", "Type of linkset implementation (0=Constraint, 1=Compound, 2=Manual)", |
540 | (float)BSLinkset.LinksetImplementation.Compound, | 575 | (float)BSLinkset.LinksetImplementation.Compound, |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index a4690ba..6cd72f2 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -882,41 +882,41 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
882 | BSParam.ParameterDefn theParam; | 882 | BSParam.ParameterDefn theParam; |
883 | if (BSParam.TryGetParameter(parm, out theParam)) | 883 | if (BSParam.TryGetParameter(parm, out theParam)) |
884 | { | 884 | { |
885 | // Set the value in the C# code | ||
885 | theParam.setter(this, parm, localID, val); | 886 | theParam.setter(this, parm, localID, val); |
887 | |||
888 | // Optionally set the parameter in the unmanaged code | ||
889 | if (theParam.onObject != null) | ||
890 | { | ||
891 | // update all the localIDs specified | ||
892 | // If the local ID is APPLY_TO_NONE, just change the default value | ||
893 | // If the localID is APPLY_TO_ALL change the default value and apply the new value to all the lIDs | ||
894 | // If the localID is a specific object, apply the parameter change to only that object | ||
895 | List<uint> objectIDs = new List<uint>(); | ||
896 | switch (localID) | ||
897 | { | ||
898 | case PhysParameterEntry.APPLY_TO_NONE: | ||
899 | // This will cause a call into the physical world if some operation is specified (SetOnObject). | ||
900 | objectIDs.Add(TERRAIN_ID); | ||
901 | TaintedUpdateParameter(parm, objectIDs, val); | ||
902 | break; | ||
903 | case PhysParameterEntry.APPLY_TO_ALL: | ||
904 | lock (PhysObjects) objectIDs = new List<uint>(PhysObjects.Keys); | ||
905 | TaintedUpdateParameter(parm, objectIDs, val); | ||
906 | break; | ||
907 | default: | ||
908 | // setting only one localID | ||
909 | objectIDs.Add(localID); | ||
910 | TaintedUpdateParameter(parm, objectIDs, val); | ||
911 | break; | ||
912 | } | ||
913 | } | ||
914 | |||
886 | ret = true; | 915 | ret = true; |
887 | } | 916 | } |
888 | return ret; | 917 | return ret; |
889 | } | 918 | } |
890 | 919 | ||
891 | // update all the localIDs specified | ||
892 | // If the local ID is APPLY_TO_NONE, just change the default value | ||
893 | // If the localID is APPLY_TO_ALL change the default value and apply the new value to all the lIDs | ||
894 | // If the localID is a specific object, apply the parameter change to only that object | ||
895 | internal delegate void AssignVal(float x); | ||
896 | internal void UpdateParameterObject(AssignVal setDefault, string parm, uint localID, float val) | ||
897 | { | ||
898 | List<uint> objectIDs = new List<uint>(); | ||
899 | switch (localID) | ||
900 | { | ||
901 | case PhysParameterEntry.APPLY_TO_NONE: | ||
902 | setDefault(val); // setting only the default value | ||
903 | // This will cause a call into the physical world if some operation is specified (SetOnObject). | ||
904 | objectIDs.Add(TERRAIN_ID); | ||
905 | TaintedUpdateParameter(parm, objectIDs, val); | ||
906 | break; | ||
907 | case PhysParameterEntry.APPLY_TO_ALL: | ||
908 | setDefault(val); // setting ALL also sets the default value | ||
909 | lock (PhysObjects) objectIDs = new List<uint>(PhysObjects.Keys); | ||
910 | TaintedUpdateParameter(parm, objectIDs, val); | ||
911 | break; | ||
912 | default: | ||
913 | // setting only one localID | ||
914 | objectIDs.Add(localID); | ||
915 | TaintedUpdateParameter(parm, objectIDs, val); | ||
916 | break; | ||
917 | } | ||
918 | } | ||
919 | |||
920 | // schedule the actual updating of the paramter to when the phys engine is not busy | 920 | // schedule the actual updating of the paramter to when the phys engine is not busy |
921 | private void TaintedUpdateParameter(string parm, List<uint> lIDs, float val) | 921 | private void TaintedUpdateParameter(string parm, List<uint> lIDs, float val) |
922 | { | 922 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs index 37bccbc..07e34ab 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs | |||
@@ -602,8 +602,8 @@ public sealed class BSShapeCollection : IDisposable | |||
602 | if (newMeshKey == prim.PhysShape.shapeKey && prim.PhysShape.type == BSPhysicsShapeType.SHAPE_MESH) | 602 | if (newMeshKey == prim.PhysShape.shapeKey && prim.PhysShape.type == BSPhysicsShapeType.SHAPE_MESH) |
603 | return false; | 603 | return false; |
604 | 604 | ||
605 | if (DDetail) DetailLog("{0},BSShapeCollection.GetReferenceToMesh,create,oldKey={1},newKey={2}", | 605 | if (DDetail) DetailLog("{0},BSShapeCollection.GetReferenceToMesh,create,oldKey={1},newKey={2},size={3},lod={4}", |
606 | prim.LocalID, prim.PhysShape.shapeKey.ToString("X"), newMeshKey.ToString("X")); | 606 | prim.LocalID, prim.PhysShape.shapeKey.ToString("X"), newMeshKey.ToString("X"), prim.Size, lod); |
607 | 607 | ||
608 | // Since we're recreating new, get rid of the reference to the previous shape | 608 | // Since we're recreating new, get rid of the reference to the previous shape |
609 | DereferenceShape(prim.PhysShape, shapeCallback); | 609 | DereferenceShape(prim.PhysShape, shapeCallback); |
@@ -622,7 +622,6 @@ public sealed class BSShapeCollection : IDisposable | |||
622 | private BulletShape CreatePhysicalMesh(string objName, System.UInt64 newMeshKey, PrimitiveBaseShape pbs, OMV.Vector3 size, float lod) | 622 | private BulletShape CreatePhysicalMesh(string objName, System.UInt64 newMeshKey, PrimitiveBaseShape pbs, OMV.Vector3 size, float lod) |
623 | { | 623 | { |
624 | BulletShape newShape = new BulletShape(); | 624 | BulletShape newShape = new BulletShape(); |
625 | IMesh meshData = null; | ||
626 | 625 | ||
627 | MeshDesc meshDesc; | 626 | MeshDesc meshDesc; |
628 | if (Meshes.TryGetValue(newMeshKey, out meshDesc)) | 627 | if (Meshes.TryGetValue(newMeshKey, out meshDesc)) |
@@ -632,27 +631,55 @@ public sealed class BSShapeCollection : IDisposable | |||
632 | } | 631 | } |
633 | else | 632 | else |
634 | { | 633 | { |
635 | meshData = PhysicsScene.mesher.CreateMesh(objName, pbs, size, lod, true, false, false, false); | 634 | IMesh meshData = PhysicsScene.mesher.CreateMesh(objName, pbs, size, lod, |
635 | true, | ||
636 | false, // say it is not physical so a bounding box is not built | ||
637 | false, // do not cache the mesh and do not use previously built versions | ||
638 | false // It's NOT for ODE | ||
639 | ); | ||
636 | 640 | ||
637 | if (meshData != null) | 641 | if (meshData != null) |
638 | { | 642 | { |
643 | |||
639 | int[] indices = meshData.getIndexListAsInt(); | 644 | int[] indices = meshData.getIndexListAsInt(); |
640 | List<OMV.Vector3> vertices = meshData.getVertexList(); | 645 | int realIndicesIndex = indices.Length; |
646 | float[] verticesAsFloats = meshData.getVertexListAsFloat(); | ||
641 | 647 | ||
642 | float[] verticesAsFloats = new float[vertices.Count * 3]; | 648 | if (BSParam.ShouldRemoveZeroWidthTriangles) |
643 | int vi = 0; | ||
644 | foreach (OMV.Vector3 vv in vertices) | ||
645 | { | 649 | { |
646 | verticesAsFloats[vi++] = vv.X; | 650 | // Remove degenerate triangles. These are triangles with two of the vertices |
647 | verticesAsFloats[vi++] = vv.Y; | 651 | // are the same. This is complicated by the problem that vertices are not |
648 | verticesAsFloats[vi++] = vv.Z; | 652 | // made unique in sculpties so we have to compare the values in the vertex. |
653 | realIndicesIndex = 0; | ||
654 | for (int tri = 0; tri < indices.Length; tri += 3) | ||
655 | { | ||
656 | int v1 = indices[tri + 0] * 3; | ||
657 | int v2 = indices[tri + 1] * 3; | ||
658 | int v3 = indices[tri + 2] * 3; | ||
659 | if (!((verticesAsFloats[v1 + 0] == verticesAsFloats[v2 + 0] | ||
660 | && verticesAsFloats[v1 + 1] == verticesAsFloats[v2 + 1] | ||
661 | && verticesAsFloats[v1 + 2] == verticesAsFloats[v2 + 2]) | ||
662 | || (verticesAsFloats[v2 + 0] == verticesAsFloats[v3 + 0] | ||
663 | && verticesAsFloats[v2 + 1] == verticesAsFloats[v3 + 1] | ||
664 | && verticesAsFloats[v2 + 2] == verticesAsFloats[v3 + 2]) | ||
665 | || (verticesAsFloats[v1 + 0] == verticesAsFloats[v3 + 0] | ||
666 | && verticesAsFloats[v1 + 1] == verticesAsFloats[v3 + 1] | ||
667 | && verticesAsFloats[v1 + 2] == verticesAsFloats[v3 + 2])) | ||
668 | ) | ||
669 | { | ||
670 | // None of the vertices of the triangles are the same. This is a good triangle; | ||
671 | indices[realIndicesIndex + 0] = indices[tri + 0]; | ||
672 | indices[realIndicesIndex + 1] = indices[tri + 1]; | ||
673 | indices[realIndicesIndex + 2] = indices[tri + 2]; | ||
674 | realIndicesIndex += 3; | ||
675 | } | ||
676 | } | ||
649 | } | 677 | } |
650 | 678 | DetailLog("{0},BSShapeCollection.CreatePhysicalMesh,origTri={1},realTri={2},numVerts={3}", | |
651 | // m_log.DebugFormat("{0}: BSShapeCollection.CreatePhysicalMesh: calling CreateMesh. lid={1}, key={2}, indices={3}, vertices={4}", | 679 | BSScene.DetailLogZero, indices.Length / 3, realIndicesIndex / 3, verticesAsFloats.Length / 3); |
652 | // LogHeader, prim.LocalID, newMeshKey, indices.Length, vertices.Count); | ||
653 | 680 | ||
654 | newShape = PhysicsScene.PE.CreateMeshShape(PhysicsScene.World, | 681 | newShape = PhysicsScene.PE.CreateMeshShape(PhysicsScene.World, |
655 | indices.GetLength(0), indices, vertices.Count, verticesAsFloats); | 682 | realIndicesIndex, indices, verticesAsFloats.Length/3, verticesAsFloats); |
656 | } | 683 | } |
657 | } | 684 | } |
658 | newShape.shapeKey = newMeshKey; | 685 | newShape.shapeKey = newMeshKey; |
@@ -831,6 +858,11 @@ public sealed class BSShapeCollection : IDisposable | |||
831 | { | 858 | { |
832 | // level of detail based on size and type of the object | 859 | // level of detail based on size and type of the object |
833 | float lod = BSParam.MeshLOD; | 860 | float lod = BSParam.MeshLOD; |
861 | |||
862 | // prims with curvy internal cuts need higher lod | ||
863 | if (pbs.HollowShape == HollowShape.Circle) | ||
864 | lod = BSParam.MeshCircularLOD; | ||
865 | |||
834 | if (pbs.SculptEntry) | 866 | if (pbs.SculptEntry) |
835 | lod = BSParam.SculptLOD; | 867 | lod = BSParam.SculptLOD; |
836 | 868 | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs index 8244f02..d7e800d 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs | |||
@@ -96,7 +96,7 @@ public sealed class BSTerrainMesh : BSTerrainPhys | |||
96 | { | 96 | { |
97 | // DISASTER!! | 97 | // DISASTER!! |
98 | PhysicsScene.DetailLog("{0},BSTerrainMesh.create,failedCreationOfShape", ID); | 98 | PhysicsScene.DetailLog("{0},BSTerrainMesh.create,failedCreationOfShape", ID); |
99 | physicsScene.Logger.ErrorFormat("{0} Failed creation of terrain mesh! base={1}", LogHeader, TerrainBase); | 99 | PhysicsScene.Logger.ErrorFormat("{0} Failed creation of terrain mesh! base={1}", LogHeader, TerrainBase); |
100 | // Something is very messed up and a crash is in our future. | 100 | // Something is very messed up and a crash is in our future. |
101 | return; | 101 | return; |
102 | } | 102 | } |
@@ -108,7 +108,7 @@ public sealed class BSTerrainMesh : BSTerrainPhys | |||
108 | if (!m_terrainBody.HasPhysicalBody) | 108 | if (!m_terrainBody.HasPhysicalBody) |
109 | { | 109 | { |
110 | // DISASTER!! | 110 | // DISASTER!! |
111 | physicsScene.Logger.ErrorFormat("{0} Failed creation of terrain body! base={1}", LogHeader, TerrainBase); | 111 | PhysicsScene.Logger.ErrorFormat("{0} Failed creation of terrain body! base={1}", LogHeader, TerrainBase); |
112 | // Something is very messed up and a crash is in our future. | 112 | // Something is very messed up and a crash is in our future. |
113 | return; | 113 | return; |
114 | } | 114 | } |
@@ -131,6 +131,12 @@ public sealed class BSTerrainMesh : BSTerrainPhys | |||
131 | m_terrainBody.collisionType = CollisionType.Terrain; | 131 | m_terrainBody.collisionType = CollisionType.Terrain; |
132 | m_terrainBody.ApplyCollisionMask(PhysicsScene); | 132 | m_terrainBody.ApplyCollisionMask(PhysicsScene); |
133 | 133 | ||
134 | if (BSParam.UseSingleSidedMeshes) | ||
135 | { | ||
136 | PhysicsScene.DetailLog("{0},BSTerrainMesh.settingCustomMaterial", id); | ||
137 | PhysicsScene.PE.AddToCollisionFlags(m_terrainBody, CollisionFlags.CF_CUSTOM_MATERIAL_CALLBACK); | ||
138 | } | ||
139 | |||
134 | // Make it so the terrain will not move or be considered for movement. | 140 | // Make it so the terrain will not move or be considered for movement. |
135 | PhysicsScene.PE.ForceActivationState(m_terrainBody, ActivationState.DISABLE_SIMULATION); | 141 | PhysicsScene.PE.ForceActivationState(m_terrainBody, ActivationState.DISABLE_SIMULATION); |
136 | } | 142 | } |
@@ -176,8 +182,7 @@ public sealed class BSTerrainMesh : BSTerrainPhys | |||
176 | 182 | ||
177 | // Convert the passed heightmap to mesh information suitable for CreateMeshShape2(). | 183 | // Convert the passed heightmap to mesh information suitable for CreateMeshShape2(). |
178 | // Return 'true' if successfully created. | 184 | // Return 'true' if successfully created. |
179 | public static bool ConvertHeightmapToMesh( | 185 | public static bool ConvertHeightmapToMesh( BSScene physicsScene, |
180 | BSScene physicsScene, | ||
181 | float[] heightMap, int sizeX, int sizeY, // parameters of incoming heightmap | 186 | float[] heightMap, int sizeX, int sizeY, // parameters of incoming heightmap |
182 | float extentX, float extentY, // zero based range for output vertices | 187 | float extentX, float extentY, // zero based range for output vertices |
183 | Vector3 extentBase, // base to be added to all vertices | 188 | Vector3 extentBase, // base to be added to all vertices |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs index c7a2f7e..8012d91 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs | |||
@@ -217,6 +217,10 @@ public static class BulletSimData | |||
217 | { | 217 | { |
218 | 218 | ||
219 | // Map of collisionTypes to flags for collision groups and masks. | 219 | // Map of collisionTypes to flags for collision groups and masks. |
220 | // An object's 'group' is the collison groups this object belongs to | ||
221 | // An object's 'filter' is the groups another object has to belong to in order to collide with me | ||
222 | // A collision happens if ((obj1.group & obj2.filter) != 0) || ((obj2.group & obj1.filter) != 0) | ||
223 | // | ||
220 | // As mentioned above, don't use the CollisionFilterGroups definitions directly in the code | 224 | // As mentioned above, don't use the CollisionFilterGroups definitions directly in the code |
221 | // but, instead, use references to this dictionary. Finding and debugging | 225 | // but, instead, use references to this dictionary. Finding and debugging |
222 | // collision flag problems will be made easier. | 226 | // collision flag problems will be made easier. |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt index a3b3556..bda7c47 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt | |||
@@ -65,6 +65,8 @@ Vehicle attributes are not restored when a vehicle is rezzed on region creation | |||
65 | 65 | ||
66 | GENERAL TODO LIST: | 66 | GENERAL TODO LIST: |
67 | ================================================= | 67 | ================================================= |
68 | Level-of-detail for mesh creation. Prims with circular interiors require lod of 32. | ||
69 | Is much saved with lower LODs? At the moment, all set to 32. | ||
68 | Collisions are inconsistant: arrows are supposed to hit and report collision. Often don't. | 70 | Collisions are inconsistant: arrows are supposed to hit and report collision. Often don't. |
69 | If arrow show at prim, collision reported about 1/3 of time. If collision reported, | 71 | If arrow show at prim, collision reported about 1/3 of time. If collision reported, |
70 | both arrow and prim report it. The arrow bounces off the prim 9 out of 10 times. | 72 | both arrow and prim report it. The arrow bounces off the prim 9 out of 10 times. |
@@ -128,6 +130,9 @@ Physical and phantom will drop through the terrain | |||
128 | LINKSETS | 130 | LINKSETS |
129 | ====================================================== | 131 | ====================================================== |
130 | Child prims do not report collisions | 132 | Child prims do not report collisions |
133 | Allow children of a linkset to be phantom: | ||
134 | http://opensim-dev.2196679.n2.nabble.com/Setting-a-single-child-prim-to-Phantom-tp7578513.html | ||
135 | Add OS_STATUS_PHANTOM_PRIM to llSetLinkPrimitaveParamsFast. | ||
131 | Editing a child of a linkset causes the child to go phantom | 136 | Editing a child of a linkset causes the child to go phantom |
132 | Move a child prim once when it is physical and can never move it again without it going phantom | 137 | Move a child prim once when it is physical and can never move it again without it going phantom |
133 | Offset the center of the linkset to be the geometric center of all the prims | 138 | Offset the center of the linkset to be the geometric center of all the prims |
diff --git a/OpenSim/Region/Physics/Manager/IMesher.cs b/OpenSim/Region/Physics/Manager/IMesher.cs index df980ab..5485eb7 100644 --- a/OpenSim/Region/Physics/Manager/IMesher.cs +++ b/OpenSim/Region/Physics/Manager/IMesher.cs | |||
@@ -83,6 +83,7 @@ namespace OpenSim.Region.Physics.Manager | |||
83 | List<Vector3> getVertexList(); | 83 | List<Vector3> getVertexList(); |
84 | int[] getIndexListAsInt(); | 84 | int[] getIndexListAsInt(); |
85 | int[] getIndexListAsIntLocked(); | 85 | int[] getIndexListAsIntLocked(); |
86 | float[] getVertexListAsFloat(); | ||
86 | float[] getVertexListAsFloatLocked(); | 87 | float[] getVertexListAsFloatLocked(); |
87 | void getIndexListAsPtrToIntArray(out IntPtr indices, out int triStride, out int indexCount); | 88 | void getIndexListAsPtrToIntArray(out IntPtr indices, out int triStride, out int indexCount); |
88 | void getVertexListAsPtrToFloatArray(out IntPtr vertexList, out int vertexStride, out int vertexCount); | 89 | void getVertexListAsPtrToFloatArray(out IntPtr vertexList, out int vertexStride, out int vertexCount); |
diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs index 6970553..e6b32e7 100644 --- a/OpenSim/Region/Physics/Meshing/Mesh.cs +++ b/OpenSim/Region/Physics/Meshing/Mesh.cs | |||
@@ -226,7 +226,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
226 | return result; | 226 | return result; |
227 | } | 227 | } |
228 | 228 | ||
229 | private float[] getVertexListAsFloat() | 229 | public float[] getVertexListAsFloat() |
230 | { | 230 | { |
231 | if (m_vertices == null) | 231 | if (m_vertices == null) |
232 | throw new NotSupportedException(); | 232 | throw new NotSupportedException(); |
diff --git a/OpenSim/Region/Physics/UbitMeshing/Mesh.cs b/OpenSim/Region/Physics/UbitMeshing/Mesh.cs index b67422f..fa06926 100644 --- a/OpenSim/Region/Physics/UbitMeshing/Mesh.cs +++ b/OpenSim/Region/Physics/UbitMeshing/Mesh.cs | |||
@@ -301,7 +301,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
301 | return result; | 301 | return result; |
302 | } | 302 | } |
303 | 303 | ||
304 | private float[] getVertexListAsFloat() | 304 | public float[] getVertexListAsFloat() |
305 | { | 305 | { |
306 | if (m_bdata.m_vertices == null) | 306 | if (m_bdata.m_vertices == null) |
307 | throw new NotSupportedException(); | 307 | throw new NotSupportedException(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f4a812c..8be39a7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -48,6 +48,7 @@ using OpenSim.Region.Framework.Interfaces; | |||
48 | using OpenSim.Region.Framework.Scenes; | 48 | using OpenSim.Region.Framework.Scenes; |
49 | using OpenSim.Region.Framework.Scenes.Serialization; | 49 | using OpenSim.Region.Framework.Scenes.Serialization; |
50 | using OpenSim.Region.Framework.Scenes.Animation; | 50 | using OpenSim.Region.Framework.Scenes.Animation; |
51 | using OpenSim.Region.Framework.Scenes.Scripting; | ||
51 | using OpenSim.Region.Physics.Manager; | 52 | using OpenSim.Region.Physics.Manager; |
52 | using OpenSim.Region.ScriptEngine.Shared; | 53 | using OpenSim.Region.ScriptEngine.Shared; |
53 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; | 54 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; |
@@ -423,79 +424,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
423 | } | 424 | } |
424 | } | 425 | } |
425 | 426 | ||
426 | protected UUID InventoryKey(string name, int type) | ||
427 | { | ||
428 | TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name); | ||
429 | |||
430 | if (item != null && item.Type == type) | ||
431 | return item.AssetID; | ||
432 | else | ||
433 | return UUID.Zero; | ||
434 | } | ||
435 | |||
436 | /// <summary> | ||
437 | /// accepts a valid UUID, -or- a name of an inventory item. | ||
438 | /// Returns a valid UUID or UUID.Zero if key invalid and item not found | ||
439 | /// in prim inventory. | ||
440 | /// </summary> | ||
441 | /// <param name="k"></param> | ||
442 | /// <returns></returns> | ||
443 | protected UUID KeyOrName(string k) | ||
444 | { | ||
445 | UUID key; | ||
446 | |||
447 | // if we can parse the string as a key, use it. | ||
448 | // else try to locate the name in inventory of object. found returns key, | ||
449 | // not found returns UUID.Zero | ||
450 | if (!UUID.TryParse(k, out key)) | ||
451 | { | ||
452 | TaskInventoryItem item = m_host.Inventory.GetInventoryItem(k); | ||
453 | |||
454 | if (item != null) | ||
455 | key = item.AssetID; | ||
456 | else | ||
457 | key = UUID.Zero; | ||
458 | } | ||
459 | |||
460 | return key; | ||
461 | } | ||
462 | |||
463 | /// <summary> | ||
464 | /// Return the UUID of the asset matching the specified key or name | ||
465 | /// and asset type. | ||
466 | /// </summary> | ||
467 | /// <param name="k"></param> | ||
468 | /// <param name="type"></param> | ||
469 | /// <returns></returns> | ||
470 | protected UUID KeyOrName(string k, AssetType type) | ||
471 | { | ||
472 | UUID key; | ||
473 | |||
474 | if (!UUID.TryParse(k, out key)) | ||
475 | { | ||
476 | TaskInventoryItem item = m_host.Inventory.GetInventoryItem(k); | ||
477 | if (item != null && item.Type == (int)type) | ||
478 | key = item.AssetID; | ||
479 | } | ||
480 | else | ||
481 | { | ||
482 | lock (m_host.TaskInventory) | ||
483 | { | ||
484 | foreach (KeyValuePair<UUID, TaskInventoryItem> item in m_host.TaskInventory) | ||
485 | { | ||
486 | if (item.Value.Type == (int)type && item.Value.Name == k) | ||
487 | { | ||
488 | key = item.Value.ItemID; | ||
489 | break; | ||
490 | } | ||
491 | } | ||
492 | } | ||
493 | } | ||
494 | |||
495 | |||
496 | return key; | ||
497 | } | ||
498 | |||
499 | //These are the implementations of the various ll-functions used by the LSL scripts. | 427 | //These are the implementations of the various ll-functions used by the LSL scripts. |
500 | public LSL_Float llSin(double f) | 428 | public LSL_Float llSin(double f) |
501 | { | 429 | { |
@@ -2035,7 +1963,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2035 | 1963 | ||
2036 | UUID textureID = new UUID(); | 1964 | UUID textureID = new UUID(); |
2037 | 1965 | ||
2038 | textureID = InventoryKey(texture, (int)AssetType.Texture); | 1966 | textureID = ScriptUtils.GetAssetIdFromItemName(m_host, texture, (int)AssetType.Texture); |
2039 | if (textureID == UUID.Zero) | 1967 | if (textureID == UUID.Zero) |
2040 | { | 1968 | { |
2041 | if (!UUID.TryParse(texture, out textureID)) | 1969 | if (!UUID.TryParse(texture, out textureID)) |
@@ -2751,7 +2679,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2751 | if (m_SoundModule != null) | 2679 | if (m_SoundModule != null) |
2752 | { | 2680 | { |
2753 | m_SoundModule.SendSound(m_host.UUID, | 2681 | m_SoundModule.SendSound(m_host.UUID, |
2754 | KeyOrName(sound, AssetType.Sound), volume, false, 0, | 2682 | ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound), volume, false, 0, |
2755 | 0, false, false); | 2683 | 0, false, false); |
2756 | } | 2684 | } |
2757 | } | 2685 | } |
@@ -2761,7 +2689,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2761 | m_host.AddScriptLPS(1); | 2689 | m_host.AddScriptLPS(1); |
2762 | if (m_SoundModule != null) | 2690 | if (m_SoundModule != null) |
2763 | { | 2691 | { |
2764 | m_SoundModule.LoopSound(m_host.UUID, KeyOrName(sound), | 2692 | m_SoundModule.LoopSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound), |
2765 | volume, 20, false); | 2693 | volume, 20, false); |
2766 | } | 2694 | } |
2767 | } | 2695 | } |
@@ -2771,7 +2699,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2771 | m_host.AddScriptLPS(1); | 2699 | m_host.AddScriptLPS(1); |
2772 | if (m_SoundModule != null) | 2700 | if (m_SoundModule != null) |
2773 | { | 2701 | { |
2774 | m_SoundModule.LoopSound(m_host.UUID, KeyOrName(sound), | 2702 | m_SoundModule.LoopSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound), |
2775 | volume, 20, true); | 2703 | volume, 20, true); |
2776 | } | 2704 | } |
2777 | } | 2705 | } |
@@ -2793,7 +2721,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2793 | if (m_SoundModule != null) | 2721 | if (m_SoundModule != null) |
2794 | { | 2722 | { |
2795 | m_SoundModule.SendSound(m_host.UUID, | 2723 | m_SoundModule.SendSound(m_host.UUID, |
2796 | KeyOrName(sound, AssetType.Sound), volume, false, 0, | 2724 | ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound), volume, false, 0, |
2797 | 0, true, false); | 2725 | 0, true, false); |
2798 | } | 2726 | } |
2799 | } | 2727 | } |
@@ -2805,7 +2733,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2805 | if (m_SoundModule != null) | 2733 | if (m_SoundModule != null) |
2806 | { | 2734 | { |
2807 | m_SoundModule.SendSound(m_host.UUID, | 2735 | m_SoundModule.SendSound(m_host.UUID, |
2808 | KeyOrName(sound, AssetType.Sound), volume, true, 0, 0, | 2736 | ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound), volume, true, 0, 0, |
2809 | false, false); | 2737 | false, false); |
2810 | } | 2738 | } |
2811 | } | 2739 | } |
@@ -2822,7 +2750,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2822 | { | 2750 | { |
2823 | m_host.AddScriptLPS(1); | 2751 | m_host.AddScriptLPS(1); |
2824 | if (m_SoundModule != null) | 2752 | if (m_SoundModule != null) |
2825 | m_SoundModule.PreloadSound(m_host.UUID, KeyOrName(sound), 0); | 2753 | m_SoundModule.PreloadSound(m_host.UUID, ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound), 0); |
2826 | ScriptSleep(1000); | 2754 | ScriptSleep(1000); |
2827 | } | 2755 | } |
2828 | 2756 | ||
@@ -3699,7 +3627,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3699 | if (presence != null) | 3627 | if (presence != null) |
3700 | { | 3628 | { |
3701 | // Do NOT try to parse UUID, animations cannot be triggered by ID | 3629 | // Do NOT try to parse UUID, animations cannot be triggered by ID |
3702 | UUID animID = InventoryKey(anim, (int)AssetType.Animation); | 3630 | UUID animID = ScriptUtils.GetAssetIdFromItemName(m_host, anim, (int)AssetType.Animation); |
3703 | if (animID == UUID.Zero) | 3631 | if (animID == UUID.Zero) |
3704 | presence.Animator.AddAnimation(anim, m_host.UUID); | 3632 | presence.Animator.AddAnimation(anim, m_host.UUID); |
3705 | else | 3633 | else |
@@ -3721,7 +3649,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3721 | 3649 | ||
3722 | if (presence != null) | 3650 | if (presence != null) |
3723 | { | 3651 | { |
3724 | UUID animID = KeyOrName(anim); | 3652 | UUID animID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, anim); |
3725 | 3653 | ||
3726 | if (animID == UUID.Zero) | 3654 | if (animID == UUID.Zero) |
3727 | presence.Animator.RemoveAnimation(anim); | 3655 | presence.Animator.RemoveAnimation(anim); |
@@ -4717,7 +4645,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4717 | 4645 | ||
4718 | private void DoLLTeleport(ScenePresence sp, string destination, Vector3 targetPos, Vector3 targetLookAt) | 4646 | private void DoLLTeleport(ScenePresence sp, string destination, Vector3 targetPos, Vector3 targetLookAt) |
4719 | { | 4647 | { |
4720 | UUID assetID = KeyOrName(destination); | 4648 | UUID assetID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, destination); |
4721 | 4649 | ||
4722 | // The destinaion is not an asset ID and also doesn't name a landmark. | 4650 | // The destinaion is not an asset ID and also doesn't name a landmark. |
4723 | // Use it as a sim name | 4651 | // Use it as a sim name |
@@ -4791,7 +4719,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4791 | return; | 4719 | return; |
4792 | } | 4720 | } |
4793 | // TODO: Parameter check logic required. | 4721 | // TODO: Parameter check logic required. |
4794 | m_host.CollisionSound = KeyOrName(impact_sound, AssetType.Sound); | 4722 | m_host.CollisionSound = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, impact_sound, AssetType.Sound); |
4795 | m_host.CollisionSoundVolume = (float)impact_volume; | 4723 | m_host.CollisionSoundVolume = (float)impact_volume; |
4796 | m_host.CollisionSoundType = 1; | 4724 | m_host.CollisionSoundType = 1; |
4797 | } | 4725 | } |
@@ -6356,7 +6284,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6356 | if (m_SoundModule != null) | 6284 | if (m_SoundModule != null) |
6357 | { | 6285 | { |
6358 | m_SoundModule.TriggerSoundLimited(m_host.UUID, | 6286 | m_SoundModule.TriggerSoundLimited(m_host.UUID, |
6359 | KeyOrName(sound, AssetType.Sound), volume, | 6287 | ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, sound, AssetType.Sound), volume, |
6360 | bottom_south_west, top_north_east); | 6288 | bottom_south_west, top_north_east); |
6361 | } | 6289 | } |
6362 | } | 6290 | } |
@@ -6827,7 +6755,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6827 | break; | 6755 | break; |
6828 | 6756 | ||
6829 | case (int)ScriptBaseClass.PSYS_SRC_TEXTURE: | 6757 | case (int)ScriptBaseClass.PSYS_SRC_TEXTURE: |
6830 | prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1)); | 6758 | prules.Texture = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, rules.GetLSLStringItem(i + 1)); |
6831 | break; | 6759 | break; |
6832 | 6760 | ||
6833 | case (int)ScriptBaseClass.PSYS_SRC_BURST_RATE: | 6761 | case (int)ScriptBaseClass.PSYS_SRC_BURST_RATE: |
@@ -7776,9 +7704,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7776 | UUID sculptId; | 7704 | UUID sculptId; |
7777 | 7705 | ||
7778 | if (!UUID.TryParse(map, out sculptId)) | 7706 | if (!UUID.TryParse(map, out sculptId)) |
7779 | { | 7707 | sculptId = ScriptUtils.GetAssetIdFromItemName(m_host, map, (int)AssetType.Texture); |
7780 | sculptId = InventoryKey(map, (int)AssetType.Texture); | ||
7781 | } | ||
7782 | 7708 | ||
7783 | if (sculptId == UUID.Zero) | 7709 | if (sculptId == UUID.Zero) |
7784 | return; | 7710 | return; |
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 95c2935..a4f1bba 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs | |||
@@ -564,7 +564,7 @@ namespace OpenSim.Services.UserAccountService | |||
564 | return account; | 564 | return account; |
565 | } | 565 | } |
566 | 566 | ||
567 | private void CreateDefaultAppearanceEntries(UUID principalID) | 567 | protected void CreateDefaultAppearanceEntries(UUID principalID) |
568 | { | 568 | { |
569 | m_log.DebugFormat("[USER ACCOUNT SERVICE]: Creating default appearance items for {0}", principalID); | 569 | m_log.DebugFormat("[USER ACCOUNT SERVICE]: Creating default appearance items for {0}", principalID); |
570 | 570 | ||
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 2edc1f8..6409cdb 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini | |||
@@ -912,13 +912,9 @@ | |||
912 | 912 | ||
913 | ; Terrain Implementation {1|0} 0 for HeightField, 1 for Mesh terrain. If you're using the bulletxna engine, | 913 | ; Terrain Implementation {1|0} 0 for HeightField, 1 for Mesh terrain. If you're using the bulletxna engine, |
914 | ; you will want to switch to the heightfield option | 914 | ; you will want to switch to the heightfield option |
915 | |||
916 | TerrainImplementation = 1 | 915 | TerrainImplementation = 1 |
917 | ; TerrainImplementation = 0 | 916 | ; TerrainImplementation = 0 |
918 | 917 | ||
919 | DefaultFriction = 0.20 | ||
920 | DefaultDensity = 10.000006836 | ||
921 | DefaultRestitution = 0.0 | ||
922 | Gravity = -9.80665 | 918 | Gravity = -9.80665 |
923 | 919 | ||
924 | TerrainFriction = 0.30 | 920 | TerrainFriction = 0.30 |
@@ -927,7 +923,7 @@ | |||
927 | TerrainCollisionMargin = 0.04 | 923 | TerrainCollisionMargin = 0.04 |
928 | 924 | ||
929 | AvatarFriction = 0.2 | 925 | AvatarFriction = 0.2 |
930 | AvatarStandingFriction = 10.0 | 926 | AvatarStandingFriction = 0.95 |
931 | AvatarRestitution = 0.0 | 927 | AvatarRestitution = 0.0 |
932 | AvatarDensity = 3.5 | 928 | AvatarDensity = 3.5 |
933 | AvatarCapsuleWidth = 0.6 | 929 | AvatarCapsuleWidth = 0.6 |
@@ -939,7 +935,7 @@ | |||
939 | 935 | ||
940 | CollisionMargin = 0.04 | 936 | CollisionMargin = 0.04 |
941 | 937 | ||
942 | ; Linkset constraint parameters | 938 | ; Linkset implmentation |
943 | LinkImplementation = 1 ; 0=constraint, 1=compound | 939 | LinkImplementation = 1 ; 0=constraint, 1=compound |
944 | 940 | ||
945 | ; Whether to mesh sculpties | 941 | ; Whether to mesh sculpties |
@@ -948,14 +944,6 @@ | |||
948 | ; If 'true', force simple prims (box and sphere) to be meshed | 944 | ; If 'true', force simple prims (box and sphere) to be meshed |
949 | ForceSimplePrimMeshing = false | 945 | ForceSimplePrimMeshing = false |
950 | 946 | ||
951 | ; level of detail for physical meshes. 32,16,8 or 4 with 32 being full detail | ||
952 | MeshLevelOfDetail = 8 | ||
953 | ; if mesh size is > threshold meters, we need to add more detail because people will notice | ||
954 | MeshLevelOfDetailMegaPrimThreshold = 10 | ||
955 | MeshLevelOfDetailMegaPrim = 16 | ||
956 | ; number^2 non-physical level of detail of the sculpt texture. 32x32 - 1024 verticies | ||
957 | SculptLevelOfDetail = 32 | ||
958 | |||
959 | ; Bullet step parameters | 947 | ; Bullet step parameters |
960 | MaxSubSteps = 10 | 948 | MaxSubSteps = 10 |
961 | FixedTimeStep = .01667 | 949 | FixedTimeStep = .01667 |
diff --git a/bin/lib32/BulletSim.dll b/bin/lib32/BulletSim.dll index 24dffac..de4f95a 100755 --- a/bin/lib32/BulletSim.dll +++ b/bin/lib32/BulletSim.dll | |||
Binary files differ | |||
diff --git a/bin/lib32/libBulletSim.so b/bin/lib32/libBulletSim.so index 7e3ed20..674a08a 100755 --- a/bin/lib32/libBulletSim.so +++ b/bin/lib32/libBulletSim.so | |||
Binary files differ | |||
diff --git a/bin/lib64/BulletSim.dll b/bin/lib64/BulletSim.dll index 808f433..1c55b19 100755 --- a/bin/lib64/BulletSim.dll +++ b/bin/lib64/BulletSim.dll | |||
Binary files differ | |||
diff --git a/bin/lib64/libBulletSim.so b/bin/lib64/libBulletSim.so index 9382751..e2fc8bd 100755 --- a/bin/lib64/libBulletSim.so +++ b/bin/lib64/libBulletSim.so | |||
Binary files differ | |||