Package gaiasky.scene.view
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 gaiasky.scene.view.AbstractView
entity
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given point ot this datavoid
addPoints
(double[] points) Adds the given points to this datavoid
blend()
void
clear()
Clears the data from this object, both in RAM and VRAMvoid
depth()
protected void
Contains actions to take after a new entity has been set.protected void
entityCheck
(com.badlogic.ashley.core.Entity entity) Checks whether the given entity is suitable for this view.protected void
This method is called when the entity of this view is cleared.double
getAlpha()
float[]
getColor()
Gets the component types of this entitydouble
Gets the last distance to the camera calculated for this entityint
com.badlogic.gdx.math.Matrix4
float
Returns the opacity of this renderablecom.badlogic.ashley.core.Entity
float
boolean
boolean
isEmpty()
Checks whether an entity is set in this view.void
void
setClosedLoop
(boolean closedLoop) void
setGlPrimitive
(int glPrimitive) void
setPoints
(double[] points) Sets the 3D points of the line in the internal reference system.void
setPrimitiveSize
(float size) Line width for lines, point size for pointsvoid
setRenderGroup
(RenderGroup renderGroup) Methods inherited from class gaiasky.scene.view.BaseView
componentsCheck, getBase, getBody, getComponent, hasCt, isVisible, isVisible, setColor, setVisible, setVisible
Methods inherited from class gaiasky.scene.view.AbstractView
check, clearEntity, getEntity, isValid, setEntity
-
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:AbstractView
Checks whether the given entity is suitable for this view. This method should throw aRuntimeException
if the entity is not suitable.- Overrides:
entityCheck
in classBaseView
- Parameters:
entity
- The entity.
-
entityChanged
protected void entityChanged()Description copied from class:AbstractView
Contains actions to take after a new entity has been set. This method is typically used to initialize the view components.- Overrides:
entityChanged
in classBaseView
-
entityCleared
protected void entityCleared()Description copied from class:AbstractView
This method is called when the entity of this view is cleared. It should set all component references to null.- Overrides:
entityCleared
in classBaseView
-
markForUpdate
public void markForUpdate()- Specified by:
markForUpdate
in interfaceIGPUVertsRenderable
-
getPointCloud
- Specified by:
getPointCloud
in interfaceIGPUVertsRenderable
-
getColor
public float[] getColor()- Specified by:
getColor
in interfaceIGPUVertsRenderable
-
getAlpha
public double getAlpha()- Specified by:
getAlpha
in interfaceIGPUVertsRenderable
-
getLocalTransform
public com.badlogic.gdx.math.Matrix4 getLocalTransform()- Specified by:
getLocalTransform
in interfaceIGPUVertsRenderable
-
getParentEntity
public com.badlogic.ashley.core.Entity getParentEntity()- Specified by:
getParentEntity
in interfaceIGPUVertsRenderable
-
isClosedLoop
public boolean isClosedLoop()- Specified by:
isClosedLoop
in interfaceIGPUVertsRenderable
-
setClosedLoop
public void setClosedLoop(boolean closedLoop) - Specified by:
setClosedLoop
in interfaceIGPUVertsRenderable
-
blend
public void blend()- Specified by:
blend
in interfaceIGPUVertsRenderable
-
depth
public void depth()- Specified by:
depth
in interfaceIGPUVertsRenderable
-
getGlPrimitive
public int getGlPrimitive()- Specified by:
getGlPrimitive
in interfaceIGPUVertsRenderable
-
setGlPrimitive
public void setGlPrimitive(int glPrimitive) -
getPrimitiveSize
public float getPrimitiveSize()- Specified by:
getPrimitiveSize
in interfaceIGPUVertsRenderable
-
setPrimitiveSize
public void setPrimitiveSize(float size) Description copied from interface:IGPUVertsRenderable
Line width for lines, point size for points- Specified by:
setPrimitiveSize
in interfaceIGPUVertsRenderable
- Parameters:
size
- The size
-
getComponentType
Description copied from interface:IRenderable
Gets the component types of this entity- Specified by:
getComponentType
in interfaceIRenderable
- Overrides:
getComponentType
in classBaseView
- Returns:
- The component types
-
getDistToCamera
public double getDistToCamera()Description copied from interface:IRenderable
Gets the last distance to the camera calculated for this entity- Specified by:
getDistToCamera
in interfaceIRenderable
- Returns:
- The distance
-
getOpacity
public float getOpacity()Description copied from interface:IRenderable
Returns the opacity of this renderable- Specified by:
getOpacity
in interfaceIRenderable
- Overrides:
getOpacity
in 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:AbstractView
Checks 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:
isEmpty
in 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
-