let convex be a parameter to createMesh so it can be used. Was forced to add it also to original mesher code and zeromesher

avinationmerge
UbitUmarov 2012-03-21 00:02:41 +00:00
parent 23e6a31aa5
commit 8817b6e74c
4 changed files with 21 additions and 7 deletions

View File

@ -36,6 +36,7 @@ namespace OpenSim.Region.Physics.Manager
{ {
IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod); IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod);
IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical); IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical);
IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical,bool convex);
} }
// Values for level of detail to be passed to the mesher. // Values for level of detail to be passed to the mesher.

View File

@ -67,6 +67,11 @@ namespace OpenSim.Region.Physics.Manager
return CreateMesh(primName, primShape, size, lod, false); return CreateMesh(primName, primShape, size, lod, false);
} }
public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical, bool convex)
{
return CreateMesh(primName, primShape, size, lod, false);
}
public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical) public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical)
{ {
// Remove the reference to the encoded JPEG2000 data so it can be GCed // Remove the reference to the encoded JPEG2000 data so it can be GCed

View File

@ -717,6 +717,11 @@ namespace OpenSim.Region.Physics.Meshing
return CreateMesh(primName, primShape, size, lod, false); return CreateMesh(primName, primShape, size, lod, false);
} }
public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical, bool convex)
{
return CreateMesh(primName, primShape, size, lod, false);
}
public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical) public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical)
{ {
#if SPAM #if SPAM

View File

@ -257,7 +257,7 @@ namespace OpenSim.Region.Physics.Meshing
/// <param name="size"></param> /// <param name="size"></param>
/// <param name="lod"></param> /// <param name="lod"></param>
/// <returns></returns> /// <returns></returns>
private Mesh CreateMeshFromPrimMesher(string primName, PrimitiveBaseShape primShape, Vector3 size, float lod) private Mesh CreateMeshFromPrimMesher(string primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool convex)
{ {
// m_log.DebugFormat( // m_log.DebugFormat(
// "[MESH]: Creating physics proxy for {0}, shape {1}", // "[MESH]: Creating physics proxy for {0}, shape {1}",
@ -273,7 +273,7 @@ namespace OpenSim.Region.Physics.Meshing
if (!useMeshiesPhysicsMesh) if (!useMeshiesPhysicsMesh)
return null; return null;
if (!GenerateCoordsAndFacesFromPrimMeshData(primName, primShape, size, out coords, out faces)) if (!GenerateCoordsAndFacesFromPrimMeshData(primName, primShape, size, out coords, out faces, convex))
return null; return null;
} }
else else
@ -324,12 +324,10 @@ namespace OpenSim.Region.Physics.Meshing
/// <param name="faces">Faces are added to this list by the method.</param> /// <param name="faces">Faces are added to this list by the method.</param>
/// <returns>true if coords and faces were successfully generated, false if not</returns> /// <returns>true if coords and faces were successfully generated, false if not</returns>
private bool GenerateCoordsAndFacesFromPrimMeshData( private bool GenerateCoordsAndFacesFromPrimMeshData(
string primName, PrimitiveBaseShape primShape, Vector3 size, out List<Coord> coords, out List<Face> faces) string primName, PrimitiveBaseShape primShape, Vector3 size, out List<Coord> coords, out List<Face> faces, bool convex)
{ {
// m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName); // m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName);
bool convex = false; // this will be a input
bool usemesh = false; bool usemesh = false;
coords = new List<Coord>(); coords = new List<Coord>();
@ -978,11 +976,16 @@ namespace OpenSim.Region.Physics.Meshing
public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod) public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod)
{ {
return CreateMesh(primName, primShape, size, lod, false); return CreateMesh(primName, primShape, size, lod, false,false);
} }
public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical) public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical)
{ {
return CreateMesh(primName, primShape, size, lod, false,false);
}
public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical, bool convex)
{
#if SPAM #if SPAM
m_log.DebugFormat("[MESH]: Creating mesh for {0}", primName); m_log.DebugFormat("[MESH]: Creating mesh for {0}", primName);
#endif #endif
@ -1000,7 +1003,7 @@ namespace OpenSim.Region.Physics.Meshing
if (size.Y < 0.01f) size.Y = 0.01f; if (size.Y < 0.01f) size.Y = 0.01f;
if (size.Z < 0.01f) size.Z = 0.01f; if (size.Z < 0.01f) size.Z = 0.01f;
mesh = CreateMeshFromPrimMesher(primName, primShape, size, lod); mesh = CreateMeshFromPrimMesher(primName, primShape, size, lod,convex);
if (mesh != null) if (mesh != null)
{ {