diff options
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs')
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index 4c16f8e..c2c4384 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | |||
@@ -146,7 +146,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
146 | private PrimitiveBaseShape _pbs; | 146 | private PrimitiveBaseShape _pbs; |
147 | 147 | ||
148 | private UUID? m_assetID; | 148 | private UUID? m_assetID; |
149 | private AssetState m_assetState; | 149 | private MeshState m_meshState; |
150 | 150 | ||
151 | public OdeScene _parent_scene; | 151 | public OdeScene _parent_scene; |
152 | 152 | ||
@@ -1341,15 +1341,18 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1341 | 1341 | ||
1342 | if (vertexCount == 0 || indexCount == 0) | 1342 | if (vertexCount == 0 || indexCount == 0) |
1343 | { | 1343 | { |
1344 | m_log.WarnFormat("[PHYSICS]: Invalid mesh data on OdePrim {0} mesh UUID {1}", | 1344 | m_log.WarnFormat("[PHYSICS]: Invalid mesh data on OdePrim {0}, mesh {1}", |
1345 | Name, _pbs.SculptTexture.ToString()); | 1345 | Name, _pbs.SculptEntry ? _pbs.SculptTexture.ToString() : "primMesh"); |
1346 | |||
1346 | m_hasOBB = false; | 1347 | m_hasOBB = false; |
1347 | m_OBBOffset = Vector3.Zero; | 1348 | m_OBBOffset = Vector3.Zero; |
1348 | m_OBB = _size * 0.5f; | 1349 | m_OBB = _size * 0.5f; |
1350 | |||
1349 | m_physCost = 0.1f; | 1351 | m_physCost = 0.1f; |
1350 | m_streamCost = 1.0f; | 1352 | m_streamCost = 1.0f; |
1353 | |||
1351 | _parent_scene.mesher.ReleaseMesh(mesh); | 1354 | _parent_scene.mesher.ReleaseMesh(mesh); |
1352 | m_assetState = AssetState.AssetFailed; | 1355 | m_meshState = MeshState.MeshFailed; |
1353 | m_mesh = null; | 1356 | m_mesh = null; |
1354 | return false; | 1357 | return false; |
1355 | } | 1358 | } |
@@ -1360,7 +1363,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1360 | d.GeomTriMeshDataBuildSimple(_triMeshData, vertices, vertexStride, vertexCount, indices, indexCount, triStride); | 1363 | d.GeomTriMeshDataBuildSimple(_triMeshData, vertices, vertexStride, vertexCount, indices, indexCount, triStride); |
1361 | d.GeomTriMeshDataPreprocess(_triMeshData); | 1364 | d.GeomTriMeshDataPreprocess(_triMeshData); |
1362 | 1365 | ||
1363 | prim_geom = d.CreateTriMesh(IntPtr.Zero, _triMeshData, null, null, null); | 1366 | prim_geom = d.CreateTriMesh(m_targetSpace, _triMeshData, null, null, null); |
1364 | } | 1367 | } |
1365 | 1368 | ||
1366 | catch (Exception e) | 1369 | catch (Exception e) |
@@ -1385,7 +1388,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1385 | m_physCost = 0.1f; | 1388 | m_physCost = 0.1f; |
1386 | m_streamCost = 1.0f; | 1389 | m_streamCost = 1.0f; |
1387 | _parent_scene.mesher.ReleaseMesh(mesh); | 1390 | _parent_scene.mesher.ReleaseMesh(mesh); |
1388 | m_assetState = AssetState.AssetFailed; | 1391 | m_meshState = MeshState.AssetFailed; |
1389 | m_mesh = null; | 1392 | m_mesh = null; |
1390 | return false; | 1393 | return false; |
1391 | } | 1394 | } |
@@ -1404,7 +1407,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1404 | 1407 | ||
1405 | m_NoColide = false; | 1408 | m_NoColide = false; |
1406 | 1409 | ||
1407 | if (m_assetState == AssetState.AssetFailed) | 1410 | if ((m_meshState & MeshState.FailMask) != 0) |
1408 | m_NoColide = true; | 1411 | m_NoColide = true; |
1409 | 1412 | ||
1410 | else if(m_mesh != null) | 1413 | else if(m_mesh != null) |
@@ -1422,7 +1425,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1422 | { // it's a sphere | 1425 | { // it's a sphere |
1423 | try | 1426 | try |
1424 | { | 1427 | { |
1425 | geo = d.CreateSphere(IntPtr.Zero, _size.X * 0.5f); | 1428 | geo = d.CreateSphere(m_targetSpace, _size.X * 0.5f); |
1426 | } | 1429 | } |
1427 | catch (Exception e) | 1430 | catch (Exception e) |
1428 | { | 1431 | { |
@@ -1434,7 +1437,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1434 | {// do it as a box | 1437 | {// do it as a box |
1435 | try | 1438 | try |
1436 | { | 1439 | { |
1437 | geo = d.CreateBox(IntPtr.Zero, _size.X, _size.Y, _size.Z); | 1440 | geo = d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z); |
1438 | } | 1441 | } |
1439 | catch (Exception e) | 1442 | catch (Exception e) |
1440 | { | 1443 | { |
@@ -2748,7 +2751,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2748 | m_mesh = repData.mesh; | 2751 | m_mesh = repData.mesh; |
2749 | 2752 | ||
2750 | m_assetID = repData.assetID; | 2753 | m_assetID = repData.assetID; |
2751 | m_assetState = repData.assetState; | 2754 | m_meshState = repData.meshState; |
2752 | 2755 | ||
2753 | m_hasOBB = repData.hasOBB; | 2756 | m_hasOBB = repData.hasOBB; |
2754 | m_OBBOffset = repData.OBBOffset; | 2757 | m_OBBOffset = repData.OBBOffset; |
@@ -2781,12 +2784,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2781 | else | 2784 | else |
2782 | MakeBody(); | 2785 | MakeBody(); |
2783 | 2786 | ||
2784 | if (m_assetState == AssetState.needAsset) | 2787 | if ((m_meshState & MeshState.NeedMask) != 0) |
2785 | { | 2788 | { |
2786 | repData.size = _size; | 2789 | repData.size = _size; |
2787 | repData.pbs = _pbs; | 2790 | repData.pbs = _pbs; |
2788 | repData.shapetype = m_shapetype; | 2791 | repData.shapetype = m_shapetype; |
2789 | _parent_scene.m_meshWorker.RequestMeshAsset(repData); | 2792 | _parent_scene.m_meshWorker.RequestMesh(repData); |
2790 | } | 2793 | } |
2791 | } | 2794 | } |
2792 | } | 2795 | } |
@@ -2820,7 +2823,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2820 | m_mesh = repData.mesh; | 2823 | m_mesh = repData.mesh; |
2821 | 2824 | ||
2822 | m_assetID = repData.assetID; | 2825 | m_assetID = repData.assetID; |
2823 | m_assetState = repData.assetState; | 2826 | m_meshState = repData.meshState; |
2824 | 2827 | ||
2825 | m_hasOBB = repData.hasOBB; | 2828 | m_hasOBB = repData.hasOBB; |
2826 | m_OBBOffset = repData.OBBOffset; | 2829 | m_OBBOffset = repData.OBBOffset; |
@@ -2832,12 +2835,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2832 | 2835 | ||
2833 | if (prim_geom != IntPtr.Zero) | 2836 | if (prim_geom != IntPtr.Zero) |
2834 | { | 2837 | { |
2835 | m_targetSpace = IntPtr.Zero; | ||
2836 | |||
2837 | UpdatePrimBodyData(); | 2838 | UpdatePrimBodyData(); |
2838 | 2839 | ||
2839 | _parent_scene.actor_name_map[prim_geom] = this; | 2840 | _parent_scene.actor_name_map[prim_geom] = this; |
2840 | |||
2841 | 2841 | ||
2842 | d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); | 2842 | d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); |
2843 | d.Quaternion myrot = new d.Quaternion(); | 2843 | d.Quaternion myrot = new d.Quaternion(); |
@@ -2847,7 +2847,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2847 | myrot.W = _orientation.W; | 2847 | myrot.W = _orientation.W; |
2848 | d.GeomSetQuaternion(prim_geom, ref myrot); | 2848 | d.GeomSetQuaternion(prim_geom, ref myrot); |
2849 | 2849 | ||
2850 | |||
2851 | if (m_isphysical) | 2850 | if (m_isphysical) |
2852 | { | 2851 | { |
2853 | if (chp) | 2852 | if (chp) |
@@ -2869,13 +2868,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2869 | } | 2868 | } |
2870 | 2869 | ||
2871 | resetCollisionAccounting(); | 2870 | resetCollisionAccounting(); |
2872 | if (m_assetState == AssetState.needAsset) | 2871 | } |
2873 | { | 2872 | |
2874 | repData.size = _size; | 2873 | if ((m_meshState & MeshState.NeedMask) != 0) |
2875 | repData.pbs = _pbs; | 2874 | { |
2876 | repData.shapetype = m_shapetype; | 2875 | repData.size = _size; |
2877 | _parent_scene.m_meshWorker.RequestMeshAsset(repData); | 2876 | repData.pbs = _pbs; |
2878 | } | 2877 | repData.shapetype = m_shapetype; |
2878 | _parent_scene.m_meshWorker.RequestMesh(repData); | ||
2879 | } | 2879 | } |
2880 | } | 2880 | } |
2881 | 2881 | ||