diff options
author | UbitUmarov | 2012-03-21 02:39:16 +0000 |
---|---|---|
committer | UbitUmarov | 2012-03-21 02:39:16 +0000 |
commit | f6cbafcaf0f33b37d076d654e35c20990eb205d8 (patch) | |
tree | a32081d45342a49327f37079643c1f7c0f732fb9 /OpenSim/Region/Framework/Scenes | |
parent | Tell physics about physics shape when creating. Added some virtual methods to... (diff) | |
download | opensim-SC_OLD-f6cbafcaf0f33b37d076d654e35c20990eb205d8.zip opensim-SC_OLD-f6cbafcaf0f33b37d076d654e35c20990eb205d8.tar.gz opensim-SC_OLD-f6cbafcaf0f33b37d076d654e35c20990eb205d8.tar.bz2 opensim-SC_OLD-f6cbafcaf0f33b37d076d654e35c20990eb205d8.tar.xz |
Changes of PrimShapeType should now work with UbitOde ( almost untested )
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a494864..51a3c18 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1497,6 +1497,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1497 | get { return m_physicsShapeType; } | 1497 | get { return m_physicsShapeType; } |
1498 | set | 1498 | set |
1499 | { | 1499 | { |
1500 | byte oldv = m_physicsShapeType; | ||
1500 | if (value >= 0 && value <= (byte)PhysShapeType.convex) | 1501 | if (value >= 0 && value <= (byte)PhysShapeType.convex) |
1501 | { | 1502 | { |
1502 | if (value == (byte)PhysShapeType.none && ParentGroup != null && ParentGroup.RootPart == this) | 1503 | if (value == (byte)PhysShapeType.none && ParentGroup != null && ParentGroup.RootPart == this) |
@@ -1507,11 +1508,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
1507 | else | 1508 | else |
1508 | m_physicsShapeType = DefaultPhysicsShapeType(); | 1509 | m_physicsShapeType = DefaultPhysicsShapeType(); |
1509 | 1510 | ||
1510 | if (ParentGroup != null) | ||
1511 | ParentGroup.HasGroupChanged = true; | ||
1512 | 1511 | ||
1513 | if(m_physicsShapeType != value) | 1512 | if (m_physicsShapeType != oldv && ParentGroup != null) |
1513 | { | ||
1514 | if (m_physicsShapeType == (byte)PhysShapeType.none) | ||
1515 | { | ||
1516 | if (PhysActor != null) | ||
1517 | { | ||
1518 | Velocity = new Vector3(0, 0, 0); | ||
1519 | Acceleration = new Vector3(0, 0, 0); | ||
1520 | if (ParentGroup.RootPart == this) | ||
1521 | AngularVelocity = new Vector3(0, 0, 0); | ||
1522 | ParentGroup.Scene.RemovePhysicalPrim(1); | ||
1523 | RemoveFromPhysics(); | ||
1524 | } | ||
1525 | } | ||
1526 | else if (PhysActor == null) | ||
1527 | ApplyPhysics((uint)Flags, VolumeDetectActive, false); | ||
1528 | else | ||
1529 | PhysActor.PhysicsShapeType = m_physicsShapeType; | ||
1530 | } | ||
1531 | if (m_physicsShapeType != value) | ||
1532 | { | ||
1533 | if (ParentGroup != null) | ||
1534 | ParentGroup.HasGroupChanged = true; | ||
1535 | |||
1514 | UpdatePhysRequired = true; | 1536 | UpdatePhysRequired = true; |
1537 | } | ||
1515 | } | 1538 | } |
1516 | } | 1539 | } |
1517 | 1540 | ||
@@ -4575,20 +4598,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4575 | { | 4598 | { |
4576 | PhysicsShapeType = (byte)physdata.PhysShapeType; | 4599 | PhysicsShapeType = (byte)physdata.PhysShapeType; |
4577 | 4600 | ||
4578 | if (PhysicsShapeType == (byte)PhysShapeType.none) | ||
4579 | { | ||
4580 | if (PhysActor != null) | ||
4581 | { | ||
4582 | Velocity = new Vector3(0, 0, 0); | ||
4583 | Acceleration = new Vector3(0, 0, 0); | ||
4584 | if (ParentGroup.RootPart == this) | ||
4585 | AngularVelocity = new Vector3(0, 0, 0); | ||
4586 | ParentGroup.Scene.RemovePhysicalPrim(1); | ||
4587 | RemoveFromPhysics(); | ||
4588 | } | ||
4589 | } | ||
4590 | else if (PhysActor == null) | ||
4591 | ApplyPhysics((uint)Flags, VolumeDetectActive, false); | ||
4592 | } | 4601 | } |
4593 | 4602 | ||
4594 | if(Density != physdata.Density) | 4603 | if(Density != physdata.Density) |