diff options
author | UbitUmarov | 2016-11-16 13:07:23 +0000 |
---|---|---|
committer | UbitUmarov | 2016-11-16 13:07:23 +0000 |
commit | ec8393571f88ab54a47ffcb91d0f82a815a682ad (patch) | |
tree | 362b08a13538a55ef2bff7a3e4290341ce9f159c /OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs | |
parent | Merge branch 'master' into httptests (diff) | |
parent | fix parsing of a vector4 and storing on a lsl quaternion needed for lightSha... (diff) | |
download | opensim-SC-ec8393571f88ab54a47ffcb91d0f82a815a682ad.zip opensim-SC-ec8393571f88ab54a47ffcb91d0f82a815a682ad.tar.gz opensim-SC-ec8393571f88ab54a47ffcb91d0f82a815a682ad.tar.bz2 opensim-SC-ec8393571f88ab54a47ffcb91d0f82a815a682ad.tar.xz |
Merge branch 'master' into httptests
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs index 9640e91..f7e1044 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs | |||
@@ -632,6 +632,25 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
632 | } | 632 | } |
633 | } | 633 | } |
634 | 634 | ||
635 | public override Vector3 TargetVelocity | ||
636 | { | ||
637 | get | ||
638 | { | ||
639 | return m_targetVelocity; | ||
640 | } | ||
641 | set | ||
642 | { | ||
643 | if (value.IsFinite()) | ||
644 | { | ||
645 | AddChange(changes.TargetVelocity, value); | ||
646 | } | ||
647 | else | ||
648 | { | ||
649 | m_log.Warn("[PHYSICS]: Got a NaN velocity from Scene in a Character"); | ||
650 | } | ||
651 | } | ||
652 | } | ||
653 | |||
635 | public override Vector3 Torque | 654 | public override Vector3 Torque |
636 | { | 655 | { |
637 | get { return Vector3.Zero; } | 656 | get { return Vector3.Zero; } |
@@ -689,7 +708,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
689 | } | 708 | } |
690 | else | 709 | else |
691 | { | 710 | { |
692 | AddChange(changes.Velocity, force); | 711 | AddChange(changes.TargetVelocity, force); |
693 | } | 712 | } |
694 | } | 713 | } |
695 | else | 714 | else |
@@ -1671,16 +1690,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1671 | { | 1690 | { |
1672 | AvatarGeomAndBodyDestroy(); | 1691 | AvatarGeomAndBodyDestroy(); |
1673 | 1692 | ||
1674 | |||
1675 | float oldsz = m_size.Z; | 1693 | float oldsz = m_size.Z; |
1676 | m_size = pSize; | 1694 | m_size = pSize; |
1677 | 1695 | ||
1678 | |||
1679 | AvatarGeomAndBodyCreation(_position.X, _position.Y, | 1696 | AvatarGeomAndBodyCreation(_position.X, _position.Y, |
1680 | _position.Z + (m_size.Z - oldsz) * 0.5f); | 1697 | _position.Z + (m_size.Z - oldsz) * 0.5f); |
1681 | 1698 | ||
1682 | Velocity = Vector3.Zero; | 1699 | // Velocity = Vector3.Zero; |
1683 | 1700 | m_targetVelocity = Vector3.Zero; | |
1684 | 1701 | ||
1685 | _parent_scene.actor_name_map[collider] = (PhysicsActor)this; | 1702 | _parent_scene.actor_name_map[collider] = (PhysicsActor)this; |
1686 | _parent_scene.actor_name_map[capsule] = (PhysicsActor)this; | 1703 | _parent_scene.actor_name_map[capsule] = (PhysicsActor)this; |
@@ -1739,6 +1756,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1739 | 1756 | ||
1740 | private void changeVelocity(Vector3 newVel) | 1757 | private void changeVelocity(Vector3 newVel) |
1741 | { | 1758 | { |
1759 | _velocity = newVel; | ||
1760 | setFreeMove(); | ||
1761 | |||
1762 | if (Body != IntPtr.Zero) | ||
1763 | d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z); | ||
1764 | } | ||
1765 | |||
1766 | private void changeTargetVelocity(Vector3 newVel) | ||
1767 | { | ||
1742 | m_pidControllerActive = true; | 1768 | m_pidControllerActive = true; |
1743 | m_freemove = false; | 1769 | m_freemove = false; |
1744 | _target_velocity = newVel; | 1770 | _target_velocity = newVel; |
@@ -1881,6 +1907,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1881 | changeVelocity((Vector3)arg); | 1907 | changeVelocity((Vector3)arg); |
1882 | break; | 1908 | break; |
1883 | 1909 | ||
1910 | case changes.TargetVelocity: | ||
1911 | changeTargetVelocity((Vector3)arg); | ||
1912 | break; | ||
1913 | |||
1884 | // case changes.Acceleration: | 1914 | // case changes.Acceleration: |
1885 | // changeacceleration((Vector3)arg); | 1915 | // changeacceleration((Vector3)arg); |
1886 | // break; | 1916 | // break; |