diff options
author | Teravus Ovares | 2009-04-11 00:11:54 +0000 |
---|---|---|
committer | Teravus Ovares | 2009-04-11 00:11:54 +0000 |
commit | 53026affb315816280ef8649e0f9694e81280540 (patch) | |
tree | 073989071e06f668b4571d09430c89b5cecccecb /OpenSim/Region/Physics | |
parent | * Tweak prebuild #2 (diff) | |
download | opensim-SC-53026affb315816280ef8649e0f9694e81280540.zip opensim-SC-53026affb315816280ef8649e0f9694e81280540.tar.gz opensim-SC-53026affb315816280ef8649e0f9694e81280540.tar.bz2 opensim-SC-53026affb315816280ef8649e0f9694e81280540.tar.xz |
* Instead of referencing mesh stuff in the physics plugin.. change the IMesh Interface. (blame prebuild)
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r-- | OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs | 28 | ||||
-rw-r--r-- | OpenSim/Region/Physics/Manager/IMesher.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Mesh.cs | 16 |
3 files changed, 29 insertions, 17 deletions
diff --git a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs index 0f54a9f..9f68f02 100644 --- a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs +++ b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETPrim.cs | |||
@@ -35,7 +35,7 @@ using OpenMetaverse; | |||
35 | using BulletDotNET; | 35 | using BulletDotNET; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Region.Physics.Manager; | 37 | using OpenSim.Region.Physics.Manager; |
38 | using OpenSim.Region.Physics.Meshing; | 38 | |
39 | 39 | ||
40 | namespace OpenSim.Region.Physics.BulletDotNETPlugin | 40 | namespace OpenSim.Region.Physics.BulletDotNETPlugin |
41 | { | 41 | { |
@@ -1012,8 +1012,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin | |||
1012 | IMesh mesh = _parent_scene.mesher.CreateMesh(SOPName, _pbs, _size, meshlod, IsPhysical); | 1012 | IMesh mesh = _parent_scene.mesher.CreateMesh(SOPName, _pbs, _size, meshlod, IsPhysical); |
1013 | if (!positionOffset.IsIdentical(PhysicsVector.Zero,0.001f) || orientation != Quaternion.Identity) | 1013 | if (!positionOffset.IsIdentical(PhysicsVector.Zero,0.001f) || orientation != Quaternion.Identity) |
1014 | { | 1014 | { |
1015 | if (mesh is Mesh) | 1015 | |
1016 | { | ||
1017 | float[] xyz = new float[3]; | 1016 | float[] xyz = new float[3]; |
1018 | xyz[0] = positionOffset.X; | 1017 | xyz[0] = positionOffset.X; |
1019 | xyz[1] = positionOffset.Y; | 1018 | xyz[1] = positionOffset.Y; |
@@ -1033,10 +1032,10 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin | |||
1033 | matrix[2, 1] = m4.M32; | 1032 | matrix[2, 1] = m4.M32; |
1034 | matrix[2, 2] = m4.M33; | 1033 | matrix[2, 2] = m4.M33; |
1035 | 1034 | ||
1036 | Mesh mesh2 = (Mesh) mesh; | 1035 | |
1037 | mesh2.TransformLinear(matrix, xyz); | 1036 | mesh.TransformLinear(matrix, xyz); |
1038 | mesh = (IMesh)mesh2; | 1037 | |
1039 | } | 1038 | |
1040 | 1039 | ||
1041 | } | 1040 | } |
1042 | 1041 | ||
@@ -2120,7 +2119,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin | |||
2120 | ProcessGeomCreationAsTriMesh(PhysicsVector.Zero, Quaternion.Identity); | 2119 | ProcessGeomCreationAsTriMesh(PhysicsVector.Zero, Quaternion.Identity); |
2121 | // createmesh returns null when it doesn't mesh. | 2120 | // createmesh returns null when it doesn't mesh. |
2122 | 2121 | ||
2123 | 2122 | /* | |
2124 | if (_mesh is Mesh) | 2123 | if (_mesh is Mesh) |
2125 | { | 2124 | { |
2126 | } | 2125 | } |
@@ -2129,7 +2128,9 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin | |||
2129 | m_log.Warn("[PHYSICS]: Can't link a OpenSim.Region.Physics.Meshing.Mesh object"); | 2128 | m_log.Warn("[PHYSICS]: Can't link a OpenSim.Region.Physics.Meshing.Mesh object"); |
2130 | return; | 2129 | return; |
2131 | } | 2130 | } |
2132 | Mesh pMesh = (Mesh) _mesh; | 2131 | */ |
2132 | |||
2133 | |||
2133 | 2134 | ||
2134 | foreach (BulletDotNETPrim chld in childrenPrim) | 2135 | foreach (BulletDotNETPrim chld in childrenPrim) |
2135 | { | 2136 | { |
@@ -2141,13 +2142,12 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin | |||
2141 | //pos *= Orientation; | 2142 | //pos *= Orientation; |
2142 | offset.setValues(pos.X, pos.Y, pos.Z); | 2143 | offset.setValues(pos.X, pos.Y, pos.Z); |
2143 | chld.ProcessGeomCreationAsTriMesh(offset, chld.Orientation); | 2144 | chld.ProcessGeomCreationAsTriMesh(offset, chld.Orientation); |
2144 | if (chld._mesh is Mesh) | 2145 | |
2145 | { | 2146 | _mesh.Append(chld._mesh); |
2146 | pMesh.Append((Mesh)chld._mesh); | 2147 | |
2147 | } | ||
2148 | 2148 | ||
2149 | } | 2149 | } |
2150 | setMesh(_parent_scene, pMesh); | 2150 | setMesh(_parent_scene, _mesh); |
2151 | 2151 | ||
2152 | //} | 2152 | //} |
2153 | 2153 | ||
diff --git a/OpenSim/Region/Physics/Manager/IMesher.cs b/OpenSim/Region/Physics/Manager/IMesher.cs index fa13787..29f58f3 100644 --- a/OpenSim/Region/Physics/Manager/IMesher.cs +++ b/OpenSim/Region/Physics/Manager/IMesher.cs | |||
@@ -49,5 +49,7 @@ namespace OpenSim.Region.Physics.Manager | |||
49 | float[] getVertexListAsFloatLocked(); | 49 | float[] getVertexListAsFloatLocked(); |
50 | void releaseSourceMeshData(); | 50 | void releaseSourceMeshData(); |
51 | void releasePinned(); | 51 | void releasePinned(); |
52 | void Append(IMesh newMesh); | ||
53 | void TransformLinear(float[,] matrix, float[] offset); | ||
52 | } | 54 | } |
53 | } | 55 | } |
diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs index 5a565ff..719e364 100644 --- a/OpenSim/Region/Physics/Meshing/Mesh.cs +++ b/OpenSim/Region/Physics/Meshing/Mesh.cs | |||
@@ -296,12 +296,22 @@ namespace OpenSim.Region.Physics.Meshing | |||
296 | primMesh = null; | 296 | primMesh = null; |
297 | } | 297 | } |
298 | 298 | ||
299 | public void Append(Mesh newMesh) | 299 | public void Append(IMesh newMesh) |
300 | { | 300 | { |
301 | foreach (Vertex v in newMesh.vertices) | 301 | Mesh newMesh2; |
302 | if (newMesh is Mesh) | ||
303 | { | ||
304 | newMesh2 = (Mesh)newMesh; | ||
305 | } | ||
306 | else | ||
307 | { | ||
308 | return; | ||
309 | } | ||
310 | |||
311 | foreach (Vertex v in newMesh2.vertices) | ||
302 | vertices.Add(v); | 312 | vertices.Add(v); |
303 | 313 | ||
304 | foreach (Triangle t in newMesh.triangles) | 314 | foreach (Triangle t in newMesh2.triangles) |
305 | Add(t); | 315 | Add(t); |
306 | } | 316 | } |
307 | 317 | ||