refactor: Eliminate one line ODECharacter.doForce() method for code clarity
							parent
							
								
									225b925f4e
								
							
						
					
					
						commit
						063f0f5d97
					
				| 
						 | 
				
			
			@ -70,7 +70,6 @@ namespace OpenSim.Region.Physics.OdePlugin
 | 
			
		|||
 | 
			
		||||
        private Vector3 _position;
 | 
			
		||||
        private d.Vector3 _zeroPosition;
 | 
			
		||||
        // private d.Matrix3 m_StandUpRotation;
 | 
			
		||||
        private bool _zeroFlag = false;
 | 
			
		||||
        private bool m_lastUpdateSent = false;
 | 
			
		||||
        private Vector3 _velocity;
 | 
			
		||||
| 
						 | 
				
			
			@ -554,8 +553,6 @@ namespace OpenSim.Region.Physics.OdePlugin
 | 
			
		|||
        // place that is safe to call this routine AvatarGeomAndBodyCreation.
 | 
			
		||||
        private void AvatarGeomAndBodyCreation(float npositionX, float npositionY, float npositionZ, float tensor)
 | 
			
		||||
        {
 | 
			
		||||
            //CAPSULE_LENGTH = -5;
 | 
			
		||||
            //CAPSULE_RADIUS = -5;
 | 
			
		||||
            int dAMotorEuler = 1;
 | 
			
		||||
//            _parent_scene.waitForSpaceUnlock(_parent_scene.space);
 | 
			
		||||
            if (CAPSULE_LENGTH <= 0)
 | 
			
		||||
| 
						 | 
				
			
			@ -831,7 +828,6 @@ namespace OpenSim.Region.Physics.OdePlugin
 | 
			
		|||
                    m_taintForce += force;
 | 
			
		||||
                    _parent_scene.AddPhysicsActorTaint(this);
 | 
			
		||||
 | 
			
		||||
                    //doForce(force);
 | 
			
		||||
                    // If uncommented, things get pushed off world
 | 
			
		||||
                    //
 | 
			
		||||
                    // m_log.Debug("Push!");
 | 
			
		||||
| 
						 | 
				
			
			@ -856,15 +852,6 @@ namespace OpenSim.Region.Physics.OdePlugin
 | 
			
		|||
        {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// After all of the forces add up with 'add force' we apply them with doForce
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="force"></param>
 | 
			
		||||
        public void doForce(Vector3 force)
 | 
			
		||||
        {
 | 
			
		||||
            d.BodyAddForce(Body, force.X, force.Y, force.Z);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void SetMomentum(Vector3 momentum)
 | 
			
		||||
        {
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -1030,7 +1017,8 @@ namespace OpenSim.Region.Physics.OdePlugin
 | 
			
		|||
 | 
			
		||||
            if (vec.IsFinite())
 | 
			
		||||
            {
 | 
			
		||||
                doForce(vec);
 | 
			
		||||
                // Apply the total force acting on this avatar
 | 
			
		||||
                d.BodyAddForce(Body, vec.X, vec.Y, vec.Z);
 | 
			
		||||
 | 
			
		||||
                if (!_zeroFlag)
 | 
			
		||||
                    AlignAvatarTiltWithCurrentDirectionOfMovement(vec);
 | 
			
		||||
| 
						 | 
				
			
			@ -1258,7 +1246,7 @@ namespace OpenSim.Region.Physics.OdePlugin
 | 
			
		|||
                    // FIXME: This is not a good solution since it's subject to a race condition if a force is another
 | 
			
		||||
                    // thread sets a new force while we're in this loop (since it could be obliterated by
 | 
			
		||||
                    // m_taintForce = Vector3.Zero.  Need to lock ProcessTaints() when we set a new tainted force.
 | 
			
		||||
                    doForce(m_taintForce);
 | 
			
		||||
                    d.BodyAddForce(Body, m_taintForce.X, m_taintForce.Y, m_taintForce.Z);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                m_taintForce = Vector3.Zero;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue