diff options
author | UbitUmarov | 2012-10-07 08:53:55 +0100 |
---|---|---|
committer | UbitUmarov | 2012-10-07 08:53:55 +0100 |
commit | 48d8fbc9aedb3247a1dfd25be1b7dfbdd8719790 (patch) | |
tree | a127f70a44261c37345d4ce5a0e32aa0800c7f34 /OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs | |
parent | refix so we can compile it, loosing alpha scultps fix on core meshmerizer (diff) | |
download | opensim-SC-48d8fbc9aedb3247a1dfd25be1b7dfbdd8719790.zip opensim-SC-48d8fbc9aedb3247a1dfd25be1b7dfbdd8719790.tar.gz opensim-SC-48d8fbc9aedb3247a1dfd25be1b7dfbdd8719790.tar.bz2 opensim-SC-48d8fbc9aedb3247a1dfd25be1b7dfbdd8719790.tar.xz |
bug fix + make costs visible for testing
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs index 3fcbb1b..6bdc089 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs | |||
@@ -40,8 +40,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
40 | 40 | ||
41 | public float volume; | 41 | public float volume; |
42 | 42 | ||
43 | public float physCost; | ||
44 | public float streamCost; | ||
45 | public byte shapetype; | 43 | public byte shapetype; |
46 | public bool hasOBB; | 44 | public bool hasOBB; |
47 | public bool hasMeshVolume; | 45 | public bool hasMeshVolume; |
@@ -121,8 +119,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
121 | 119 | ||
122 | public void Stop() | 120 | public void Stop() |
123 | { | 121 | { |
124 | m_running = false; | 122 | try |
125 | m_thread.Abort(); | 123 | { |
124 | m_thread.Abort(); | ||
125 | createqueue.Clear(); | ||
126 | } | ||
127 | catch | ||
128 | { | ||
129 | } | ||
126 | } | 130 | } |
127 | 131 | ||
128 | public void ChangeActorPhysRep(PhysicsActor actor, PrimitiveBaseShape pbs, | 132 | public void ChangeActorPhysRep(PhysicsActor actor, PrimitiveBaseShape pbs, |
@@ -172,10 +176,15 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
172 | if (repData.assetState != AssetState.needAsset) | 176 | if (repData.assetState != AssetState.needAsset) |
173 | return; | 177 | return; |
174 | 178 | ||
179 | repData.mesh = null; | ||
180 | |||
175 | if (repData.assetID == null || repData.assetID == UUID.Zero) | 181 | if (repData.assetID == null || repData.assetID == UUID.Zero) |
182 | { | ||
183 | repData.assetState = AssetState.noNeedAsset; | ||
184 | repData.comand = meshWorkerCmnds.changefull; | ||
185 | createqueue.Enqueue(repData); | ||
176 | return; | 186 | return; |
177 | 187 | } | |
178 | repData.mesh = null; | ||
179 | 188 | ||
180 | repData.assetState = AssetState.loadingAsset; | 189 | repData.assetState = AssetState.loadingAsset; |
181 | 190 | ||
@@ -211,9 +220,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
211 | repData.OBBOffset = mesh.GetCentroid(); | 220 | repData.OBBOffset = mesh.GetCentroid(); |
212 | repData.OBB = mesh.GetOBB(); | 221 | repData.OBB = mesh.GetOBB(); |
213 | repData.hasOBB = true; | 222 | repData.hasOBB = true; |
214 | repData.physCost = 0.0013f * (float)indexCount; | ||
215 | // todo | ||
216 | repData.streamCost = 1.0f; | ||
217 | mesh.releaseSourceMeshData(); | 223 | mesh.releaseSourceMeshData(); |
218 | } | 224 | } |
219 | } | 225 | } |
@@ -427,11 +433,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
427 | if (pbs.SculptTexture != null && pbs.SculptTexture != UUID.Zero) | 433 | if (pbs.SculptTexture != null && pbs.SculptTexture != UUID.Zero) |
428 | { | 434 | { |
429 | repData.assetID = pbs.SculptTexture; | 435 | repData.assetID = pbs.SculptTexture; |
430 | repData.assetState = AssetState.needAsset; | 436 | repData.assetState = AssetState.needAsset; |
431 | } | 437 | } |
432 | else | 438 | else |
433 | repData.assetState = AssetState.AssetFailed; | 439 | repData.assetState = AssetState.AssetFailed; |
434 | } | 440 | } |
441 | else | ||
442 | repData.assetState = AssetState.needAsset; | ||
443 | |||
435 | return false; | 444 | return false; |
436 | } | 445 | } |
437 | 446 | ||
@@ -828,14 +837,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
828 | if (repData.hasOBB) | 837 | if (repData.hasOBB) |
829 | { | 838 | { |
830 | Vector3 OBB = repData.OBB; | 839 | Vector3 OBB = repData.OBB; |
831 | float pc = repData.physCost; | ||
832 | float psf = OBB.X * (OBB.Y + OBB.Z) + OBB.Y * OBB.Z; | ||
833 | psf *= 1.33f * .2f; | ||
834 | pc *= psf; | ||
835 | if (pc < 0.1f) | ||
836 | pc = 0.1f; | ||
837 | |||
838 | repData.physCost = pc; | ||
839 | } | 840 | } |
840 | else | 841 | else |
841 | { | 842 | { |
@@ -846,9 +847,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
846 | 847 | ||
847 | repData.OBB = OBB; | 848 | repData.OBB = OBB; |
848 | repData.OBBOffset = Vector3.Zero; | 849 | repData.OBBOffset = Vector3.Zero; |
849 | |||
850 | repData.physCost = 0.1f; | ||
851 | repData.streamCost = 1.0f; | ||
852 | } | 850 | } |
853 | 851 | ||
854 | CalculateBasicPrimVolume(repData); | 852 | CalculateBasicPrimVolume(repData); |