Ejemplo n.º 1
0
        public Boid()
        {
            TurnOffAll();

            drawGizmos = false;
            drawForces = false;
            drawVectors = false;
            drawNeighbours = false;
            applyBanking = true;
            flock = null;

            // Set default values
            force = Vector3.zero;
            velocity = Vector3.zero;
            mass = 1.0f;
            damping = 0.01f;
            radius = 5.0f;
            forceMultiplier = 1.0f;
            timeMultiplier = 1.0f;
            neighbourDistance = 10.0f;

            calculationMethod = CalculationMethods.WeightedTruncatedRunningSumWithPrioritisation;

            seekTargetPos = Vector3.zero;
            seekWeight = 1.0f;

            fleeWeight = 1.0f;
            fleeTarget = null;
            fleeRange = 100.0f;

            arriveSlowingDistance = 15.0f;
            arriveDeceleration = 0.9f;
            arriveTargetPos = Vector3.zero;
            arriveWeight = 1.0f;

            wanderRadius = 10.0f;
            wanderDistance = 15.0f;
            wanderJitter = 20.0f;
            wanderWeight = 1.0f;
            wanderNoiseX = 0;
            wanderNoiseDelta = 0.01f;

            cohesionWeight = 1.0f;
            separationWeight = 1.0f;
            alignmentWeight = 1.0f;

            obstacleAvoidanceWeight = 1.0f;
            minBoxLength = 50.0f;

            followPathWeight = 1.0f;

            pursuitWeight = 1.0f;
            pursuitTarget = null;

            evadeTarget = null;
            evadeWeight = 1.0f;

            interposeWeight = 1.0f;
            hideWeight = 1.0f;

            planeAvoidanceWeight = 1.0f;

            offsetPursuitTarget = null;
            offsetPursuitWeight = 1.0f;

            sphereCentre = Vector3.zero;
            sphereConstrainWeight = 1.0f;
            sphereRadius = 1000.0f;

            randomWalkWeight = 1.0f;
            randomWalkCenter = Vector3.zero;
            randomWalkRadius = 500.0f;
            randomWalkKeepY = false;

            randomWalkForce = Vector3.zero;
            randomWalkWait = 5.0f;

            maxSpeed = 20;
            maxForce = 10;

            sceneAvoidanceEnabled = true;
            sceneAvoidanceWeight = 1.0f;
            sceneAvoidanceFeelerDepth = 30.0f;
        }
Ejemplo n.º 2
0
        public Boid()
        {
            TurnOffAll();

            drawGizmos     = false;
            drawForces     = false;
            drawVectors    = false;
            drawNeighbours = false;
            applyBanking   = true;
            flock          = null;

            // Set default values
            force             = Vector3.zero;
            velocity          = Vector3.zero;
            mass              = 1.0f;
            damping           = 0.01f;
            radius            = 5.0f;
            forceMultiplier   = 1.0f;
            timeMultiplier    = 1.0f;
            neighbourDistance = 10.0f;

            calculationMethod = CalculationMethods.WeightedTruncatedRunningSumWithPrioritisation;

            seekTargetPos = Vector3.zero;
            seekWeight    = 1.0f;

            fleeWeight = 1.0f;
            fleeTarget = null;
            fleeRange  = 100.0f;

            arriveSlowingDistance = 15.0f;
            arriveDeceleration    = 0.9f;
            arriveTargetPos       = Vector3.zero;
            arriveWeight          = 1.0f;

            wanderRadius     = 10.0f;
            wanderDistance   = 15.0f;
            wanderJitter     = 20.0f;
            wanderWeight     = 1.0f;
            wanderNoiseX     = 0;
            wanderNoiseDelta = 0.01f;

            cohesionWeight   = 1.0f;
            separationWeight = 1.0f;
            alignmentWeight  = 1.0f;

            obstacleAvoidanceWeight = 1.0f;
            minBoxLength            = 50.0f;

            followPathWeight = 1.0f;

            pursuitWeight = 1.0f;
            pursuitTarget = null;

            evadeTarget = null;
            evadeWeight = 1.0f;

            interposeWeight = 1.0f;
            hideWeight      = 1.0f;

            planeAvoidanceWeight = 1.0f;

            offsetPursuitTarget = null;
            offsetPursuitWeight = 1.0f;

            sphereCentre          = Vector3.zero;
            sphereConstrainWeight = 1.0f;
            sphereRadius          = 1000.0f;

            randomWalkWeight = 1.0f;
            randomWalkCenter = Vector3.zero;
            randomWalkRadius = 500.0f;
            randomWalkKeepY  = false;

            randomWalkForce = Vector3.zero;
            randomWalkWait  = 5.0f;

            maxSpeed = 20;
            maxForce = 10;

            sceneAvoidanceEnabled     = true;
            sceneAvoidanceWeight      = 1.0f;
            sceneAvoidanceFeelerDepth = 30.0f;
        }