Beispiel #1
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);
   }
 }
Beispiel #2
0
 public final void markDetailPolygon(ElementRenderState render_state, int level) {
   Unit unit = (Unit) render_state.model;
   super.markDetailPolygon(render_state, level);
   UnitSupplyContainer supply_container = unit.getSupplyContainer();
   if (!render_state.render_state.isPicking()
       && unit.getAbilities().hasAbilities(Abilities.BUILD)
       && supply_container.getSupplyType() != null) {
     if (supply_container.getNumSupplies() > 0) {
       SpriteRenderer supply_sprite =
           render_state.getRenderer(
               supply_container.getSupplySpriteRenderer(supply_container.getSupplyType()));
       supply_sprite.addToRenderList(level, render_state, false);
     }
   }
 }
Beispiel #3
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);
 }
Beispiel #4
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);
 }
Beispiel #5
0
 public void transform(ElementRenderState render_state) {
   RenderTools.translateAndRotate(render_state.getModel());
   GL11.glColor4f(1f, 1f, 1f, 1f);
 }
Beispiel #6
0
 public final void transform(ElementRenderState render_state) {
   SupplyModel model = (SupplyModel) render_state.getModel();
   GL11.glTranslatef(model.getPositionX(), model.getPositionY(), model.getPositionZ());
   GL11.glRotatef(model.getRotation(), 0f, 0f, 1f);
 }
Beispiel #7
0
 private ModelState getCachedState(ModelVisitor visitor, Model model, float dist_squared) {
   ElementRenderState state = doGetCachedState();
   state.setup(visitor, model, dist_squared);
   return state;
 }
Beispiel #8
0
 private ModelState getCachedState(ModelVisitor visitor, Model model) {
   ElementRenderState state = doGetCachedState();
   state.setup(visitor, model);
   return state;
 }