示例#1
0
    // Drunk gestion
    private void updateDrunk()
    {
        foreach (Agent drunk in m_drunkList)
        {
            Vector2 drunkSteer = AgentSteering.leader(drunk._velocity, 20, 0.5f, ref drunk._wanderPoint);
            Vector2 avoidSteer = AgentSteering.avoid(drunk._position, drunk._velocity, ref drunk._wanderPoint) * _coefAvoidObs;

            Vector2 force = drunkSteer + avoidSteer;

            drunk._steeringForce += force;
        }
    }
示例#2
0
    // Leader gestion
    private void updateLeaders()
    {
        foreach (Agent leader in m_leaderList)
        {
            Vector2 leadSteer  = AgentSteering.leader(leader._velocity, _leaderRadius, _leaderVariation, ref leader._wanderPoint) * _coefLeader;
            Vector2 avoidSteer = AgentSteering.avoid(leader._position, leader._velocity, ref leader._wanderPoint) * _coefAvoidObs;

            Vector2 force = leadSteer + avoidSteer;

            leader._steeringForce += force;
        }
    }