コード例 #1
0
ファイル: AutonomousAgent.cs プロジェクト: rc183/igf
        private void ComputePrioritizedDitheringSteeringForce()
        {
            foreach (SteeringBehavior steeringBehavior in _computeSteeringForcesBehavior.Behaviors)
            {
                if (steeringBehavior.Enabled && RandomExtensions.GetRandomFloat(Dice, 0f, 1.0f) < steeringBehavior.Probability)
                {
                    _steeringForce += steeringBehavior.SteeringForce * steeringBehavior.Weight / steeringBehavior.Probability;

                    if (_steeringForce != Vector3.Zero)
                    {
                        _steeringForce = Vector3Extensions.Truncate(_steeringForce, MaxForce);
                    }
                }
            }
        }