diff options
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r-- | OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs | 33 | ||||
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsActor.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsScene.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | 28 |
6 files changed, 73 insertions, 13 deletions
diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs index 3ed3b5a..42a408e 100644 --- a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs | |||
@@ -131,6 +131,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
131 | public bool m_disabled; | 131 | public bool m_disabled; |
132 | public bool m_taintadd; | 132 | public bool m_taintadd; |
133 | public bool m_taintselected; | 133 | public bool m_taintselected; |
134 | public bool m_taintphantom; | ||
134 | public bool m_taintCollidesWater; | 135 | public bool m_taintCollidesWater; |
135 | 136 | ||
136 | public uint m_localID; | 137 | public uint m_localID; |
@@ -161,6 +162,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
161 | 162 | ||
162 | private bool iscolliding; | 163 | private bool iscolliding; |
163 | private bool m_isphysical; | 164 | private bool m_isphysical; |
165 | private bool m_isphantom; | ||
164 | private bool m_isSelected; | 166 | private bool m_isSelected; |
165 | 167 | ||
166 | private bool m_NoColide; // for now only for internal use for bad meshs | 168 | private bool m_NoColide; // for now only for internal use for bad meshs |
@@ -311,8 +313,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
311 | m_taintvehicledata = vdata; | 313 | m_taintvehicledata = vdata; |
312 | _parent_scene.AddPhysicsActorTaint(this); | 314 | _parent_scene.AddPhysicsActorTaint(this); |
313 | } | 315 | } |
316 | |||
314 | public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, | 317 | public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, |
315 | Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode, uint localid) | 318 | Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical,bool pisPhantom, CollisionLocker dode, uint localid) |
316 | { | 319 | { |
317 | m_localID = localid; | 320 | m_localID = localid; |
318 | ode = dode; | 321 | ode = dode; |
@@ -373,6 +376,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
373 | m_targetSpace = _parent_scene.space; | 376 | m_targetSpace = _parent_scene.space; |
374 | } | 377 | } |
375 | 378 | ||
379 | m_isphantom = pisPhantom; | ||
380 | m_taintphantom = pisPhantom; | ||
381 | |||
376 | _triMeshData = IntPtr.Zero; | 382 | _triMeshData = IntPtr.Zero; |
377 | m_NoColide = false; | 383 | m_NoColide = false; |
378 | 384 | ||
diff --git a/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs index 05f6fae..ea89d87 100644 --- a/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs | |||
@@ -1730,7 +1730,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1730 | OdePrim newPrim; | 1730 | OdePrim newPrim; |
1731 | lock (OdeLock) | 1731 | lock (OdeLock) |
1732 | { | 1732 | { |
1733 | newPrim = new OdePrim(name, this, pos, siz, rot, mesh, pbs, isphysical, ode, localid); | 1733 | newPrim = new OdePrim(name, this, pos, siz, rot, mesh, pbs, isphysical,false, ode, localid); |
1734 | 1734 | ||
1735 | lock (_prims) | 1735 | lock (_prims) |
1736 | _prims.Add(newPrim); | 1736 | _prims.Add(newPrim); |
@@ -1738,23 +1738,27 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1738 | 1738 | ||
1739 | return newPrim; | 1739 | return newPrim; |
1740 | } | 1740 | } |
1741 | /* | 1741 | |
1742 | private PhysicsActor AddPrim(String name, Vector3 position, PhysicsActor parent, | 1742 | private PhysicsActor AddPrim(String name, Vector3 position, Vector3 size, Quaternion rotation, |
1743 | PrimitiveBaseShape pbs, uint localid, byte[] sdata) | 1743 | IMesh mesh, PrimitiveBaseShape pbs, bool isphysical, bool isphantom, uint localid) |
1744 | { | 1744 | { |
1745 | |||
1745 | Vector3 pos = position; | 1746 | Vector3 pos = position; |
1747 | Vector3 siz = size; | ||
1748 | Quaternion rot = rotation; | ||
1746 | 1749 | ||
1747 | OdePrim newPrim; | 1750 | OdePrim newPrim; |
1748 | lock (OdeLock) | 1751 | lock (OdeLock) |
1749 | { | 1752 | { |
1750 | newPrim = new OdePrim(name, this, pos, parent, pbs, ode, localid, sdata); | 1753 | newPrim = new OdePrim(name, this, pos, siz, rot, mesh, pbs, isphysical, isphantom, ode, localid); |
1754 | |||
1751 | lock (_prims) | 1755 | lock (_prims) |
1752 | _prims.Add(newPrim); | 1756 | _prims.Add(newPrim); |
1753 | } | 1757 | } |
1754 | 1758 | ||
1755 | return newPrim; | 1759 | return newPrim; |
1756 | } | 1760 | } |
1757 | */ | 1761 | |
1758 | 1762 | ||
1759 | public void addActivePrim(OdePrim activatePrim) | 1763 | public void addActivePrim(OdePrim activatePrim) |
1760 | { | 1764 | { |
@@ -1781,6 +1785,23 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1781 | 1785 | ||
1782 | return result; | 1786 | return result; |
1783 | } | 1787 | } |
1788 | |||
1789 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
1790 | Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, uint localid) | ||
1791 | { | ||
1792 | PhysicsActor result; | ||
1793 | IMesh mesh = null; | ||
1794 | |||
1795 | if (needsMeshing(pbs)) | ||
1796 | mesh = mesher.CreateMesh(primName, pbs, size, (int)LevelOfDetail.High, true); | ||
1797 | |||
1798 | result = AddPrim(primName, position, size, rotation, mesh, pbs, isPhysical, isPhantom, localid); | ||
1799 | |||
1800 | return result; | ||
1801 | } | ||
1802 | |||
1803 | |||
1804 | |||
1784 | /* | 1805 | /* |
1785 | public override PhysicsActor AddPrimShape(string primName, PhysicsActor parent, PrimitiveBaseShape pbs, Vector3 position, | 1806 | public override PhysicsActor AddPrimShape(string primName, PhysicsActor parent, PrimitiveBaseShape pbs, Vector3 position, |
1786 | uint localid, byte[] sdata) | 1807 | uint localid, byte[] sdata) |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 1a0c2a7..46f5b6f 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -170,6 +170,8 @@ namespace OpenSim.Region.Physics.Manager | |||
170 | 170 | ||
171 | public abstract Vector3 Size { get; set; } | 171 | public abstract Vector3 Size { get; set; } |
172 | 172 | ||
173 | public bool Phantom { get; set; } | ||
174 | |||
173 | public abstract PrimitiveBaseShape Shape { set; } | 175 | public abstract PrimitiveBaseShape Shape { set; } |
174 | 176 | ||
175 | uint m_baseLocalID; | 177 | uint m_baseLocalID; |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index 0346d4e..eca6a0f 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs | |||
@@ -122,9 +122,6 @@ namespace OpenSim.Region.Physics.Manager | |||
122 | /// <param name="prim"></param> | 122 | /// <param name="prim"></param> |
123 | public abstract void RemovePrim(PhysicsActor prim); | 123 | public abstract void RemovePrim(PhysicsActor prim); |
124 | 124 | ||
125 | //public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
126 | // Vector3 size, Quaternion rotation); //To be removed - Actually removed! | ||
127 | |||
128 | public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 125 | public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
129 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid); | 126 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid); |
130 | 127 | ||
@@ -134,6 +131,12 @@ namespace OpenSim.Region.Physics.Manager | |||
134 | return null; | 131 | return null; |
135 | } | 132 | } |
136 | 133 | ||
134 | public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
135 | Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, uint localid) | ||
136 | { | ||
137 | return AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid); | ||
138 | } | ||
139 | |||
137 | public virtual float TimeDilation | 140 | public virtual float TimeDilation |
138 | { | 141 | { |
139 | get { return 1.0f; } | 142 | get { return 1.0f; } |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index 563d527..63b29ba 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | |||
@@ -65,6 +65,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
65 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 65 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
66 | 66 | ||
67 | private bool m_isphysical; | 67 | private bool m_isphysical; |
68 | private bool m_isPhantom; | ||
68 | private bool m_fakeisphysical; | 69 | private bool m_fakeisphysical; |
69 | 70 | ||
70 | protected bool m_building; | 71 | protected bool m_building; |
@@ -831,9 +832,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
831 | 832 | ||
832 | 833 | ||
833 | public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, | 834 | public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, |
834 | Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical) | 835 | Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical,bool pisPhantom,uint plocalID) |
835 | { | 836 | { |
836 | Name = primName; | 837 | Name = primName; |
838 | LocalID = plocalID; | ||
837 | 839 | ||
838 | m_vehicle = null; | 840 | m_vehicle = null; |
839 | 841 | ||
@@ -908,6 +910,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
908 | m_isSelected = false; | 910 | m_isSelected = false; |
909 | m_delaySelect = false; | 911 | m_delaySelect = false; |
910 | 912 | ||
913 | m_isPhantom = pisPhantom; | ||
914 | |||
911 | mu = parent_scene.m_materialContactsData[(int)Material.Wood].mu; | 915 | mu = parent_scene.m_materialContactsData[(int)Material.Wood].mu; |
912 | bounce = parent_scene.m_materialContactsData[(int)Material.Wood].bounce; | 916 | bounce = parent_scene.m_materialContactsData[(int)Material.Wood].bounce; |
913 | 917 | ||
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs index 14516f9..b111172 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | |||
@@ -1140,12 +1140,29 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1140 | OdePrim newPrim; | 1140 | OdePrim newPrim; |
1141 | lock (OdeLock) | 1141 | lock (OdeLock) |
1142 | { | 1142 | { |
1143 | newPrim = new OdePrim(name, this, pos, siz, rot, pbs, isphysical); | 1143 | newPrim = new OdePrim(name, this, pos, siz, rot, pbs, isphysical,false,localID); |
1144 | |||
1145 | lock (_prims) | ||
1146 | _prims.Add(newPrim); | ||
1147 | } | ||
1148 | return newPrim; | ||
1149 | } | ||
1150 | |||
1151 | private PhysicsActor AddPrim(String name, Vector3 position, Vector3 size, Quaternion rotation, | ||
1152 | PrimitiveBaseShape pbs, bool isphysical, bool isPhantom, uint localID) | ||
1153 | { | ||
1154 | Vector3 pos = position; | ||
1155 | Vector3 siz = size; | ||
1156 | Quaternion rot = rotation; | ||
1157 | |||
1158 | OdePrim newPrim; | ||
1159 | lock (OdeLock) | ||
1160 | { | ||
1161 | newPrim = new OdePrim(name, this, pos, siz, rot, pbs, isphysical,isPhantom,localID); | ||
1144 | 1162 | ||
1145 | lock (_prims) | 1163 | lock (_prims) |
1146 | _prims.Add(newPrim); | 1164 | _prims.Add(newPrim); |
1147 | } | 1165 | } |
1148 | newPrim.LocalID = localID; | ||
1149 | return newPrim; | 1166 | return newPrim; |
1150 | } | 1167 | } |
1151 | 1168 | ||
@@ -1169,6 +1186,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1169 | } | 1186 | } |
1170 | 1187 | ||
1171 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 1188 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
1189 | Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, uint localid) | ||
1190 | { | ||
1191 | return AddPrim(primName, position, size, rotation, pbs, isPhysical, isPhantom, localid); | ||
1192 | } | ||
1193 | |||
1194 | |||
1195 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
1172 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid) | 1196 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid) |
1173 | { | 1197 | { |
1174 | #if SPAM | 1198 | #if SPAM |