예제 #1
0
        void Start()
        {
            // Find required components
            rb                  = gameObject.GetComponent <Rigidbody>();
            fuelController      = GetComponent <FuelController>();
            fcPhysicsController = GetComponent <FlightControlsPhysicsController>();

            // Initialize rigidbody's parameters
            rb.useGravity             = true;
            rb.isKinematic            = false;
            rb.drag                   = 0f;
            rb.angularDrag            = angularDrag;
            rb.interpolation          = interpolation;
            rb.collisionDetectionMode = collisionDetection;
            rb.constraints            = RigidbodyConstraints.None;

            float totalWeight = emptyWeight + pilotWeight + copilotWeight + cargoWeight + fuelController.totalFuelRemaining();

            rb.mass = totalWeight / kilograms2pounds;

            rb.inertiaTensor         = inertiaTensor;
            rb.inertiaTensorRotation = inertiaTensorRotation;

            // Compute actual center of mass
            computeCenterOfMass();
        }
예제 #2
0
        // Use this for initialization
        void Start()
        {
            // Find required component
            fuelController = GetComponent <FuelController>();

            // Initialize engine speed
            engineRunning         = engineRunningAtLoad;
            calculatedEngineSpeed = engineRunningAtLoad ? 100.0f : 0.0f;

            engineIsStarting = false;
        }