Class VertsView
java.lang.Object
gaiasky.scene.view.AbstractView
gaiasky.scene.view.BaseView
gaiasky.scene.view.VertsView
- All Implemented Interfaces:
IGPUVertsRenderable, IRenderable
-
Field Summary
Fields inherited from class AbstractView
entityModifier and TypeFieldDescriptionprotected com.badlogic.ashley.core.EntityA reference to the entity. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the given point ot this datavoidaddPoints(double[] points) Adds the given points to this datavoidblend()voidclear()Clears the data from this object, both in RAM and VRAMvoiddepth()protected voidContains actions to take after a new entity has been set.protected voidentityCheck(com.badlogic.ashley.core.Entity entity) Checks whether the given entity is suitable for this view.protected voidThis method is called when the entity of this view is cleared.doublegetAlpha()float[]getColor()doubleGets the last distance to the camera calculated for this entityintcom.badlogic.gdx.math.Matrix4floatReturns the opacity of this renderablecom.badlogic.ashley.core.EntityfloatbooleanbooleanisEmpty()Checks whether an entity is set in this view.voidvoidsetClosedLoop(boolean closedLoop) voidsetGlPrimitive(int glPrimitive) voidsetPoints(double[] points) Sets the 3D points of the line in the internal reference system.voidsetPrimitiveSize(float size) Line width for lines, point size for pointsvoidsetRenderGroup(RenderGroup renderGroup) Methods inherited from class BaseView
componentsCheck, getBase, getBody, getComponent, getComponentType, getRender, hasCt, isHalfResolutionBuffer, isVisible, isVisible, setColor, setVisible, setVisibleModifier and TypeMethodDescriptionprotected booleancomponentsCheck(com.badlogic.ashley.core.Entity entity) Check whether the current components are the same as the components of the given entity.getBase()getBody()<T extends com.badlogic.ashley.core.Component>
TgetComponent(Class<T> c) booleanbooleanbooleanbooleanisVisible(boolean attributeValue) voidsetColor(float[] color) voidsetVisible(boolean visible) voidsetVisible(boolean visible, String name) Methods inherited from class AbstractView
check, clearEntity, getEntity, isValid, setEntityModifier and TypeMethodDescriptionprotected voidcheck(com.badlogic.ashley.core.Entity entity, com.badlogic.ashley.core.ComponentMapper mapper, Class<? extends com.badlogic.ashley.core.Component> componentClass) Checks whether an entity has a component, and throws aRuntimeExceptionif it does not.voidRemoves the entity (if any) of this view and sets all component references to null.com.badlogic.ashley.core.EntityReturns the current entity under this view.booleanisValid()Checks whether the entity is valid, i.e., it is not null and has at least one component.voidsetEntity(com.badlogic.ashley.core.Entity entity) Sets the entity behind this view.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IRenderable
getComponentType, isHalfResolutionBufferModifier and TypeMethodDescriptionGets the component types of this entitybooleanIs this renderable flagged to be rendered in a half-resolution buffer?
-
Constructor Details
-
VertsView
public VertsView() -
VertsView
public VertsView(com.badlogic.ashley.core.Entity entity)
-
-
Method Details
-
entityCheck
protected void entityCheck(com.badlogic.ashley.core.Entity entity) Description copied from class:AbstractViewChecks whether the given entity is suitable for this view. This method should throw aRuntimeExceptionif the entity is not suitable.- Overrides:
entityCheckin classBaseView- Parameters:
entity- The entity.
-
entityChanged
protected void entityChanged()Description copied from class:AbstractViewContains actions to take after a new entity has been set. This method is typically used to initialize the view components.- Overrides:
entityChangedin classBaseView
-
entityCleared
protected void entityCleared()Description copied from class:AbstractViewThis method is called when the entity of this view is cleared. It should set all component references to null.- Overrides:
entityClearedin classBaseView
-
markForUpdate
public void markForUpdate()- Specified by:
markForUpdatein interfaceIGPUVertsRenderable
-
getPointCloud
- Specified by:
getPointCloudin interfaceIGPUVertsRenderable
-
getColor
public float[] getColor()- Specified by:
getColorin interfaceIGPUVertsRenderable
-
getAlpha
public double getAlpha()- Specified by:
getAlphain interfaceIGPUVertsRenderable
-
getLocalTransform
public com.badlogic.gdx.math.Matrix4 getLocalTransform()- Specified by:
getLocalTransformin interfaceIGPUVertsRenderable
-
getParentEntity
public com.badlogic.ashley.core.Entity getParentEntity()- Specified by:
getParentEntityin interfaceIGPUVertsRenderable
-
isClosedLoop
public boolean isClosedLoop()- Specified by:
isClosedLoopin interfaceIGPUVertsRenderable
-
setClosedLoop
public void setClosedLoop(boolean closedLoop) - Specified by:
setClosedLoopin interfaceIGPUVertsRenderable
-
blend
public void blend()- Specified by:
blendin interfaceIGPUVertsRenderable
-
depth
public void depth()- Specified by:
depthin interfaceIGPUVertsRenderable
-
getGlPrimitive
public int getGlPrimitive()- Specified by:
getGlPrimitivein interfaceIGPUVertsRenderable
-
setGlPrimitive
public void setGlPrimitive(int glPrimitive) -
getPrimitiveSize
public float getPrimitiveSize()- Specified by:
getPrimitiveSizein interfaceIGPUVertsRenderable
-
setPrimitiveSize
public void setPrimitiveSize(float size) Description copied from interface:IGPUVertsRenderableLine width for lines, point size for points- Specified by:
setPrimitiveSizein interfaceIGPUVertsRenderable- Parameters:
size- The size
-
getDistToCamera
public double getDistToCamera()Description copied from interface:IRenderableGets the last distance to the camera calculated for this entity- Specified by:
getDistToCamerain interfaceIRenderable- Returns:
- The distance
-
getOpacity
public float getOpacity()Description copied from interface:IRenderableReturns the opacity of this renderable- Specified by:
getOpacityin interfaceIRenderable- Overrides:
getOpacityin classBaseView- Returns:
- The opacity
-
setPoints
public void setPoints(double[] points) Sets the 3D points of the line in the internal reference system.- Parameters:
points- Vector with the points. If length is not multiple of 3, some points are discarded.
-
addPoints
public void addPoints(double[] points) Adds the given points to this data- Parameters:
points- The points to add
-
addPoint
Adds the given point ot this data- Parameters:
point- The point to add
-
setRenderGroup
-
isEmpty
public boolean isEmpty()Description copied from class:AbstractViewChecks whether an entity is set in this view. Note that an entity may be set, but the entity may have been removed from the engine. In that case, the entity is no longer valid. UseAbstractView.isValid().- Overrides:
isEmptyin classAbstractView- Returns:
- True if an entity is not set. False otherwise.
-
clear
public void clear()Clears the data from this object, both in RAM and VRAM
-