private void kinematicSeekBehavior()
        {
            ds = new DynoSteering();

            // Decide on behavior
            seeking_output = seek.getSteering();
            char_kinematic.setVelocity(seeking_output.velc);
            // Manually set orientation for now
            float new_orient = char_kinematic.getNewOrientation(seeking_output.velc);

            char_kinematic.setOrientation(new_orient);
            char_kinematic.setRotation(0f);

            // Update Kinematic Steering
            kso = char_kinematic.updateSteering(ds, Time.deltaTime);

            transform.position = new Vector3(kso.position.x, transform.position.y, kso.position.z);
            transform.rotation = Quaternion.Euler(0f, kso.orientation * Mathf.Rad2Deg, 0f);
        }
Ejemplo n.º 2
0
        private void kinematicSeekBehavior()
        {
            ds = new DynoSteering();

            // Decide on behavior
            //******
            seeking_output = seek.getSteering();
            //******seeking_output = align.getSteering();
            //******
            char_kinematic.setVelocity(seeking_output.velc);
            // Manually set orientation for now
            /*Replace these three lines with a dynamic rotation*/
            //float new_orient = char_kinematic.getNewOrientation(seeking_output.velc);
            //char_kinematic.setOrientation(new_orient);
            //char_kinematic.setRotation(0f);

            ds.torque = ds_torque.torque;

            // Update Kinematic Steering
            kso = char_kinematic.updateSteering(ds, Time.deltaTime);

            transform.position = new Vector3(kso.position.x, transform.position.y, kso.position.z);
            transform.rotation = Quaternion.Euler(0f, kso.orientation * Mathf.Rad2Deg, 0f);
        }