示例#1
0
/*------------------------------------------------------------------------------------------------------------------
 * -- FUNCTION: calculateMH
 * --
 * -- DATE: January 11, 2018
 * --
 * -- DESIGNER:   Michael Goll
 * --
 * -- PROGRAMMER: Michael Goll
 * --
 * -- NOTES:
 * -- Calls the physics helper function that calculates the moment of inertia for all the objects and
 * --     stores them in the appropriate data array.
 * ----------------------------------------------------------------------------------------------------------------------*/
    private void calculateMomentOfInertia()
    {
        moi_boat   = PhysicsCalculator.calculateMOI(boat.getMass(), boat.getXDim(), boat.getZDim());
        moi_pilot  = PhysicsCalculator.calculateMOI(pilot.getMass(), pilot.getXDim(), pilot.getZDim());
        moi_cannon = PhysicsCalculator.calculateMOI(cannon.getMass(), cannon.getXDim(), cannon.getZDim());
        moi_com    = PhysicsCalculator.calculateCombined(moi_boat, moi_pilot, moi_cannon);
    }
示例#2
0
    void Start()
    {
        numUpdates = 0;

        moving         = false;
        gunBallSpawned = false;
        initial        = true;
        collided       = false;

        lastMarker = numUpdates;
        buffer     = 3;
        fixedTime  = Time.fixedDeltaTime;

        //---------------- Lab #11 Additions ----------------
        moi1 = PhysicsCalculator.calculateMOI(projMass);
        moi2 = PhysicsCalculator.calculateMOI(targetMass);
    }