Package org.openmali.vecmath2

Examples of org.openmali.vecmath2.TexCoord2f


        /*
         * UI
         */
        status = new Label(290f, 100f);
        status.setLocation(480f, 130f);
        status.setBackgroundColor(new Colorf(1f, 1f, 1f, .5f));
        status.setFontColor(Colorf.BLACK);
        status.setZIndex(2);
       
        /*
         * Physics
 
View Full Code Here


       
        terrainShape.setGeometry(geom);
       
        Appearance app = new Appearance();
        app.setMaterial(new Material());
        app.getMaterial().setDiffuseColor(new Colorf(0.6313726f, 0.28627452f, 0.07058824f));
       
        terrainShape.setAppearance(app);
       
    }
View Full Code Here

       
        this.app = app;
        InputSystem.getInstance().getMouse().addMouseListener(this);
        app.getOperationScheduler().scheduleOperation(this);
       
        Panel panel = new Panel(300f, 180f, new Colorf(1f, 1f, 1f, .2f));
        frame = new Frame(panel, "Digibot Information");
        frame.setDefaultCloseOperation(null);
        frame.setCloseButtonVisible(false);
       
        genomeLabel = new Label(panel.getWidth(), panel.getHeight());
View Full Code Here

        hud.getContentPane().addWidget(label, 10f, 10f);
       
        /*
         * GFX
         */
        env.getView().lookAt(new Point3f(5f, 5f, 5f), new Point3f(), new Point3f(0f, 0f, 1f));
        group = env.addPerspectiveBranch().getBranchGroup();
        group.addChild(new PointLight(1f, 1f, 1f, 10f, 10f, 45f, .001f));
       
        this.setStopOperation(RenderLoop.StopOperation.DESTROY_AND_EXIT);
        this.begin();
View Full Code Here

       
        for(float x = 0; x < dimX; x += d) {
           
            for(float y = 0; y < dimY; y += d) {
               
                coords[coordIndex++] = new Point3f(x * cSizeX,   y * cSizeY,   getZ(x, y));
                coords[coordIndex++] = new Point3f((x+d) * cSizeX, y * cSizeY,   getZ(x+d, y));
                coords[coordIndex++] = new Point3f(x * cSizeX,   (y+d) * cSizeY,   getZ(x, y+d));
               
                coords[coordIndex++] = new Point3f(x * cSizeX,   (y+d) * cSizeY,   getZ(x, y+d));
                coords[coordIndex++] = new Point3f((x+d) * cSizeX, y * cSizeY,   getZ(x+d, y));
                coords[coordIndex++] = new Point3f((x+d) * cSizeX,(y+d) * cSizeY,   getZ(x+d, y+d));
               
                texCoords[texIndex++] = new TexCoord2f((x / sizeX    ) * repeatCount, (y / sizeY) * repeatCount);
                texCoords[texIndex++] = new TexCoord2f((x / sizeX + d) * repeatCount, (y / sizeY) * repeatCount);
                texCoords[texIndex++] = new TexCoord2f((x / sizeX    ) * repeatCount, (y / sizeY + d) * repeatCount);
               
View Full Code Here

               
                coords[coordIndex++] = new Point3f(x * cSizeX,   (y+d) * cSizeY,   getZ(x, y+d));
                coords[coordIndex++] = new Point3f((x+d) * cSizeX, y * cSizeY,   getZ(x+d, y));
                coords[coordIndex++] = new Point3f((x+d) * cSizeX,(y+d) * cSizeY,   getZ(x+d, y+d));
               
                texCoords[texIndex++] = new TexCoord2f((x / sizeX    ) * repeatCount, (y / sizeY) * repeatCount);
                texCoords[texIndex++] = new TexCoord2f((x / sizeX + d) * repeatCount, (y / sizeY) * repeatCount);
                texCoords[texIndex++] = new TexCoord2f((x / sizeX    ) * repeatCount, (y / sizeY + d) * repeatCount);
               
                texCoords[texIndex++] = new TexCoord2f((x / sizeX    ) * repeatCount, (y / sizeY + d) * repeatCount);
                texCoords[texIndex++] = new TexCoord2f((x / sizeX + d) * repeatCount, (y / sizeY) * repeatCount);
                texCoords[texIndex++] = new TexCoord2f((x / sizeX + d) * repeatCount, (y / sizeY + d) * repeatCount);
               
            }
           
        }
       
View Full Code Here

  }
 
  public Food(World world, float x, float y, float z) {
    this.world = world;
   
    this.pos = new Vector3f(x, y, z);
   
    this.addChild(new Transform().setTranslation(x, y, z + .5f).add(
        new Random(System.currentTimeMillis()).nextBoolean()
    ? getApple() : getDrink()));
   
View Full Code Here

        this.dominance = genome.getDominance();
       
        /*
         * Attributes
         */
        this.pos = new Vector3f(x, y, 0f);
        this.angle = angle;
       
        /*
         * IA
         */
 
View Full Code Here

     * @param frameTime
     */
    private void actionSearchToCopulate(long frameTime) {
        if (focusedPartner != null) {
           
            Vector3f path = new Vector3f();
            path.sub(focusedPartner.getPos(), pos);
            angle = Angle.angle(path.getX(), path.getY());
           
            // not even necessary to check if near enough here
            // we will be kindly notified of every collision by
            // our own World. see the notifyCollision(Digibot) method
           
View Full Code Here

     * @param frameTime
     */
    private void actionSearchForFood(long frameTime) {
        if (focusedFood != null) {
           
            Vector3f path = new Vector3f();
            path.sub(focusedFood.getPos(), pos);
            angle = Angle.angle(path.getX(), path.getY());
           
            // check if we are near enough to eat
            if (path.length() < radius * 1.5f) {
                action = Action.EAT;
            }
           
        } else {
           
View Full Code Here

TOP

Related Classes of org.openmali.vecmath2.TexCoord2f

Copyright © 2018 www.massapicom. 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.