protected virtual void fetchMachineNoise()
 {
     stopMachineNoise();
     machineNoise = MediaSystem.GetMachineNoise(soundIndex, MachineNumber);
     //if(machineNoise != null)
     //    machineNoise.Apply3D(RenderingDevice.Camera.Ears, emitter);
 }
        public override void Update(GameTime gameTime)
        {
            #if DEBUG
            if(!inputPaused)
            #endif
                if(checkInputs() && !rotating)
                {
                    rotating = true;
                    rotateJoint.Motor.Settings.Servo.Goal = (negativeAngle ? !atOriginForRotation : atOriginForRotation) ? angle : 0;
                }

            if(rotating)
            {
                if(pathTime > rotateTime && Math.Abs(rotateJoint.Motor.RelativeVelocity) < epsilon)
                {
                    rotating = false;
                    atOriginForRotation = !atOriginForRotation;
                    pathTime = 0;
                }
            }

            if(slideTime > translationTime + lengthToPause || slideTime < lengthToPause)
            {
                if(slideTime > translationTime + lengthToPause * 2)
                {
                    atOriginForTranslation = !atOriginForTranslation;
                    slideTime = 0;
                }
                //SetTranslationToZero();
                if(railSlideSound != null && !railSlideSound.IsDisposed)
                {
                    railSlideSound.Stop(false);
                    railSlideSound = null;
                }
            }
            if((slideTime < translationTime + lengthToPause && slideTime > lengthToPause))
            {
                if(railSlideSound == null && soundWhenMoves)
                    railSlideSound = MediaSystem.GetMachineNoise(soundIndex, MachineNumber);

                baseJoint.Motor.Settings.Servo.Goal = atOriginForTranslation ? unitsToTranslate.Length() : 0;
                //foreach(BaseModel m in modelList)
                //    CalculateVelocity(m);
                //foreach(Tube t in tubeList)
                //    CalculateVelocity(t);
            }
            base.Update(gameTime);
        }