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 group 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 booleanadditiveprotected booleanblendprotected booleanclosedLoopWhether to close the polyline (connect end point to start point) or notprotected intcountprotected booleandepthprotected intglPrimitiveprotected booleaninGpuGPU rendering attributesprotected intoffsetIndicates the index of the mesh data in the rendererprotected PointCloudDatapointCloudDataprotected floatprimitiveSizeprotected SceneGraphNode.RenderGrouprenderGroupThe render group-
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 voidaddPoint(Vector3d point)Adds the given point ot this datavoidaddPoints(double[] points)Adds the given points to this dataprotected voidaddToRenderLists(ICamera camera)Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.voidblend()voidclear()Clears the data from this object, both in RAM and VRAMvoiddepth()doublegetAlpha()float[]getColor()intgetCount()intgetGlPrimitive()com.badlogic.gdx.math.Matrix4getLocalTransform()intgetOffset()SceneGraphNodegetParent()PointCloudDatagetPointCloud()floatgetPrimitiveSize()booleaninGpu()booleanisClosedLoop()booleanisEmpty()booleanisLine()booleanisPoint()voidmarkForUpdate()voidsetAdditive(boolean additive)voidsetBlend(boolean blend)voidsetClosedLoop(boolean closedLoop)voidsetCount(int count)voidsetDepth(boolean depth)voidsetGlPrimitive(int glPrimitive)voidsetInGpu(boolean inGpu)voidsetOffset(int offset)voidsetPointCloudData(PointCloudData pcd)voidsetPoints(double[] points)Sets the 3D points of the line in the internal reference system.voidsetPrimitiveLineLoop()voidsetPrimitiveLines()voidsetPrimitiveLineStip()voidsetPrimitivePoints()voidsetPrimitiveSize(float lineWidth)Line width for lines, point size for pointsvoidupdateLocalValues(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, setLabelcolor, setLabelcolor, 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, 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 group
-
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:AbstractPositionEntityAdds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.- Specified by:
addToRenderListsin classAbstractPositionEntity
-
updateLocalValues
public void updateLocalValues(ITimeFrameProvider time, ICamera camera)
Description copied from class:AbstractPositionEntityThis function updates all the local values before the localTransform is updated. Position, rotations and scale must be updated in here.- Specified by:
updateLocalValuesin 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:
inGpuin interfaceIGPUVertsRenderable
-
getOffset
public int getOffset()
- Specified by:
getOffsetin interfaceIGPUVertsRenderable
-
getCount
public int getCount()
- Specified by:
getCountin interfaceIGPUVertsRenderable
-
setPointCloudData
public void setPointCloudData(PointCloudData pcd)
-
getPointCloud
public PointCloudData getPointCloud()
- Specified by:
getPointCloudin interfaceIGPUVertsRenderable
-
getColor
public float[] getColor()
- Specified by:
getColorin interfaceIGPUVertsRenderable
-
getAlpha
public double getAlpha()
- Specified by:
getAlphain interfaceIGPUVertsRenderable- Overrides:
getAlphain classAbstractPositionEntity
-
getLocalTransform
public com.badlogic.gdx.math.Matrix4 getLocalTransform()
- Specified by:
getLocalTransformin interfaceIGPUVertsRenderable
-
getParent
public SceneGraphNode getParent()
- Specified by:
getParentin interfaceIGPUVertsRenderable
-
setInGpu
public void setInGpu(boolean inGpu)
- Specified by:
setInGpuin interfaceIGPUVertsRenderable
-
setOffset
public void setOffset(int offset)
- Specified by:
setOffsetin interfaceIGPUVertsRenderable
-
setCount
public void setCount(int count)
- Specified by:
setCountin interfaceIGPUVertsRenderable
-
setPrimitiveSize
public void setPrimitiveSize(float lineWidth)
Description copied from interface:IGPUVertsRenderableLine width for lines, point size for points- Specified by:
setPrimitiveSizein interfaceIGPUVertsRenderable- Parameters:
lineWidth- The size
-
getPrimitiveSize
public float getPrimitiveSize()
- Specified by:
getPrimitiveSizein interfaceIGPUVertsRenderable
-
isClosedLoop
public boolean isClosedLoop()
- Specified by:
isClosedLoopin interfaceIGPUVertsRenderable
-
setClosedLoop
public void setClosedLoop(boolean closedLoop)
- Specified by:
setClosedLoopin 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:
blendin interfaceIGPUVertsRenderable
-
depth
public void depth()
- Specified by:
depthin interfaceIGPUVertsRenderable
-
setGlPrimitive
public void setGlPrimitive(int glPrimitive)
-
getGlPrimitive
public int getGlPrimitive()
- Specified by:
getGlPrimitivein interfaceIGPUVertsRenderable
-
setPrimitiveLineStip
public void setPrimitiveLineStip()
-
setPrimitiveLines
public void setPrimitiveLines()
-
setPrimitiveLineLoop
public void setPrimitiveLineLoop()
-
setPrimitivePoints
public void setPrimitivePoints()
-
markForUpdate
public void markForUpdate()
- Specified by:
markForUpdatein interfaceIGPUVertsRenderable
-
isLine
public boolean isLine()
-
isPoint
public boolean isPoint()
-
-