Exemplo n.º 1
0
 public final void visitPlants(final Plants plants) {
   if (!picking && Globals.draw_plants) {
     float camera_dist_sqr =
         RenderTools.getEyeDistanceSquared(
             plants, camera.getCurrentX(), camera.getCurrentY(), camera.getCurrentZ());
     if (camera_dist_sqr <= PLANTS_CUT_DIST * PLANTS_CUT_DIST)
       addToRenderList(getCachedState(plants_model_visitor, plants, camera_dist_sqr));
   }
 }
Exemplo n.º 2
0
 public final void transform(ElementRenderState render_state) {
   Model model = render_state.model;
   RenderTools.translateAndRotate(
       model.getPositionX(),
       model.getPositionY(),
       render_state.f,
       model.getDirectionX(),
       model.getDirectionY());
 }
Exemplo n.º 3
0
 public final void transform(ElementRenderState render_state) {
   Plants plants = (Plants) render_state.getModel();
   RenderTools.translateAndRotate(plants);
   float dist_squared = render_state.f;
   if (dist_squared > START_FADE_DIST * START_FADE_DIST) {
     float camera_dist = (float) Math.sqrt(dist_squared);
     float alpha =
         1f - ((camera_dist - START_FADE_DIST) / (PLANTS_CUT_DIST - START_FADE_DIST));
     GL11.glColor4f(1f, 1f, 1f, alpha);
   }
 }
Exemplo n.º 4
0
 private static boolean pickingInFrustum(
     Selectable selectable,
     float[][] frustum,
     float z_offset,
     float selection_radius,
     float selection_height) {
   picking_selection_box.setBounds(
       -selection_radius + selectable.getPositionX(),
       selection_radius + selectable.getPositionX(),
       -selection_radius + selectable.getPositionY(),
       selection_radius + selectable.getPositionY(),
       z_offset,
       z_offset + selection_height);
   return RenderTools.inFrustum(picking_selection_box, frustum) >= RenderTools.IN_FRUSTUM;
 }
Exemplo n.º 5
0
 public final void transform(ElementRenderState render_state) {
   RotatingThrowingWeapon model = (RotatingThrowingWeapon) render_state.getModel();
   RenderTools.translateAndRotate(render_state.getModel());
   GL11.glRotatef(model.getAngle(), 0f, 1f, 0f);
 }
Exemplo n.º 6
0
 public final void transform(ElementRenderState render_state) {
   DirectedThrowingWeapon model = (DirectedThrowingWeapon) render_state.getModel();
   RenderTools.translateAndRotate(render_state.getModel());
   GL11.glRotatef(-model.getZSpeed(), 0f, 1f, 0f);
 }
Exemplo n.º 7
0
 public void transform(ElementRenderState render_state) {
   RenderTools.translateAndRotate(render_state.getModel());
   GL11.glColor4f(1f, 1f, 1f, 1f);
 }