Example #1
0
        // Update is called once per frame
        public KinematicSteeringOutput updateSteering(DynoSteering ds, float time)
        {
            if (sp == null)
            {
                sp = GetComponent <SteeringParams>();

                position    = this.transform.position;
                velc        = new Vector3(0f, 0f, 0f);
                rotation    = 0f;
                orientation = 0f;
            }

            steering = new KinematicSteeringOutput();

            // make Updates
            position    += velc * time;
            orientation += rotation * time;

            velc        += ds.force * time;
            orientation += ds.torque * time;

            if (velc.magnitude > sp.MAXSPEED)
            {
                velc.Normalize();
                velc = velc * sp.MAXSPEED;
            }

            steering.position    = position;
            steering.orientation = orientation;

            return(steering);
        }
Example #2
0
        // Use this for initialization
        void Start()
        {
            sp = GetComponent <SteeringParams>();

            position    = this.transform.position;
            velc        = new Vector3(0f, 0f, 0f);
            rotation    = 0f;
            orientation = 0f;
        }
Example #3
0
        // Use this for initialization
        //void Awake()
        //{
        //    PD = GameObject.FindGameObjectWithTag("FabulaTimeline").GetComponent<PlayableDirector>();
        //    SP = GetComponent<SteeringParams>();
        //    KinematicBody = GetComponent<Kinematic>();
        //    SteerList = new List<List<SteeringPlayable>>();
        //    //SteerList.Add(new List<SteeringPlayable>());
        //    LockedList = new List<bool>();
        //    //LockedList.Add(false);
        //}

        public void InitiateExternally()
        {
            PD            = GameObject.FindGameObjectWithTag("FabulaTimeline").GetComponent <PlayableDirector>();
            SP            = GetComponent <SteeringParams>();
            KinematicBody = GetComponent <Kinematic>();
            SteerList     = new List <List <SteeringPlayable> >();
            //SteerList.Add(new List<SteeringPlayable>());
            LockedList          = new List <bool>();
            initiatedExternally = true;
        }
        // Use this for initialization
        //void Awake()
        //{
        //    PD = GameObject.FindGameObjectWithTag("FabulaTimeline").GetComponent<PlayableDirector>();
        //    SP = GetComponent<SteeringParams>();
        //    KinematicBody = GetComponent<Kinematic>();
        //    SteerList = new List<List<SteeringPlayable>>();
        //    //SteerList.Add(new List<SteeringPlayable>());
        //    LockedList = new List<bool>();
        //    //LockedList.Add(false);
        //}

        public void InitiateExternally()
        {
            // Don't do this if it's already been done before.
            if (initiatedExternally)
            {
                return;
            }

            PD            = GameObject.FindGameObjectWithTag("ExecuteTimeline").GetComponent <PlayableDirector>();
            SP            = GetComponent <SteeringParams>();
            KinematicBody = GetComponent <Kinematic>();
            SteerList     = new List <List <SteeringPlayable> >();
            //SteerList.Add(new List<SteeringPlayable>());
            LockedList          = new List <bool>();
            initiatedExternally = true;
        }
 // Use this for initialization
 void Start()
 {
     goalObject    = GetComponent <Goal>();
     sp            = GetComponent <SteeringParams>();
     charRigidBody = GetComponent <Kinematic>();
 }
 // Use this for initialization
 void Start()
 {
     sp         = GetComponent <SteeringParams>();
     goalObject = GetComponent <Goal>();
 }
Example #7
0
 // Use this for initialization
 void Start()
 {
     sp = GetComponent <SteeringParams>();
 }