diff options
author | UbitUmarov | 2015-12-01 10:15:38 +0000 |
---|---|---|
committer | UbitUmarov | 2015-12-01 10:15:38 +0000 |
commit | a9e58d61754ef4f3cf0c586ad343146418307c10 (patch) | |
tree | 1ff0a248279830ac38c3694985540b975e8ea631 /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |
parent | Merge branch 'master' of opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC-a9e58d61754ef4f3cf0c586ad343146418307c10.zip opensim-SC-a9e58d61754ef4f3cf0c586ad343146418307c10.tar.gz opensim-SC-a9e58d61754ef4f3cf0c586ad343146418307c10.tar.bz2 opensim-SC-a9e58d61754ef4f3cf0c586ad343146418307c10.tar.xz |
some changes due to lookAt and RotLookAt
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 46 |
1 files changed, 4 insertions, 42 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index e780f86..4fb0afb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -2535,46 +2535,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2535 | RootPart.ScheduleTerseUpdate(); // send a stop information | 2535 | RootPart.ScheduleTerseUpdate(); // send a stop information |
2536 | } | 2536 | } |
2537 | } | 2537 | } |
2538 | |||
2539 | public void rotLookAt(Quaternion target, float strength, float damping) | ||
2540 | { | ||
2541 | SceneObjectPart rootpart = m_rootPart; | ||
2542 | if (rootpart != null) | ||
2543 | { | ||
2544 | if (IsAttachment) | ||
2545 | { | ||
2546 | /* | ||
2547 | ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); | ||
2548 | if (avatar != null) | ||
2549 | { | ||
2550 | Rotate the Av? | ||
2551 | } */ | ||
2552 | } | ||
2553 | else | ||
2554 | { | ||
2555 | if (rootpart.PhysActor != null) | ||
2556 | { // APID must be implemented in your physics system for this to function. | ||
2557 | rootpart.PhysActor.APIDTarget = new Quaternion(target.X, target.Y, target.Z, target.W); | ||
2558 | rootpart.PhysActor.APIDStrength = strength; | ||
2559 | rootpart.PhysActor.APIDDamping = damping; | ||
2560 | rootpart.PhysActor.APIDActive = true; | ||
2561 | } | ||
2562 | } | ||
2563 | } | ||
2564 | } | ||
2565 | |||
2566 | public void stopLookAt() | ||
2567 | { | ||
2568 | SceneObjectPart rootpart = m_rootPart; | ||
2569 | if (rootpart != null) | ||
2570 | { | ||
2571 | if (rootpart.PhysActor != null) | ||
2572 | { // APID must be implemented in your physics system for this to function. | ||
2573 | rootpart.PhysActor.APIDActive = false; | ||
2574 | } | ||
2575 | } | ||
2576 | |||
2577 | } | ||
2578 | 2538 | ||
2579 | /// <summary> | 2539 | /// <summary> |
2580 | /// Uses a PID to attempt to clamp the object on the Z axis at the given height over tau seconds. | 2540 | /// Uses a PID to attempt to clamp the object on the Z axis at the given height over tau seconds. |
@@ -2726,12 +2686,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2726 | } | 2686 | } |
2727 | } | 2687 | } |
2728 | 2688 | ||
2689 | // while physics doesn't suports LookAt, we do it in RootPart | ||
2690 | if (!IsSelected) | ||
2691 | RootPart.UpdateLookAt(); | ||
2692 | |||
2729 | SceneObjectPart[] parts = m_parts.GetArray(); | 2693 | SceneObjectPart[] parts = m_parts.GetArray(); |
2730 | for (int i = 0; i < parts.Length; i++) | 2694 | for (int i = 0; i < parts.Length; i++) |
2731 | { | 2695 | { |
2732 | SceneObjectPart part = parts[i]; | 2696 | SceneObjectPart part = parts[i]; |
2733 | if (!IsSelected) | ||
2734 | part.UpdateLookAt(); | ||
2735 | part.SendScheduledUpdates(); | 2697 | part.SendScheduledUpdates(); |
2736 | } | 2698 | } |
2737 | } | 2699 | } |