diff options
author | UbitUmarov | 2012-03-21 00:02:41 +0000 |
---|---|---|
committer | UbitUmarov | 2012-03-21 00:02:41 +0000 |
commit | 8817b6e74cd792808c4bf1d7c125ff3ecace4d89 (patch) | |
tree | 977b2b34bf2d4749d178986cc1305d20f1255c75 /OpenSim/Region | |
parent | added convex decomposition hulls support. Hardcoded to use mesh or this. (so... (diff) | |
download | opensim-SC-8817b6e74cd792808c4bf1d7c125ff3ecace4d89.zip opensim-SC-8817b6e74cd792808c4bf1d7c125ff3ecace4d89.tar.gz opensim-SC-8817b6e74cd792808c4bf1d7c125ff3ecace4d89.tar.bz2 opensim-SC-8817b6e74cd792808c4bf1d7c125ff3ecace4d89.tar.xz |
let convex be a parameter to createMesh so it can be used. Was forced to add it also to original mesher code and zeromesher
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Physics/Manager/IMesher.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Physics/Manager/ZeroMesher.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitMeshing/Meshmerizer.cs | 17 |
4 files changed, 21 insertions, 7 deletions
diff --git a/OpenSim/Region/Physics/Manager/IMesher.cs b/OpenSim/Region/Physics/Manager/IMesher.cs index cc92484..c32cf38 100644 --- a/OpenSim/Region/Physics/Manager/IMesher.cs +++ b/OpenSim/Region/Physics/Manager/IMesher.cs | |||
@@ -36,6 +36,7 @@ namespace OpenSim.Region.Physics.Manager | |||
36 | { | 36 | { |
37 | IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod); | 37 | IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod); |
38 | IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical); | 38 | IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical); |
39 | IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical,bool convex); | ||
39 | } | 40 | } |
40 | 41 | ||
41 | // Values for level of detail to be passed to the mesher. | 42 | // Values for level of detail to be passed to the mesher. |
diff --git a/OpenSim/Region/Physics/Manager/ZeroMesher.cs b/OpenSim/Region/Physics/Manager/ZeroMesher.cs index ba19db6..8a3b50b 100644 --- a/OpenSim/Region/Physics/Manager/ZeroMesher.cs +++ b/OpenSim/Region/Physics/Manager/ZeroMesher.cs | |||
@@ -67,6 +67,11 @@ namespace OpenSim.Region.Physics.Manager | |||
67 | return CreateMesh(primName, primShape, size, lod, false); | 67 | return CreateMesh(primName, primShape, size, lod, false); |
68 | } | 68 | } |
69 | 69 | ||
70 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical, bool convex) | ||
71 | { | ||
72 | return CreateMesh(primName, primShape, size, lod, false); | ||
73 | } | ||
74 | |||
70 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical) | 75 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical) |
71 | { | 76 | { |
72 | // Remove the reference to the encoded JPEG2000 data so it can be GCed | 77 | // Remove the reference to the encoded JPEG2000 data so it can be GCed |
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index c4b245f..5597542 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -717,6 +717,11 @@ namespace OpenSim.Region.Physics.Meshing | |||
717 | return CreateMesh(primName, primShape, size, lod, false); | 717 | return CreateMesh(primName, primShape, size, lod, false); |
718 | } | 718 | } |
719 | 719 | ||
720 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical, bool convex) | ||
721 | { | ||
722 | return CreateMesh(primName, primShape, size, lod, false); | ||
723 | } | ||
724 | |||
720 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical) | 725 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical) |
721 | { | 726 | { |
722 | #if SPAM | 727 | #if SPAM |
diff --git a/OpenSim/Region/Physics/UbitMeshing/Meshmerizer.cs b/OpenSim/Region/Physics/UbitMeshing/Meshmerizer.cs index a550342..7667e91 100644 --- a/OpenSim/Region/Physics/UbitMeshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/UbitMeshing/Meshmerizer.cs | |||
@@ -257,7 +257,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
257 | /// <param name="size"></param> | 257 | /// <param name="size"></param> |
258 | /// <param name="lod"></param> | 258 | /// <param name="lod"></param> |
259 | /// <returns></returns> | 259 | /// <returns></returns> |
260 | private Mesh CreateMeshFromPrimMesher(string primName, PrimitiveBaseShape primShape, Vector3 size, float lod) | 260 | private Mesh CreateMeshFromPrimMesher(string primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool convex) |
261 | { | 261 | { |
262 | // m_log.DebugFormat( | 262 | // m_log.DebugFormat( |
263 | // "[MESH]: Creating physics proxy for {0}, shape {1}", | 263 | // "[MESH]: Creating physics proxy for {0}, shape {1}", |
@@ -273,7 +273,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
273 | if (!useMeshiesPhysicsMesh) | 273 | if (!useMeshiesPhysicsMesh) |
274 | return null; | 274 | return null; |
275 | 275 | ||
276 | if (!GenerateCoordsAndFacesFromPrimMeshData(primName, primShape, size, out coords, out faces)) | 276 | if (!GenerateCoordsAndFacesFromPrimMeshData(primName, primShape, size, out coords, out faces, convex)) |
277 | return null; | 277 | return null; |
278 | } | 278 | } |
279 | else | 279 | else |
@@ -324,12 +324,10 @@ namespace OpenSim.Region.Physics.Meshing | |||
324 | /// <param name="faces">Faces are added to this list by the method.</param> | 324 | /// <param name="faces">Faces are added to this list by the method.</param> |
325 | /// <returns>true if coords and faces were successfully generated, false if not</returns> | 325 | /// <returns>true if coords and faces were successfully generated, false if not</returns> |
326 | private bool GenerateCoordsAndFacesFromPrimMeshData( | 326 | private bool GenerateCoordsAndFacesFromPrimMeshData( |
327 | string primName, PrimitiveBaseShape primShape, Vector3 size, out List<Coord> coords, out List<Face> faces) | 327 | string primName, PrimitiveBaseShape primShape, Vector3 size, out List<Coord> coords, out List<Face> faces, bool convex) |
328 | { | 328 | { |
329 | // m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName); | 329 | // m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName); |
330 | 330 | ||
331 | |||
332 | bool convex = false; // this will be a input | ||
333 | bool usemesh = false; | 331 | bool usemesh = false; |
334 | 332 | ||
335 | coords = new List<Coord>(); | 333 | coords = new List<Coord>(); |
@@ -978,11 +976,16 @@ namespace OpenSim.Region.Physics.Meshing | |||
978 | 976 | ||
979 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod) | 977 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod) |
980 | { | 978 | { |
981 | return CreateMesh(primName, primShape, size, lod, false); | 979 | return CreateMesh(primName, primShape, size, lod, false,false); |
982 | } | 980 | } |
983 | 981 | ||
984 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical) | 982 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical) |
985 | { | 983 | { |
984 | return CreateMesh(primName, primShape, size, lod, false,false); | ||
985 | } | ||
986 | |||
987 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical, bool convex) | ||
988 | { | ||
986 | #if SPAM | 989 | #if SPAM |
987 | m_log.DebugFormat("[MESH]: Creating mesh for {0}", primName); | 990 | m_log.DebugFormat("[MESH]: Creating mesh for {0}", primName); |
988 | #endif | 991 | #endif |
@@ -1000,7 +1003,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
1000 | if (size.Y < 0.01f) size.Y = 0.01f; | 1003 | if (size.Y < 0.01f) size.Y = 0.01f; |
1001 | if (size.Z < 0.01f) size.Z = 0.01f; | 1004 | if (size.Z < 0.01f) size.Z = 0.01f; |
1002 | 1005 | ||
1003 | mesh = CreateMeshFromPrimMesher(primName, primShape, size, lod); | 1006 | mesh = CreateMeshFromPrimMesher(primName, primShape, size, lod,convex); |
1004 | 1007 | ||
1005 | if (mesh != null) | 1008 | if (mesh != null) |
1006 | { | 1009 | { |