diff options
author | UbitUmarov | 2017-06-12 16:19:29 +0100 |
---|---|---|
committer | UbitUmarov | 2017-06-12 16:19:29 +0100 |
commit | a18d45fbdcda9dead222ca45e1b8057c3090cf14 (patch) | |
tree | 7c72007f740b44cfb412cbba4272607b012718d3 | |
parent | improve english on few messages (thx) (diff) | |
download | opensim-SC_OLD-a18d45fbdcda9dead222ca45e1b8057c3090cf14.zip opensim-SC_OLD-a18d45fbdcda9dead222ca45e1b8057c3090cf14.tar.gz opensim-SC_OLD-a18d45fbdcda9dead222ca45e1b8057c3090cf14.tar.bz2 opensim-SC_OLD-a18d45fbdcda9dead222ca45e1b8057c3090cf14.tar.xz |
fix some issues on ubOde physics shape type changes
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | 23 |
2 files changed, 18 insertions, 15 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs index a5ee2c9..dc87a78 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs | |||
@@ -80,7 +80,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
80 | public float MeshSculptphysicalLOD = 32; | 80 | public float MeshSculptphysicalLOD = 32; |
81 | 81 | ||
82 | 82 | ||
83 | private OpenSim.Framework.BlockingQueue<ODEPhysRepData> createqueue = new OpenSim.Framework.BlockingQueue<ODEPhysRepData>(); | 83 | private OpenSim.Framework.BlockingQueue<ODEPhysRepData> workQueue = new OpenSim.Framework.BlockingQueue<ODEPhysRepData>(); |
84 | private bool m_running; | 84 | private bool m_running; |
85 | 85 | ||
86 | private Thread m_thread; | 86 | private Thread m_thread; |
@@ -110,7 +110,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
110 | 110 | ||
111 | while(m_running) | 111 | while(m_running) |
112 | { | 112 | { |
113 | ODEPhysRepData nextRep = createqueue.Dequeue(); | 113 | ODEPhysRepData nextRep = workQueue.Dequeue(); |
114 | if(!m_running) | 114 | if(!m_running) |
115 | return; | 115 | return; |
116 | if (nextRep == null) | 116 | if (nextRep == null) |
@@ -139,7 +139,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
139 | try | 139 | try |
140 | { | 140 | { |
141 | m_thread.Abort(); | 141 | m_thread.Abort(); |
142 | createqueue.Clear(); | 142 | workQueue.Clear(); |
143 | } | 143 | } |
144 | catch | 144 | catch |
145 | { | 145 | { |
@@ -196,7 +196,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
196 | repData.meshState = MeshState.loadingAsset; | 196 | repData.meshState = MeshState.loadingAsset; |
197 | 197 | ||
198 | repData.comand = meshWorkerCmnds.getmesh; | 198 | repData.comand = meshWorkerCmnds.getmesh; |
199 | createqueue.Enqueue(repData); | 199 | workQueue.Enqueue(repData); |
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
@@ -242,7 +242,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
242 | if (needsMeshing(repData)) // no need for pbs now? | 242 | if (needsMeshing(repData)) // no need for pbs now? |
243 | { | 243 | { |
244 | repData.comand = meshWorkerCmnds.changefull; | 244 | repData.comand = meshWorkerCmnds.changefull; |
245 | createqueue.Enqueue(repData); | 245 | workQueue.Enqueue(repData); |
246 | } | 246 | } |
247 | } | 247 | } |
248 | else | 248 | else |
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs index 9bf71f7..4bed0d2 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | |||
@@ -165,6 +165,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
165 | 165 | ||
166 | private float m_density; | 166 | private float m_density; |
167 | private byte m_shapetype; | 167 | private byte m_shapetype; |
168 | private byte m_fakeShapetype; | ||
168 | public bool _zeroFlag; | 169 | public bool _zeroFlag; |
169 | private bool m_lastUpdateSent; | 170 | private bool m_lastUpdateSent; |
170 | 171 | ||
@@ -420,7 +421,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
420 | { | 421 | { |
421 | if (value.IsFinite()) | 422 | if (value.IsFinite()) |
422 | { | 423 | { |
423 | _parent_scene.m_meshWorker.ChangeActorPhysRep(this, _pbs, value, m_shapetype); | 424 | _parent_scene.m_meshWorker.ChangeActorPhysRep(this, _pbs, value, m_fakeShapetype); |
424 | } | 425 | } |
425 | else | 426 | else |
426 | { | 427 | { |
@@ -630,7 +631,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
630 | set | 631 | set |
631 | { | 632 | { |
632 | // AddChange(changes.Shape, value); | 633 | // AddChange(changes.Shape, value); |
633 | _parent_scene.m_meshWorker.ChangeActorPhysRep(this, value, _size, m_shapetype); | 634 | _parent_scene.m_meshWorker.ChangeActorPhysRep(this, value, _size, m_fakeShapetype); |
634 | } | 635 | } |
635 | } | 636 | } |
636 | 637 | ||
@@ -638,11 +639,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
638 | { | 639 | { |
639 | get | 640 | get |
640 | { | 641 | { |
641 | return m_shapetype; | 642 | return m_fakeShapetype; |
642 | } | 643 | } |
643 | set | 644 | set |
644 | { | 645 | { |
645 | m_shapetype = value; | 646 | m_fakeShapetype = value; |
646 | _parent_scene.m_meshWorker.ChangeActorPhysRep(this, _pbs, _size, value); | 647 | _parent_scene.m_meshWorker.ChangeActorPhysRep(this, _pbs, _size, value); |
647 | } | 648 | } |
648 | } | 649 | } |
@@ -1329,7 +1330,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1329 | 1330 | ||
1330 | _triMeshData = IntPtr.Zero; | 1331 | _triMeshData = IntPtr.Zero; |
1331 | 1332 | ||
1332 | m_shapetype = _shapeType; | 1333 | m_fakeShapetype = _shapeType; |
1333 | 1334 | ||
1334 | m_lastdoneSelected = false; | 1335 | m_lastdoneSelected = false; |
1335 | m_isSelected = false; | 1336 | m_isSelected = false; |
@@ -1346,7 +1347,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1346 | AddChange(changes.Add, null); | 1347 | AddChange(changes.Add, null); |
1347 | 1348 | ||
1348 | // get basic mass parameters | 1349 | // get basic mass parameters |
1349 | ODEPhysRepData repData = _parent_scene.m_meshWorker.NewActorPhysRep(this, _pbs, _size, m_shapetype); | 1350 | ODEPhysRepData repData = _parent_scene.m_meshWorker.NewActorPhysRep(this, _pbs, _size, _shapeType); |
1350 | 1351 | ||
1351 | primVolume = repData.volume; | 1352 | primVolume = repData.volume; |
1352 | m_OBB = repData.OBB; | 1353 | m_OBB = repData.OBB; |
@@ -3161,7 +3162,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3161 | { | 3162 | { |
3162 | _size = repData.size; //?? | 3163 | _size = repData.size; //?? |
3163 | _pbs = repData.pbs; | 3164 | _pbs = repData.pbs; |
3164 | m_shapetype = repData.shapetype; | ||
3165 | 3165 | ||
3166 | m_mesh = repData.mesh; | 3166 | m_mesh = repData.mesh; |
3167 | 3167 | ||
@@ -3200,9 +3200,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3200 | { | 3200 | { |
3201 | repData.size = _size; | 3201 | repData.size = _size; |
3202 | repData.pbs = _pbs; | 3202 | repData.pbs = _pbs; |
3203 | repData.shapetype = m_shapetype; | 3203 | repData.shapetype = m_fakeShapetype; |
3204 | _parent_scene.m_meshWorker.RequestMesh(repData); | 3204 | _parent_scene.m_meshWorker.RequestMesh(repData); |
3205 | } | 3205 | } |
3206 | else | ||
3207 | m_shapetype = repData.shapetype; | ||
3206 | } | 3208 | } |
3207 | 3209 | ||
3208 | private void changePhysRepData(ODEPhysRepData repData) | 3210 | private void changePhysRepData(ODEPhysRepData repData) |
@@ -3236,7 +3238,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3236 | 3238 | ||
3237 | _size = repData.size; | 3239 | _size = repData.size; |
3238 | _pbs = repData.pbs; | 3240 | _pbs = repData.pbs; |
3239 | m_shapetype = repData.shapetype; | ||
3240 | 3241 | ||
3241 | m_mesh = repData.mesh; | 3242 | m_mesh = repData.mesh; |
3242 | 3243 | ||
@@ -3287,9 +3288,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3287 | { | 3288 | { |
3288 | repData.size = _size; | 3289 | repData.size = _size; |
3289 | repData.pbs = _pbs; | 3290 | repData.pbs = _pbs; |
3290 | repData.shapetype = m_shapetype; | 3291 | repData.shapetype = m_fakeShapetype; |
3291 | _parent_scene.m_meshWorker.RequestMesh(repData); | 3292 | _parent_scene.m_meshWorker.RequestMesh(repData); |
3292 | } | 3293 | } |
3294 | else | ||
3295 | m_shapetype = repData.shapetype; | ||
3293 | } | 3296 | } |
3294 | 3297 | ||
3295 | private void changeFloatOnWater(bool newval) | 3298 | private void changeFloatOnWater(bool newval) |