Package gaiasky.scenegraph
Class VertsObject
- java.lang.Object
-
- gaiasky.scenegraph.SceneGraphNode
-
- gaiasky.scenegraph.AbstractPositionEntity
-
- gaiasky.scenegraph.VertsObject
-
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,IGPUVertsRenderable
,IRenderable
,IStarContainer
,IPosition
- Direct Known Subclasses:
KeyframesPathObject
,Points
,Polyline
public class VertsObject extends AbstractPositionEntity implements IGPUVertsRenderable
Represents a vgroup of vertices which are sent to the GPU in a VBO
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gaiasky.scenegraph.SceneGraphNode
SceneGraphNode.RenderGroup, SceneGraphNode.TLV3, SceneGraphNode.TLV3D
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
additive
protected boolean
blend
protected boolean
closedLoop
Whether to close the polyline (connect end point to start point) or notprotected int
count
protected boolean
depth
protected int
glPrimitive
protected boolean
inGpu
GPU rendering attributesprotected int
offset
Indicates the index of the mesh data in the rendererprotected PointCloudData
pointCloudData
protected float
primitiveSize
protected SceneGraphNode.RenderGroup
renderGroup
The render vgroup-
Fields inherited from class gaiasky.scenegraph.AbstractPositionEntity
cc, coordinates, copy, distToCamera, octant, octantId, pos, posSph, size, viewAngle, viewAngleApparent
-
Fields inherited from class gaiasky.scenegraph.SceneGraphNode
aux3d1, aux3d2, aux3d3, aux3d4, aux3f1, aux3f2, aux3f3, aux3f4, children, computed, ct, id, localTransform, namekey, names, numChildren, opacity, orientation, parent, parentkey, parentName, ROOT_NAME, sg, translation
-
-
Constructor Summary
Constructors Constructor Description VertsObject(SceneGraphNode.RenderGroup rg, int glPrimitive)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPoint(Vector3d point)
Adds the given point ot this datavoid
addPoints(double[] points)
Adds the given points to this dataprotected void
addToRenderLists(ICamera camera)
Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.void
blend()
void
clear()
Clears the data from this object, both in RAM and VRAMvoid
depth()
double
getAlpha()
float[]
getColor()
int
getCount()
int
getGlPrimitive()
com.badlogic.gdx.math.Matrix4
getLocalTransform()
int
getOffset()
SceneGraphNode
getParent()
PointCloudData
getPointCloud()
float
getPrimitiveSize()
boolean
inGpu()
boolean
isClosedLoop()
boolean
isEmpty()
boolean
isLine()
boolean
isPoint()
void
markForUpdate()
void
setAdditive(boolean additive)
void
setBlend(boolean blend)
void
setClosedLoop(boolean closedLoop)
void
setCount(int count)
void
setDepth(boolean depth)
void
setGlPrimitive(int glPrimitive)
void
setInGpu(boolean inGpu)
void
setOffset(int offset)
void
setPointCloudData(PointCloudData pcd)
void
setPoints(double[] points)
Sets the 3D points of the line in the internal reference system.void
setPrimitiveLineLoop()
void
setPrimitiveLines()
void
setPrimitiveLineStip()
void
setPrimitivePoints()
void
setPrimitiveSize(float lineWidth)
Line width for lines, point size for pointsvoid
updateLocalValues(ITimeFrameProvider time, ICamera camera)
This function updates all the local values before the localTransform is updated.-
Methods inherited from class gaiasky.scenegraph.AbstractPositionEntity
computeFuturePosition, doneLoading, getAbsoluteOrientation, getAbsolutePosition, getAbsolutePosition, getDelta, getDistToCamera, getHeight, getHeight, getHeight, getHeightScale, getNext, getOctant, getPos, getPosition, getPosition, getPosSph, getPredictedPosition, getRadius, getSimpleCopy, getSize, getViewAngle, getViewAngleApparent, isCopy, mustUpdatePosition, render2DLabel, render2DLabel, render2DLabel, render2DLabel, render3DLabel, setColor, setColor, setCoordinates, setSize, setSize, updateLocal
-
Methods inherited from class gaiasky.scenegraph.SceneGraphNode
add, add, addChild, addChild, addFocusableObjects, addName, addNodes, addToIndex, addToRender, dispose, getAggregatedChildren, getChildByName, getChildByNameAndType, getChildrenByType, getComponentType, getCt, getFirstStarAncestor, getId, getLineCopy, getName, getNames, getNode, getNode, getOpacity, getOrientation, getRoot, getSceneGraphDepth, getStarCount, getVelocity, hasName, hasName, initialize, insert, isInRender, isInRender, isValidPosition, isVisibilityOn, mustAddToIndex, namesConcat, removeChild, removeFromIndex, removeFromRender, returnToPool, setComputedFlag, setCt, setCt, setId, setName, setNamekey, setNames, setParent, setParentkey, setUp, toString, update, update, updateNames, updateNamesRec
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gaiasky.render.IRenderable
getComponentType, getDistToCamera, getOpacity
-
-
-
-
Field Detail
-
inGpu
protected boolean inGpu
GPU rendering attributes
-
offset
protected int offset
Indicates the index of the mesh data in the renderer
-
count
protected int count
-
blend
protected boolean blend
-
depth
protected boolean depth
-
additive
protected boolean additive
-
glPrimitive
protected int glPrimitive
-
renderGroup
protected SceneGraphNode.RenderGroup renderGroup
The render vgroup
-
closedLoop
protected boolean closedLoop
Whether to close the polyline (connect end point to start point) or not
-
primitiveSize
protected float primitiveSize
-
pointCloudData
protected PointCloudData pointCloudData
-
-
Constructor Detail
-
VertsObject
public VertsObject(SceneGraphNode.RenderGroup rg, int glPrimitive)
-
-
Method Detail
-
addToRenderLists
protected void addToRenderLists(ICamera camera)
Description copied from class:AbstractPositionEntity
Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.- Specified by:
addToRenderLists
in classAbstractPositionEntity
-
updateLocalValues
public void updateLocalValues(ITimeFrameProvider time, ICamera camera)
Description copied from class:AbstractPositionEntity
This function updates all the local values before the localTransform is updated. Position, rotations and scale must be updated in here.- Specified by:
updateLocalValues
in classAbstractPositionEntity
-
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
public void addPoint(Vector3d point)
Adds the given point ot this data- Parameters:
point
- The point to add
-
isEmpty
public boolean isEmpty()
-
clear
public void clear()
Clears the data from this object, both in RAM and VRAM
-
inGpu
public boolean inGpu()
- Specified by:
inGpu
in interfaceIGPUVertsRenderable
-
getOffset
public int getOffset()
- Specified by:
getOffset
in interfaceIGPUVertsRenderable
-
getCount
public int getCount()
- Specified by:
getCount
in interfaceIGPUVertsRenderable
-
setPointCloudData
public void setPointCloudData(PointCloudData pcd)
-
getPointCloud
public PointCloudData getPointCloud()
- Specified by:
getPointCloud
in interfaceIGPUVertsRenderable
-
getColor
public float[] getColor()
- Specified by:
getColor
in interfaceIGPUVertsRenderable
-
getAlpha
public double getAlpha()
- Specified by:
getAlpha
in interfaceIGPUVertsRenderable
- Overrides:
getAlpha
in classAbstractPositionEntity
-
getLocalTransform
public com.badlogic.gdx.math.Matrix4 getLocalTransform()
- Specified by:
getLocalTransform
in interfaceIGPUVertsRenderable
-
getParent
public SceneGraphNode getParent()
- Specified by:
getParent
in interfaceIGPUVertsRenderable
-
setInGpu
public void setInGpu(boolean inGpu)
- Specified by:
setInGpu
in interfaceIGPUVertsRenderable
-
setOffset
public void setOffset(int offset)
- Specified by:
setOffset
in interfaceIGPUVertsRenderable
-
setCount
public void setCount(int count)
- Specified by:
setCount
in interfaceIGPUVertsRenderable
-
setPrimitiveSize
public void setPrimitiveSize(float lineWidth)
Description copied from interface:IGPUVertsRenderable
Line width for lines, point size for points- Specified by:
setPrimitiveSize
in interfaceIGPUVertsRenderable
- Parameters:
lineWidth
- The size
-
getPrimitiveSize
public float getPrimitiveSize()
- Specified by:
getPrimitiveSize
in interfaceIGPUVertsRenderable
-
isClosedLoop
public boolean isClosedLoop()
- Specified by:
isClosedLoop
in interfaceIGPUVertsRenderable
-
setClosedLoop
public void setClosedLoop(boolean closedLoop)
- Specified by:
setClosedLoop
in interfaceIGPUVertsRenderable
-
setBlend
public void setBlend(boolean blend)
-
setAdditive
public void setAdditive(boolean additive)
-
setDepth
public void setDepth(boolean depth)
-
blend
public void blend()
- Specified by:
blend
in interfaceIGPUVertsRenderable
-
depth
public void depth()
- Specified by:
depth
in interfaceIGPUVertsRenderable
-
setGlPrimitive
public void setGlPrimitive(int glPrimitive)
-
getGlPrimitive
public int getGlPrimitive()
- Specified by:
getGlPrimitive
in interfaceIGPUVertsRenderable
-
setPrimitiveLineStip
public void setPrimitiveLineStip()
-
setPrimitiveLines
public void setPrimitiveLines()
-
setPrimitiveLineLoop
public void setPrimitiveLineLoop()
-
setPrimitivePoints
public void setPrimitivePoints()
-
markForUpdate
public void markForUpdate()
- Specified by:
markForUpdate
in interfaceIGPUVertsRenderable
-
isLine
public boolean isLine()
-
isPoint
public boolean isPoint()
-
-