SEToolbox.Models.StructureMeteorModel.MaxVelocityAtPlayer C# (CSharp) Method

MaxVelocityAtPlayer() public method

public MaxVelocityAtPlayer ( Vector3D playerPosition ) : void
playerPosition Vector3D
return void
        public void MaxVelocityAtPlayer(Vector3D playerPosition)
        {
            var v = playerPosition - Meteor.PositionAndOrientation.Value.Position;
            v.Normalize();
            v = Vector3.Multiply(v, SpaceEngineersConsts.MaxMeteorVelocity);

            Meteor.LinearVelocity = v;
            Meteor.AngularVelocity = new Vector3(0, 0, 0);
            RaisePropertyChanged(() => LinearVelocity);
        }