diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 4fb0afb..6e01d2d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -329,6 +329,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
329 | get { return (RootPart.Flags & PrimFlags.Physics) != 0; } | 329 | get { return (RootPart.Flags & PrimFlags.Physics) != 0; } |
330 | } | 330 | } |
331 | 331 | ||
332 | |||
332 | /// <summary> | 333 | /// <summary> |
333 | /// Is this scene object temporary? | 334 | /// Is this scene object temporary? |
334 | /// </summary> | 335 | /// </summary> |
@@ -2536,6 +2537,58 @@ namespace OpenSim.Region.Framework.Scenes | |||
2536 | } | 2537 | } |
2537 | } | 2538 | } |
2538 | 2539 | ||
2540 | public void RotLookAt(Quaternion target, float strength, float damping) | ||
2541 | { | ||
2542 | if(IsDeleted) | ||
2543 | return; | ||
2544 | |||
2545 | // non physical is handle in LSL api | ||
2546 | if(!UsesPhysics || IsAttachment) | ||
2547 | return; | ||
2548 | |||
2549 | SceneObjectPart rootpart = m_rootPart; | ||
2550 | if (rootpart != null) | ||
2551 | { | ||
2552 | /* physics still doesnt suport this | ||
2553 | if (rootpart.PhysActor != null) | ||
2554 | { | ||
2555 | rootpart.PhysActor.APIDTarget = new Quaternion(target.X, target.Y, target.Z, target.W); | ||
2556 | rootpart.PhysActor.APIDStrength = strength; | ||
2557 | rootpart.PhysActor.APIDDamping = damping; | ||
2558 | rootpart.PhysActor.APIDActive = true; | ||
2559 | } | ||
2560 | */ | ||
2561 | // so do it in rootpart | ||
2562 | rootpart.RotLookAt(target, strength, damping); | ||
2563 | } | ||
2564 | } | ||
2565 | |||
2566 | public void StartLookAt(Quaternion target, float strength, float damping) | ||
2567 | { | ||
2568 | if(IsDeleted) | ||
2569 | return; | ||
2570 | |||
2571 | // non physical is done by LSL APi | ||
2572 | if(!UsesPhysics || IsAttachment) | ||
2573 | return; | ||
2574 | |||
2575 | if (m_rootPart != null) | ||
2576 | m_rootPart.RotLookAt(target, strength, damping); | ||
2577 | } | ||
2578 | |||
2579 | public void StopLookAt() | ||
2580 | { | ||
2581 | SceneObjectPart rootpart = m_rootPart; | ||
2582 | if (rootpart != null) | ||
2583 | { | ||
2584 | if (rootpart.PhysActor != null) | ||
2585 | { | ||
2586 | rootpart.PhysActor.APIDActive = false; | ||
2587 | } | ||
2588 | |||
2589 | rootpart.StopLookAt(); | ||
2590 | } | ||
2591 | } | ||
2539 | /// <summary> | 2592 | /// <summary> |
2540 | /// Uses a PID to attempt to clamp the object on the Z axis at the given height over tau seconds. | 2593 | /// Uses a PID to attempt to clamp the object on the Z axis at the given height over tau seconds. |
2541 | /// </summary> | 2594 | /// </summary> |