Exemple #1
0
 /**
  * an action call with cache
  *
  * @param ac the action invocation wrapper
  * @param key user specified key, the user needs to explicitly compose a key from the action and
  *     arguments. The template transformer can put the action calling string as prefix of the key,
  *     e.g., if the acton is Application.show(post), the key should be compose of
  *     "Application.show()-" + post.toString(). Note we cannot use "post" literally since post as
  *     the var name can be anything that the template author chooses to use. Problem: Application
  *     needs to be imported or all controllers package must be imported. Controllers in sub
  *     packages needs special care in importing since a simple import controllers.* won't work for
  *     controllers in sub packages.
  * @param ttl expiration Ex: 10s, 3mn, 8h
  */
 public void render(String key, String ttl, Body body) {
   String co = (String) Cache.get(key);
   if (co == null) {
     co = body.render();
     Cache.set(key, co, Time.parseDuration(ttl));
   }
   p(co);
   return;
 }
  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {

    setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    GL11.glPushMatrix();
    {
      GL11.glTranslatef(offsetX * f5, offsetY * f5, offsetZ * f5);

      GL11.glPushMatrix();
      {
        GL11.glTranslatef(
            WolfHead.rotationPointX * f5,
            WolfHead.rotationPointY * f5,
            WolfHead.rotationPointZ * f5);
        GL11.glRotatef((float) (headRotY * 180f / Math.PI), 0f, 1f, 0f);
        GL11.glRotatef((float) (headRotX * 180f / Math.PI), 1f, 0f, 0f);
        GL11.glRotatef((float) (headRotZ * 180f / Math.PI), 0f, 0f, 1f);

        GL11.glPushMatrix();
        {
          GL11.glTranslatef(
              -WolfHead.rotationPointX * f5,
              -WolfHead.rotationPointY * f5,
              -WolfHead.rotationPointZ * f5);

          WolfHead.render(f5);
          Ear1.render(f5);
          Ear2.render(f5);
          Nose.render(f5);
        }
        GL11.glPopMatrix();
      }
      GL11.glPopMatrix();
      Body.render(f5);
      Leg1.render(f5);
      Leg2.render(f5);
      Leg3.render(f5);
      Leg4.render(f5);
      GL11.glPushMatrix();
      {
        GL11.glTranslatef(
            Tail.rotationPointX * f5, Tail.rotationPointY * f5, Tail.rotationPointZ * f5);
        GL11.glRotatef((float) (tailRotY * 180f / Math.PI), 0f, 1f, 0f);
        GL11.glRotatef((float) (tailRotX * 180f / Math.PI), 1f, 0f, 0f);
        GL11.glRotatef((float) (tailRotZ * 180f / Math.PI), 0f, 0f, 1f);

        GL11.glPushMatrix();
        GL11.glTranslatef(
            -Tail.rotationPointX * f5, -Tail.rotationPointY * f5, -Tail.rotationPointZ * f5);

        Tail.render(f5);
        GL11.glPopMatrix();
      }
      GL11.glPopMatrix();
    }
    GL11.glPopMatrix();
  }
 public void render(float f, float f1, float f2, float f3, float f4, float f5) {
   setRotationAngles(f, f1, f2, f3, f4, f5);
   Body.render(f5);
   PTail.render(f5);
   UHead.render(f5);
   DHead.render(f5);
   UpperFin.render(f5);
   LTailFin.render(f5);
   RTailFin.render(f5);
   LeftFin.render(f5);
   RightFin.render(f5);
 }