/// <summary> /// Function called before of the first update /// </summary> void Start() { droneMovementController dmc = gameObject.GetComponent <droneMovementController>(); // associate the rotors helixO1 = dmc.helixO1; helixO2 = dmc.helixO2; helixV1 = dmc.helixV1; helixV2 = dmc.helixV2; // finds the rotors position Vector3 v1 = helixV1.transform.position; Vector3 v2 = helixV2.transform.position; Vector3 o1 = helixO1.transform.position; Vector3 o2 = helixO2.transform.position; Vector3 mid_v1o1 = (v1 + o1) / 2f; Vector3 mid_v2o2 = (o2 + v2) / 2f; distanceBetweenHelixes = Vector3.Distance(mid_v1o1, mid_v2o2); // instantiates the noiseAdders, to add the noise to the measurement nRoll = new noiseAdder(); nRollSpeed = new noiseAdder(); nRollAcc = new noiseAdder(); nPitch = new noiseAdder(); nPitchSpeed = new noiseAdder(); nPitchAcc = new noiseAdder(); }
/// <summary> /// Function Called when the object is activated for the first time /// </summary> void Awake() { nHeight = new noiseAdder(); nSpeed = new noiseAdder(); nAcc = new noiseAdder(); lastHeight = height = transform.position.y; lastSpeed = verticalSpeed = 0; verticalAcc = 0; }
/// <summary> /// Function Called when the object is activated for the first time /// </summary> void Awake() { // initializes the noiseAdders nYaw = new noiseAdder(); nSpeed = new noiseAdder(); // look for the rotors in the droneMovementController droneMovementController dmc = gameObject.GetComponent <droneMovementController>(); helixO1 = dmc.helixO1; helixO2 = dmc.helixO2; helixV1 = dmc.helixV1; helixV2 = dmc.helixV2; lastYaw = yaw = getYawINT(); }
/// <summary> /// Function Called when the object is activated for the first time /// </summary> void Awake() { noiseX = new noiseAdder(); noiseY = new noiseAdder(); }
/// <summary> /// Constructor of the class /// <para>Just create a noiseAdder class for each element of the vector</para> /// </summary> public noiseAddVector3() { xN = new noiseAdder(); yN = new noiseAdder(); zN = new noiseAdder(); }