Class ModelView

java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.prineside.tdi2.ui.actors.ModelView
All Implemented Interfaces:
Disposable

public class ModelView extends Actor implements Disposable
  • Field Details

    • camera

      public PerspectiveCamera camera
    • model

      public ModelInstance model
    • environment

      public Environment environment
    • modelCache

      public ModelCache modelCache
    • rotateModelAround

      public static final ModelView.Transformer rotateModelAround
    • modelCacheUpdateRequired

      public boolean modelCacheUpdateRequired
    • width

      public int width
    • height

      public int height
  • Constructor Details

    • ModelView

      public ModelView(int width, int height, ModelView.Transformer transformer, Environment environment, boolean disableFramebuffer)
      Parameters:
      environment - may be null
      disableFramebuffer - если true, рисуется на весь экран в очереди отрисовки UI-актера
  • Method Details

    • setSize

      public void setSize(int width, int height)
    • requireRedraw

      public void requireRedraw()
      Вызывать каждый раз, когда нужно перерисовать превью
    • requireModelCacheUpdate

      public void requireModelCacheUpdate()
    • setTransformer

      public void setTransformer(ModelView.Transformer transformer)
    • setEnvironment

      public void setEnvironment(Environment environment)
    • setModel

      public void setModel(ModelInstance model, float scale)
    • setModelPart

      public void setModelPart(Model model, String nodeName, Material forceMaterial, float scale)
    • saveScreenshot

      public void saveScreenshot(String fileName)
    • updateModelCacheIfRequired

      public void updateModelCacheIfRequired()
    • act

      public void act(float delta)
      Description copied from class: com.badlogic.gdx.scenes.scene2d.Actor
      Updates the actor based on time. Typically this is called each frame by Stage.act(float).

      The default implementation calls Action.act(float) on each action and removes actions that are complete.

      Overrides:
      act in class Actor
      Parameters:
      delta - Time in seconds since the last frame.
    • draw

      public void draw(Batch batch, float parentAlpha)
      Description copied from class: com.badlogic.gdx.scenes.scene2d.Actor
      Draws the actor. The batch is configured to draw in the parent's coordinate system. This draw method is convenient to draw a rotated and scaled TextureRegion. Batch.begin() has already been called on the batch. If Batch.end() is called to draw without the batch then Batch.begin() must be called before the method returns.

      The default implementation does nothing.

      Overrides:
      draw in class Actor
      parentAlpha - The parent alpha, to be multiplied with this actor's alpha, allowing the parent's alpha to affect all children.
    • dispose

      public void dispose()
      Description copied from interface: com.badlogic.gdx.utils.Disposable
      Releases all resources of this object.
      Specified by:
      dispose in interface Disposable