Package mods.railcraft.common.util.misc

Examples of mods.railcraft.common.util.misc.Vec2D.normalize()


//        System.out.println(cart.getClass().getSimpleName() + ": " + cart.entityId + " collided with " + other.getClass().getSimpleName() + ": " + other.entityId);
        Vec2D cartPos = new Vec2D(cart.posX, cart.posZ);
        Vec2D otherPos = new Vec2D(other.posX, other.posZ);

        Vec2D unit = Vec2D.subtract(otherPos, cartPos);
        unit.normalize();

        double distance = cart.getDistanceToEntity(other);
        double depth = distance - OPTIMAL_DISTANCE;

        double forceX = 0;
View Full Code Here


        Vec2D cart1Pos = new Vec2D(cart1.posX, cart1.posZ);
        Vec2D cart2Pos = new Vec2D(cart2.posX, cart2.posZ);

        Vec2D unit = Vec2D.subtract(cart2Pos, cart1Pos);
        unit.normalize();

        // Energy transfer

//        double transX = TRANSFER * (cart2.motionX - cart1.motionX);
//        double transZ = TRANSFER * (cart2.motionZ - cart1.motionZ);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.