aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authordarok2007-11-03 10:25:43 +0000
committerdarok2007-11-03 10:25:43 +0000
commitf8e0cf0f1de3cabded7bce2e438cc37ce4bb989c (patch)
treefa9f855fc58616c24bdeed613f7f7edef395ee85 /OpenSim/Region/Environment/Scenes
parentAdded temporary try catch to udpserver while testing something out (will remo... (diff)
downloadopensim-SC_OLD-f8e0cf0f1de3cabded7bce2e438cc37ce4bb989c.zip
opensim-SC_OLD-f8e0cf0f1de3cabded7bce2e438cc37ce4bb989c.tar.gz
opensim-SC_OLD-f8e0cf0f1de3cabded7bce2e438cc37ce4bb989c.tar.bz2
opensim-SC_OLD-f8e0cf0f1de3cabded7bce2e438cc37ce4bb989c.tar.xz
Changes in BulletXPlugin: Added new class BulletXActor class inherits from PhysicsActor and it's the ancestor for BulletXCharacter and BulletXPrim.Physical modifications: Changes for pass the value of Physical flag in the SceneObjectPart class to the Physics engines. New call for AddPrimShape so it has a new parameter called "isPhysical". The old call will be obselete soon (i believe). PhysActor and its descendants have a new property called IsPhysical. By the way no new special funcionallity added. It's more like preparing the way for new modifications.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs3
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs12
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs6
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs19
4 files changed, 24 insertions, 16 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index a0c9a50..17f7566 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -456,6 +456,7 @@ namespace OpenSim.Region.Environment.Scenes
456 AddEntity(group); 456 AddEntity(group);
457 group.AbsolutePosition = pos; 457 group.AbsolutePosition = pos;
458 SceneObjectPart rootPart = group.GetChildPart(group.UUID); 458 SceneObjectPart rootPart = group.GetChildPart(group.UUID);
459 bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0);
459 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) 460 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
460 { 461 {
461 PrimitiveBaseShape pbs = rootPart.Shape; 462 PrimitiveBaseShape pbs = rootPart.Shape;
@@ -466,7 +467,7 @@ namespace OpenSim.Region.Environment.Scenes
466 rootPart.AbsolutePosition.Z), 467 rootPart.AbsolutePosition.Z),
467 new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), 468 new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
468 new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, 469 new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
469 rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); 470 rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics);
470 } 471 }
471 } 472 }
472 } 473 }
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index d02f3e3..9eb3a71 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -533,6 +533,7 @@ namespace OpenSim.Region.Environment.Scenes
533 { 533 {
534 AddEntityFromStorage(prim); 534 AddEntityFromStorage(prim);
535 SceneObjectPart rootPart = prim.GetChildPart(prim.UUID); 535 SceneObjectPart rootPart = prim.GetChildPart(prim.UUID);
536 bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0);
536 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) 537 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
537 rootPart.PhysActor = phyScene.AddPrimShape( 538 rootPart.PhysActor = phyScene.AddPrimShape(
538 rootPart.Name, 539 rootPart.Name,
@@ -541,7 +542,7 @@ namespace OpenSim.Region.Environment.Scenes
541 rootPart.AbsolutePosition.Z), 542 rootPart.AbsolutePosition.Z),
542 new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), 543 new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
543 new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, 544 new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
544 rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); 545 rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics);
545 } 546 }
546 MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); 547 MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
547 } 548 }
@@ -582,6 +583,7 @@ namespace OpenSim.Region.Environment.Scenes
582 rootPart.ObjectFlags += (uint) LLObject.ObjectFlags.Phantom; 583 rootPart.ObjectFlags += (uint) LLObject.ObjectFlags.Phantom;
583 } 584 }
584 // if not phantom, add to physics 585 // if not phantom, add to physics
586 bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0);
585 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) 587 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
586 rootPart.PhysActor = 588 rootPart.PhysActor =
587 phyScene.AddPrimShape( 589 phyScene.AddPrimShape(
@@ -589,7 +591,7 @@ namespace OpenSim.Region.Environment.Scenes
589 rootPart.Shape, 591 rootPart.Shape,
590 new PhysicsVector(pos.X, pos.Y, pos.Z), 592 new PhysicsVector(pos.X, pos.Y, pos.Z),
591 new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), 593 new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
592 new Quaternion()); 594 new Quaternion(), UsePhysics);
593 } 595 }
594 } 596 }
595 597
@@ -669,6 +671,7 @@ namespace OpenSim.Region.Environment.Scenes
669 AddEntity(obj); 671 AddEntity(obj);
670 672
671 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); 673 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
674 bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0);
672 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) 675 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
673 rootPart.PhysActor = phyScene.AddPrimShape( 676 rootPart.PhysActor = phyScene.AddPrimShape(
674 rootPart.Name, 677 rootPart.Name,
@@ -677,7 +680,7 @@ namespace OpenSim.Region.Environment.Scenes
677 rootPart.AbsolutePosition.Z), 680 rootPart.AbsolutePosition.Z),
678 new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), 681 new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
679 new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, 682 new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
680 rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); 683 rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics);
681 primCount++; 684 primCount++;
682 } 685 }
683 } 686 }
@@ -734,6 +737,7 @@ namespace OpenSim.Region.Environment.Scenes
734 AddEntityFromStorage(obj); 737 AddEntityFromStorage(obj);
735 738
736 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); 739 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
740 bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0);
737 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) 741 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
738 rootPart.PhysActor = phyScene.AddPrimShape( 742 rootPart.PhysActor = phyScene.AddPrimShape(
739 rootPart.Name, 743 rootPart.Name,
@@ -742,7 +746,7 @@ namespace OpenSim.Region.Environment.Scenes
742 rootPart.AbsolutePosition.Z), 746 rootPart.AbsolutePosition.Z),
743 new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), 747 new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
744 new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, 748 new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
745 rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); 749 rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics);
746 } 750 }
747 751
748 public void SavePrimsToXml2(string fileName) 752 public void SavePrimsToXml2(string fileName)
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 2f746b2..39f4e5c 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -438,7 +438,8 @@ namespace OpenSim.Region.Environment.Scenes
438 dupe.RootPart.AbsolutePosition.Z), 438 dupe.RootPart.AbsolutePosition.Z),
439 new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z), 439 new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z),
440 new Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X, 440 new Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X,
441 dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z)); 441 dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z),
442 dupe.RootPart.PhysActor.IsPhysical);
442 } 443 }
443 444
444 List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values); 445 List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values);
@@ -977,7 +978,8 @@ namespace OpenSim.Region.Environment.Scenes
977 m_rootPart.AbsolutePosition.Z), 978 m_rootPart.AbsolutePosition.Z),
978 new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z), 979 new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z),
979 new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, 980 new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X,
980 m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z)); 981 m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z),
982 m_rootPart.PhysActor.IsPhysical);
981 } 983 }
982 } 984 }
983 985
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 38eaf90..d0edff3 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -672,6 +672,15 @@ namespace OpenSim.Region.Environment.Scenes
672 //Silently ignore it - TODO: FIXME Quick 672 //Silently ignore it - TODO: FIXME Quick
673 } 673 }
674 674
675 if (UsePhysics)
676 {
677 AddFlag(LLObject.ObjectFlags.Physics);
678 }
679 else
680 {
681 RemFlag(LLObject.ObjectFlags.Physics);
682 }
683
675 if (IsPhantom) 684 if (IsPhantom)
676 { 685 {
677 AddFlag(LLObject.ObjectFlags.Phantom); 686 AddFlag(LLObject.ObjectFlags.Phantom);
@@ -694,18 +703,10 @@ namespace OpenSim.Region.Environment.Scenes
694 AbsolutePosition.Z), 703 AbsolutePosition.Z),
695 new PhysicsVector(Scale.X, Scale.Y, Scale.Z), 704 new PhysicsVector(Scale.X, Scale.Y, Scale.Z),
696 new Quaternion(RotationOffset.W, RotationOffset.X, 705 new Quaternion(RotationOffset.W, RotationOffset.X,
697 RotationOffset.Y, RotationOffset.Z)); 706 RotationOffset.Y, RotationOffset.Z), UsePhysics);
698 } 707 }
699 } 708 }
700 709
701 if (UsePhysics)
702 {
703 AddFlag(LLObject.ObjectFlags.Physics);
704 }
705 else
706 {
707 RemFlag(LLObject.ObjectFlags.Physics);
708 }
709 if (IsTemporary) 710 if (IsTemporary)
710 { 711 {
711 AddFlag(LLObject.ObjectFlags.TemporaryOnRez); 712 AddFlag(LLObject.ObjectFlags.TemporaryOnRez);