diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index f188e8d..fbe959a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1416,6 +1416,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1416 | } | 1416 | } |
1417 | 1417 | ||
1418 | // not a propriety to move to methods place later | 1418 | // not a propriety to move to methods place later |
1419 | private bool HasMesh() | ||
1420 | { | ||
1421 | if (Shape != null && (Shape.SculptType == (byte)SculptType.Mesh)) | ||
1422 | return true; | ||
1423 | return false; | ||
1424 | } | ||
1425 | |||
1426 | // not a propriety to move to methods place later | ||
1419 | public byte DefaultPhysicsShapeType() | 1427 | public byte DefaultPhysicsShapeType() |
1420 | { | 1428 | { |
1421 | byte type; | 1429 | byte type; |
@@ -1428,6 +1436,60 @@ namespace OpenSim.Region.Framework.Scenes | |||
1428 | return type; | 1436 | return type; |
1429 | } | 1437 | } |
1430 | 1438 | ||
1439 | [XmlIgnore] | ||
1440 | public bool UsesComplexCost | ||
1441 | { | ||
1442 | get | ||
1443 | { | ||
1444 | byte pst = PhysicsShapeType; | ||
1445 | if(pst == (byte) PhysShapeType.none || pst == (byte) PhysShapeType.convex || HasMesh()) | ||
1446 | return true; | ||
1447 | return false; | ||
1448 | } | ||
1449 | } | ||
1450 | |||
1451 | [XmlIgnore] | ||
1452 | public float PhysicsCost | ||
1453 | { | ||
1454 | get | ||
1455 | { | ||
1456 | if(PhysicsShapeType == (byte)PhysShapeType.none) | ||
1457 | return 0; | ||
1458 | |||
1459 | float cost = 0.1f; | ||
1460 | if (PhysActor != null) | ||
1461 | // cost += PhysActor.Cost; | ||
1462 | |||
1463 | if ((Flags & PrimFlags.Physics) != 0) | ||
1464 | cost *= (1.0f + 0.01333f * Scale.LengthSquared()); // 0.01333 == 0.04/3 | ||
1465 | return cost; | ||
1466 | } | ||
1467 | } | ||
1468 | |||
1469 | [XmlIgnore] | ||
1470 | public float StreamingCost | ||
1471 | { | ||
1472 | get | ||
1473 | { | ||
1474 | |||
1475 | |||
1476 | return 0.1f; | ||
1477 | } | ||
1478 | } | ||
1479 | |||
1480 | [XmlIgnore] | ||
1481 | public float SimulationCost | ||
1482 | { | ||
1483 | get | ||
1484 | { | ||
1485 | // ignoring scripts. Don't like considering them for this | ||
1486 | if((Flags & PrimFlags.Physics) != 0) | ||
1487 | return 1.0f; | ||
1488 | |||
1489 | return 0.5f; | ||
1490 | } | ||
1491 | } | ||
1492 | |||
1431 | public byte PhysicsShapeType | 1493 | public byte PhysicsShapeType |
1432 | { | 1494 | { |
1433 | get { return m_physicsShapeType; } | 1495 | get { return m_physicsShapeType; } |