diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 39 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 12 |
2 files changed, 51 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 38a0cff..ab7abbe 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1726,6 +1726,45 @@ namespace OpenSim.Region.Framework.Scenes | |||
1726 | } | 1726 | } |
1727 | } | 1727 | } |
1728 | 1728 | ||
1729 | public void rotLookAt(Quaternion target, float strength, float damping) | ||
1730 | { | ||
1731 | SceneObjectPart rootpart = m_rootPart; | ||
1732 | if (rootpart != null) | ||
1733 | { | ||
1734 | if (IsAttachment) | ||
1735 | { | ||
1736 | /* | ||
1737 | ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); | ||
1738 | if (avatar != null) | ||
1739 | { | ||
1740 | Rotate the Av? | ||
1741 | } */ | ||
1742 | } | ||
1743 | else | ||
1744 | { | ||
1745 | if (rootpart.PhysActor != null) | ||
1746 | { | ||
1747 | rootpart.PhysActor.APIDTarget = new Quaternion(target.X, target.Y, target.Z, target.W); | ||
1748 | rootpart.PhysActor.APIDStrength = strength; | ||
1749 | rootpart.PhysActor.APIDDamping = damping; | ||
1750 | rootpart.PhysActor.APIDActive = true; | ||
1751 | } | ||
1752 | } | ||
1753 | } | ||
1754 | } | ||
1755 | public void stopLookAt() | ||
1756 | { | ||
1757 | SceneObjectPart rootpart = m_rootPart; | ||
1758 | if (rootpart != null) | ||
1759 | { | ||
1760 | if (rootpart.PhysActor != null) | ||
1761 | { | ||
1762 | rootpart.PhysActor.APIDActive = false; | ||
1763 | } | ||
1764 | } | ||
1765 | |||
1766 | } | ||
1767 | |||
1729 | /// <summary> | 1768 | /// <summary> |
1730 | /// Uses a PID to attempt to clamp the object on the Z axis at the given height over tau seconds. | 1769 | /// Uses a PID to attempt to clamp the object on the Z axis at the given height over tau seconds. |
1731 | /// </summary> | 1770 | /// </summary> |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 9b11582..7d889ee 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2191,6 +2191,11 @@ if (m_shape != null) { | |||
2191 | ParentGroup.HasGroupChanged = true; | 2191 | ParentGroup.HasGroupChanged = true; |
2192 | ScheduleFullUpdate(); | 2192 | ScheduleFullUpdate(); |
2193 | } | 2193 | } |
2194 | |||
2195 | public void RotLookAt(Quaternion target, float strength, float damping) | ||
2196 | { | ||
2197 | m_parentGroup.rotLookAt(target, strength, damping); | ||
2198 | } | ||
2194 | 2199 | ||
2195 | /// <summary> | 2200 | /// <summary> |
2196 | /// Schedules this prim for a full update | 2201 | /// Schedules this prim for a full update |
@@ -2684,6 +2689,13 @@ if (m_shape != null) { | |||
2684 | SetText(text); | 2689 | SetText(text); |
2685 | } | 2690 | } |
2686 | 2691 | ||
2692 | public void StopLookAt() | ||
2693 | { | ||
2694 | m_parentGroup.stopLookAt(); | ||
2695 | |||
2696 | m_parentGroup.ScheduleGroupForTerseUpdate(); | ||
2697 | } | ||
2698 | |||
2687 | public void StopMoveToTarget() | 2699 | public void StopMoveToTarget() |
2688 | { | 2700 | { |
2689 | m_parentGroup.stopMoveToTarget(); | 2701 | m_parentGroup.stopMoveToTarget(); |