Package com.prineside.tdi2.ui.actors
Class ModelView
java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.prineside.tdi2.ui.actors.ModelView
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
public class ModelView
extends com.badlogic.gdx.scenes.scene2d.Actor
implements com.badlogic.gdx.utils.Disposable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptioncom.badlogic.gdx.graphics.PerspectiveCamera
com.badlogic.gdx.graphics.g3d.Environment
int
com.badlogic.gdx.graphics.g3d.ModelInstance
com.badlogic.gdx.graphics.g3d.ModelCache
boolean
static final ModelView.Transformer
int
-
Constructor Summary
ConstructorsConstructorDescriptionModelView
(int width, int height, ModelView.Transformer transformer, com.badlogic.gdx.graphics.g3d.Environment environment, boolean disableFramebuffer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
act
(float delta) Updates the actor based on time.void
dispose()
Releases all resources of this object.void
draw
(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha) Draws the actor.void
void
Вызывать каждый раз, когда нужно перерисовать превьюvoid
saveScreenshot
(String fileName) void
setEnvironment
(com.badlogic.gdx.graphics.g3d.Environment environment) void
setModel
(com.badlogic.gdx.graphics.g3d.ModelInstance model, float scale) void
setModelPart
(com.badlogic.gdx.graphics.g3d.Model model, String nodeName, com.badlogic.gdx.graphics.g3d.Material forceMaterial, float scale) void
setSize
(int width, int height) void
setTransformer
(ModelView.Transformer transformer) void
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor
addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebug, drawDebugBounds, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasKeyboardFocus, hasParent, hasScrollFocus, hit, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, scaleChanged, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setStage, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, sizeChanged, stageToLocalCoordinates, toBack, toFront, toString
-
Field Details
-
camera
public com.badlogic.gdx.graphics.PerspectiveCamera camera -
model
public com.badlogic.gdx.graphics.g3d.ModelInstance model -
environment
public com.badlogic.gdx.graphics.g3d.Environment environment -
modelCache
public com.badlogic.gdx.graphics.g3d.ModelCache modelCache -
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, com.badlogic.gdx.graphics.g3d.Environment environment, boolean disableFramebuffer) - Parameters:
environment
- may be nulldisableFramebuffer
- если true, рисуется на весь экран в очереди отрисовки UI-актера
-
-
Method Details
-
setSize
public void setSize(int width, int height) -
requireRedraw
public void requireRedraw()Вызывать каждый раз, когда нужно перерисовать превью -
requireModelCacheUpdate
public void requireModelCacheUpdate() -
setTransformer
-
setEnvironment
public void setEnvironment(com.badlogic.gdx.graphics.g3d.Environment environment) -
setModel
public void setModel(com.badlogic.gdx.graphics.g3d.ModelInstance model, float scale) -
setModelPart
public void setModelPart(com.badlogic.gdx.graphics.g3d.Model model, String nodeName, com.badlogic.gdx.graphics.g3d.Material forceMaterial, float scale) -
saveScreenshot
-
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 byStage.act(float)
.The default implementation calls
Action.act(float)
on each action and removes actions that are complete.- Overrides:
act
in classcom.badlogic.gdx.scenes.scene2d.Actor
- Parameters:
delta
- Time in seconds since the last frame.
-
draw
public void draw(com.badlogic.gdx.graphics.g2d.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. IfBatch.end()
is called to draw without the batch thenBatch.begin()
must be called before the method returns.The default implementation does nothing.
- Overrides:
draw
in classcom.badlogic.gdx.scenes.scene2d.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 interfacecom.badlogic.gdx.utils.Disposable
-