diff options
author | Dahlia Trimble | 2008-07-18 00:03:28 +0000 |
---|---|---|
committer | Dahlia Trimble | 2008-07-18 00:03:28 +0000 |
commit | 49adb6e09f42b1b4022d6127379c79ce01b64192 (patch) | |
tree | bf00948691271a557dd3af37b5380d94bf995daf /OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |
parent | fix build break (diff) | |
download | opensim-SC_OLD-49adb6e09f42b1b4022d6127379c79ce01b64192.zip opensim-SC_OLD-49adb6e09f42b1b4022d6127379c79ce01b64192.tar.gz opensim-SC_OLD-49adb6e09f42b1b4022d6127379c79ce01b64192.tar.bz2 opensim-SC_OLD-49adb6e09f42b1b4022d6127379c79ce01b64192.tar.xz |
refactor - commenting out needsMeshing() and all references as createMesh() has the same logic and obsoletes the need for it.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/OdePlugin.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 110 |
1 files changed, 56 insertions, 54 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index cd5032c..ec0e0ff 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -1127,10 +1127,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1127 | private PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, Quaternion rotation, | 1127 | private PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, Quaternion rotation, |
1128 | IMesh mesh, PrimitiveBaseShape pbs, bool isphysical) | 1128 | IMesh mesh, PrimitiveBaseShape pbs, bool isphysical) |
1129 | { | 1129 | { |
1130 | PhysicsVector pos = new PhysicsVector(); | 1130 | PhysicsVector pos = new PhysicsVector(position.X, position.Y, position.Z); |
1131 | pos.X = position.X; | 1131 | //pos.X = position.X; |
1132 | pos.Y = position.Y; | 1132 | //pos.Y = position.Y; |
1133 | pos.Z = position.Z; | 1133 | //pos.Z = position.Z; |
1134 | PhysicsVector siz = new PhysicsVector(); | 1134 | PhysicsVector siz = new PhysicsVector(); |
1135 | siz.X = size.X; | 1135 | siz.X = size.X; |
1136 | siz.Y = size.Y; | 1136 | siz.Y = size.Y; |
@@ -1171,17 +1171,19 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1171 | PhysicsActor result; | 1171 | PhysicsActor result; |
1172 | IMesh mesh = null; | 1172 | IMesh mesh = null; |
1173 | 1173 | ||
1174 | switch (pbs.ProfileShape) | 1174 | //switch (pbs.ProfileShape) |
1175 | { | 1175 | //{ |
1176 | case ProfileShape.Square: | 1176 | // case ProfileShape.Square: |
1177 | /// support simple box & hollow box now; later, more shapes | 1177 | /// support simple box & hollow box now; later, more shapes |
1178 | if (needsMeshing(pbs)) | 1178 | //if (needsMeshing(pbs)) |
1179 | { | 1179 | //{ |
1180 | mesh = mesher.CreateMesh(primName, pbs, size, 32f, isPhysical); | 1180 | // mesh = mesher.CreateMesh(primName, pbs, size, 32f, isPhysical); |
1181 | } | 1181 | //} |
1182 | 1182 | ||
1183 | break; | 1183 | // break; |
1184 | } | 1184 | //} |
1185 | |||
1186 | mesh = mesher.CreateMesh(primName, pbs, size, 32f, isPhysical); | ||
1185 | 1187 | ||
1186 | result = AddPrim(primName, position, size, rotation, mesh, pbs, isPhysical); | 1188 | result = AddPrim(primName, position, size, rotation, mesh, pbs, isPhysical); |
1187 | 1189 | ||
@@ -1521,61 +1523,61 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1521 | /// </summary> | 1523 | /// </summary> |
1522 | /// <param name="pbs"></param> | 1524 | /// <param name="pbs"></param> |
1523 | /// <returns></returns> | 1525 | /// <returns></returns> |
1524 | public bool needsMeshing(PrimitiveBaseShape pbs) | 1526 | //public bool needsMeshing(PrimitiveBaseShape pbs) |
1525 | { | 1527 | //{ |
1526 | //if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle && pbs.ProfileCurve == (byte)LLObject.ProfileCurve.Circle && pbs.PathScaleY <= 0.75f) | 1528 | // //if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle && pbs.ProfileCurve == (byte)LLObject.ProfileCurve.Circle && pbs.PathScaleY <= 0.75f) |
1527 | //Console.WriteLine("needsMeshing: " + " pathCurve: " + pbs.PathCurve.ToString() + " profileCurve: " + pbs.ProfileCurve.ToString() + " pathScaleY: " + LLObject.UnpackPathScale(pbs.PathScaleY).ToString()); | 1529 | // //Console.WriteLine("needsMeshing: " + " pathCurve: " + pbs.PathCurve.ToString() + " profileCurve: " + pbs.ProfileCurve.ToString() + " pathScaleY: " + LLObject.UnpackPathScale(pbs.PathScaleY).ToString()); |
1528 | if (pbs.SculptEntry && !meshSculptedPrim) | 1530 | // if (pbs.SculptEntry && !meshSculptedPrim) |
1529 | { | 1531 | // { |
1530 | return false; | 1532 | // return false; |
1531 | } | 1533 | // } |
1532 | 1534 | ||
1533 | if (pbs.ProfileHollow != 0) | 1535 | // if (pbs.ProfileHollow != 0) |
1534 | return true; | 1536 | // return true; |
1535 | 1537 | ||
1536 | if (((Int16)pbs.PathTwistBegin != 0) || ((Int16)pbs.PathTwist != 0)) | 1538 | // if (((Int16)pbs.PathTwistBegin != 0) || ((Int16)pbs.PathTwist != 0)) |
1537 | return true; | 1539 | // return true; |
1538 | 1540 | ||
1539 | if ((pbs.ProfileBegin != 0) || pbs.ProfileEnd != 0) | 1541 | // if ((pbs.ProfileBegin != 0) || pbs.ProfileEnd != 0) |
1540 | return true; | 1542 | // return true; |
1541 | 1543 | ||
1542 | if ((pbs.PathScaleX != 100) || (pbs.PathScaleY != 100)) | 1544 | // if ((pbs.PathScaleX != 100) || (pbs.PathScaleY != 100)) |
1543 | return true; | 1545 | // return true; |
1544 | 1546 | ||
1545 | if ((pbs.PathShearX != 0) || (pbs.PathShearY != 0)) | 1547 | // if ((pbs.PathShearX != 0) || (pbs.PathShearY != 0)) |
1546 | return true; | 1548 | // return true; |
1547 | 1549 | ||
1548 | if (pbs.ProfileShape == ProfileShape.Circle && pbs.PathCurve == (byte)Extrusion.Straight) | 1550 | // if (pbs.ProfileShape == ProfileShape.Circle && pbs.PathCurve == (byte)Extrusion.Straight) |
1549 | return true; | 1551 | // return true; |
1550 | //if (pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1 && (pbs.Scale.X != pbs.Scale.Y || pbs.Scale.Y != pbs.Scale.Z || pbs.Scale.Z != pbs.Scale.X)) | 1552 | // //if (pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1 && (pbs.Scale.X != pbs.Scale.Y || pbs.Scale.Y != pbs.Scale.Z || pbs.Scale.Z != pbs.Scale.X)) |
1551 | // return true; | 1553 | // // return true; |
1552 | 1554 | ||
1553 | if (pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte) Extrusion.Curve1) | 1555 | // if (pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte) Extrusion.Curve1) |
1554 | return true; | 1556 | // return true; |
1555 | 1557 | ||
1556 | // test for torus | 1558 | // // test for torus |
1557 | if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle | 1559 | // if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle |
1558 | && (pbs.ProfileCurve & 0x07) == (byte)LLObject.ProfileCurve.Circle | 1560 | // && (pbs.ProfileCurve & 0x07) == (byte)LLObject.ProfileCurve.Circle |
1559 | && LLObject.UnpackPathScale(pbs.PathScaleY) <= 0.75f) | 1561 | // && LLObject.UnpackPathScale(pbs.PathScaleY) <= 0.75f) |
1560 | return true; | 1562 | // return true; |
1561 | 1563 | ||
1562 | // test for tube | 1564 | // // test for tube |
1563 | if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle | 1565 | // if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle |
1564 | && (pbs.ProfileCurve & 0x07) == (byte)LLObject.ProfileCurve.EqualTriangle) | 1566 | // && (pbs.ProfileCurve & 0x07) == (byte)LLObject.ProfileCurve.EqualTriangle) |
1565 | return true; | 1567 | // return true; |
1566 | 1568 | ||
1567 | // test for ring | 1569 | // // test for ring |
1568 | if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle | 1570 | // if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle |
1569 | && (pbs.ProfileCurve & 0x07) == (byte)LLObject.ProfileCurve.EqualTriangle) | 1571 | // && (pbs.ProfileCurve & 0x07) == (byte)LLObject.ProfileCurve.EqualTriangle) |
1570 | return true; | 1572 | // return true; |
1571 | 1573 | ||
1572 | if (pbs.ProfileShape == ProfileShape.EquilateralTriangle) | 1574 | // if (pbs.ProfileShape == ProfileShape.EquilateralTriangle) |
1573 | return true; | 1575 | // return true; |
1574 | 1576 | ||
1575 | 1577 | ||
1576 | 1578 | ||
1577 | return false; | 1579 | // return false; |
1578 | } | 1580 | //} |
1579 | 1581 | ||
1580 | /// <summary> | 1582 | /// <summary> |
1581 | /// Called after our prim properties are set Scale, position etc. | 1583 | /// Called after our prim properties are set Scale, position etc. |