From 0538096fa3397c52b1171a3ec83dc88489002710 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sat, 29 Dec 2012 08:32:57 -0800 Subject: BulletSim: an 'if' to suppress multiple setting of avatar orientation. Looks like the viewer bombards the server with avatar orientation information (we're talking several hundred a second) when the avatar is being turned or when walking. This change just reduces the number of 'set' calls into unmanaged code. --- OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index 9659542..e19b5b3 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs @@ -558,12 +558,16 @@ public sealed class BSCharacter : BSPhysObject public override OMV.Quaternion Orientation { get { return _orientation; } set { - _orientation = value; - // m_log.DebugFormat("{0}: set orientation to {1}", LogHeader, _orientation); - PhysicsScene.TaintedObject("BSCharacter.setOrientation", delegate() + // Orientation is set zillions of times when an avatar is walking. It's like + // the viewer doesn't trust us. + if (_orientation != value) { - ForceOrientation = _orientation; - }); + _orientation = value; + PhysicsScene.TaintedObject("BSCharacter.setOrientation", delegate() + { + ForceOrientation = _orientation; + }); + } } } // Go directly to Bullet to get/set the value. -- cgit v1.1