Examples of squareDistanceTo()


Examples of net.minecraft.util.Vec3.squareDistanceTo()

                        }
                        double distanceNew = vecNewTarget.squareDistanceTo(this.xCoord, this.yCoord, this.zCoord);

                        if (distanceNew > e.getDistanceSq(this.xCoord, this.yCoord, this.zCoord))
                        {
                            if (vecOldTarget == null || distanceNew > vecOldTarget.squareDistanceTo(this.xCoord, this.yCoord, this.zCoord))
                            {
                                e.getNavigator().tryMoveToXYZ(vecNewTarget.xCoord, vecNewTarget.yCoord, vecNewTarget.zCoord, 0.3D);
                                //System.out.println("Debug: Arclamp repelling entity: "+e.getClass().getSimpleName());
                            }
                        }
View Full Code Here

Examples of net.minecraft.util.Vec3.squareDistanceTo()

        // new position to the current position and determine if its a valid position.
        Vec3 closestPoint = null;
        Vec3 linkedVec = Vec3.createVectorHelper(linked.posX, linked.posY, linked.posZ);
        double distance = Math.abs(optimalDist - currentDistance);
        for (Vec3 pos : leaderHistory) {
            double historyDistance = linkedVec.squareDistanceTo(pos);
            double diff = Math.abs(optimalDist - historyDistance);
            if (diff < distance) {
                closestPoint = pos;
                distance = diff;
            }
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.