Examples of PathPoint


Examples of VisualLogic.PathPoint

    public void jSetClosePath(boolean value) {
        closePath = value;
    }

    public GeneralPath parsepath(double zoomX, double zoomY) {
        PathPoint p;
        String cmd;

        GeneralPath path = new GeneralPath();

        if (points.size() > 0) {
            p = points.get(0);

            if (!p.commando.equalsIgnoreCase("MOVETO")) {
                int x = (int) (p.p.x * zoomX);
                int y = (int) (p.p.y * zoomY);
                path.moveTo(x, y);
            }
        }

        for (int i = 0; i < points.size(); i++) {
            p = points.get(i);
            cmd = p.commando;
            int x = (int) (p.p.x * zoomX);
            int y = (int) (p.p.y * zoomY);

            if (cmd.equalsIgnoreCase("MOVETO")) {
                path.moveTo(x, y);
            } else if (cmd.equalsIgnoreCase("LINETO")) {
                path.lineTo(x, y);
            } else if (cmd.equalsIgnoreCase("CURVETO")) {
                if (i > 0) {
                    PathPoint p_1 = points.get(i - 1);

                    if (p_1.commando.equalsIgnoreCase("CURVETO")) {
                        path.curveTo((int) (p_1.p2.x * zoomX), (int) (p_1.p2.y * zoomY), (int) (p.p1.x * zoomX), (int) (p.p1.y * zoomY), x, y);
                    } else {
                        path.curveTo((int) (p_1.p.x * zoomX), (int) (p_1.p.y * zoomY), (int) (p.p1.x * zoomX), (int) (p.p1.y * zoomY), x, y);
View Full Code Here

Examples of VisualLogic.PathPoint

            int d2 = d / 2;
            int smallD = 5;

            Point point;
            for (int i = 0; i < points.size(); i++) {
                PathPoint p = points.get(i);
                point = p.p;

                if (i == 0) {
                    g.setColor(Color.RED);
View Full Code Here

Examples of VisualLogic.PathPoint

            this.tags[index] = tag;
        }
    }

    public void jAddPathPoint(String commando, Point p, Point p1, Point p2) {
        PathPoint path = new PathPoint();
        path.commando = commando;
        path.p = p;
        path.p1 = p1;
        path.p2 = p2;
        points.add(path);
View Full Code Here

Examples of net.minecraft.pathfinding.PathPoint

                            {
                                boolean canRun = false;
                                Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockAwayFrom(creature, 16, 7, Vec3.createVectorHelper(getParent().posX, getParent().posY, getParent().posZ));
                                if(vec3 != null && !(getParent().getDistanceSq(vec3.xCoord, vec3.yCoord, vec3.zCoord) < getParent().getDistanceSqToEntity(creature)))
                                {
                                    PathEntity newPath = new PathEntity(new PathPoint[] { new PathPoint((int)vec3.xCoord, (int)vec3.yCoord, (int)vec3.zCoord) });
                                    creature.getNavigator().setPath(newPath, 1D);
                                    canRun = true;
                                }
                                if(canRun)
                                    creature.getNavigator().setSpeed(runSpeed);
View Full Code Here

Examples of net.minecraft.pathfinding.PathPoint

                double red = 1;
                if(path.getCurrentPathLength() - i < 200) {
                    red = (path.getCurrentPathLength() - i) * 0.005D;
                }
                GL11.glColor4d(red, 1 - red, 0, 0.5D);
                PathPoint lastPoint = path.getPathPointFromIndex(i - 1);
                PathPoint pathPoint = path.getPathPointFromIndex(i);
                tess.startDrawing(GL11.GL_LINE_STRIP);
                tess.addVertex(lastPoint.xCoord + 0.5D, lastPoint.yCoord, lastPoint.zCoord + 0.5D);
                tess.addVertex((lastPoint.xCoord + pathPoint.xCoord) / 2D + 0.5D, Math.max(lastPoint.yCoord, pathPoint.yCoord), (lastPoint.zCoord + pathPoint.zCoord) / 2D + 0.5D);
                tess.addVertex(pathPoint.xCoord + 0.5D, pathPoint.yCoord, pathPoint.zCoord + 0.5D);
                tess.draw();
            }
        } else {
            if(noDestinationPath) {
                if(increaseAlpha) {
                    alphaValue += 0.005D;
                    if(alphaValue > 0.3D) increaseAlpha = false;
                } else {
                    alphaValue -= 0.005D;
                    if(alphaValue < 0.2D) increaseAlpha = true;
                }
            } else {
                if(alphaValue > 0.2D) alphaValue -= 0.005D;
            }
            for(int i = 0; i < path.getCurrentPathLength(); i++) {
                double red = 1;
                if(path.getCurrentPathLength() - i < 200) {
                    red = (path.getCurrentPathLength() - i) * 0.005D;
                }
                GL11.glColor4d(red, 1 - red, 0, alphaValue);
                PathPoint pathPoint = path.getPathPointFromIndex(i);
                tess.startDrawingQuads();
                tess.addVertex(pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord);
                tess.addVertex(pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord + 1);
                tess.addVertex(pathPoint.xCoord + 1, pathPoint.yCoord, pathPoint.zCoord + 1);
                tess.addVertex(pathPoint.xCoord + 1, pathPoint.yCoord, pathPoint.zCoord);
View Full Code Here

Examples of net.minecraft.pathfinding.PathPoint

        GL11.glEnable(GL11.GL_TEXTURE_2D);
    }

    public boolean tracedToDestination(){
        if(path == null) return false;
        PathPoint finalPoint = path.getFinalPathPoint();
        return finalPoint.xCoord == targetX && finalPoint.yCoord == targetY && finalPoint.zCoord == targetZ;
    }
View Full Code Here

Examples of net.minecraft.pathfinding.PathPoint

        World worldObj = player.worldObj;
        int y = worldObj.getHeightValue((int)player.posX, (int)player.posZ);
        PathEntity path = worldObj.getEntityPathToXYZ(player, (int)player.posX, y, (int)player.posZ, 300, true, true, false, true);
        if(path != null) {
            for(int i = 0; i < path.getCurrentPathLength(); i++) {
                PathPoint pathPoint = path.getPathPointFromIndex(i);
                if(worldObj.canBlockSeeTheSky(pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord)) {
                    coordTracker = new RenderCoordWireframe(worldObj, pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord);
                    navigator = new RenderNavigator(worldObj, pathPoint.xCoord, pathPoint.yCoord, pathPoint.zCoord);
                    return true;
                }
View Full Code Here

Examples of net.minecraft.pathfinding.PathPoint

        int l2 = i1 + k1;
        int i3 = j1 + k1;
        ChunkCache chunkcache = new ChunkCache(par1Entity.worldObj, l1, i2, j2, k2, l2, i3, 0);
        PathEntity pathentity = new PathFinderDrone(par1Entity, chunkcache, par6, par7, pathThroughLiquid, par9).createEntityPathTo(par1Entity, par2, par3, par4, par5);
        if(pathentity != null) {
            PathPoint finalPoint = pathentity.getFinalPathPoint();
            if(finalPoint == null || finalPoint.xCoord != par2 || finalPoint.yCoord != par3 || finalPoint.zCoord != par4) pathentity = null;
        }
        teleportCounter = pathentity != null ? -1 : 0;
        telX = par2;
        telY = par3;
View Full Code Here

Examples of net.minecraft.pathfinding.PathPoint

                suffocationCounter = 40;
            }
            isSuffocating = false;
            PathEntity path = getNavigator().getPath();
            if(path != null) {
                PathPoint target = path.getFinalPathPoint();
                if(target != null) {
                    setTargetedBlock(target.xCoord, target.yCoord, target.zCoord);
                } else {
                    setTargetedBlock(0, 0, 0);
                }
View Full Code Here

Examples of net.minecraft.server.v1_7_R1.PathPoint

  {
    PathPoint[] points = new PathPoint[this.m_nodes.length];
    for(int i = 0; i < this.m_nodes.length; i++)
    {
      BlockNode node = this.m_nodes[i];
      points[i] = new PathPoint(node.getX(), node.getZ(), node.getZ());
    }
    return new PathEntity(points);
  }
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.