Class GPolygon
java.lang.Object
com.j3d.engine.react.events.EventEmitter
com.j3d.engine.react.events.EventEmitterAndListener
com.j3d.engine.scene.nodes.geometry.GObject
com.j3d.engine.scene.nodes.geometry.GPolygon
- All Implemented Interfaces:
EventEmitterInterface, EventListener, IdempotentEventListener<GPointMovedEvent, Vector3>, CanCopy, DecomposeWhenDrawn<Triangle>, SceneObject, HasProperties
public final class GPolygon
extends GObject
implements IdempotentEventListener<GPointMovedEvent, Vector3>, DecomposeWhenDrawn<Triangle>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate ArrayList<RenderState<Triangle, GObject>> private TriangulationMethod.Triangulatedprivate Triangulationprivate WindingDirFields inherited from class GObject
col, pivotProperty, propertiesFields inherited from class EventEmitter
registered -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddProps()voidcopy(CopyProperties props) Copies the properties of this object based on the providedCopyProperties.voidThe actual decomposition.explode()static GPolygonfromRaw(String id, Color col, ArrayList<GPoint> points, Triangulation triangulation, WindingDir windingDir) Fetches the actual decomposition list.Returns the duplicate object that events of typeTwill calculate/generate.voidhandlePossibleDuplicates(EventType type, GPointMovedEvent payload) The handler to pass through for this specific type.voidsetTriangulation(Triangulation triangulation) voidsetWindingDir(WindingDir windingDir) toObject()Converts this SceneObject to aEngineObjectbeing a Jaiva-readableArrayListof data.private voidtriangulate(ArrayList<GPoint> points) Methods inherited from class GObject
asReference, deleteSelf, equals, getColour, getId, getName, getPivot, getProperties, getTags, hashCode, isDeletedState, onEvent, setColour, setId, setPivotMethods inherited from class EventEmitter
attachListener, broadcast, detachAll, detachListener, genericAttach, genericBroadcast, genericDetach, genericDetachAll, isAttachedMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DecomposeWhenDrawn
invalidateAllMethods inherited from interface SceneObject
tag
-
Field Details
-
points
-
windingDir
-
triangles
-
renderState
-
triangulation
-
deletedState
private boolean deletedState
-
-
Constructor Details
-
GPolygon
-
-
Method Details
-
fromRaw
@NotNull @Contract("_, _, _, _, _ -> new") public static GPolygon fromRaw(String id, Color col, ArrayList<GPoint> points, Triangulation triangulation, WindingDir windingDir) -
triangulate
private void triangulate(ArrayList<GPoint> points) throws TriangulationMethod.InvalidTriangulationException -
addProps
private void addProps() -
getDupeObjectToCheck
Description copied from interface:IdempotentEventListenerReturns the duplicate object that events of typeTwill calculate/generate.- Specified by:
getDupeObjectToCheckin interfaceIdempotentEventListener<GPointMovedEvent, Vector3>- Returns:
- The duplicate object to check against.
-
handlePossibleDuplicates
Description copied from interface:IdempotentEventListenerThe handler to pass through for this specific type.- Specified by:
handlePossibleDuplicatesin interfaceIdempotentEventListener<GPointMovedEvent, Vector3>- Parameters:
type- The type of event.payload- The payload given.
-
getEngineObjectType
- Specified by:
getEngineObjectTypein classGObject
-
decompose
public void decompose()Description copied from interface:DecomposeWhenDrawnThe actual decomposition.- Specified by:
decomposein interfaceDecomposeWhenDrawn<Triangle>
-
getDecomposeList
Description copied from interface:DecomposeWhenDrawnFetches the actual decomposition list.- Specified by:
getDecomposeListin interfaceDecomposeWhenDrawn<Triangle>- Returns:
- The arraylist of decomposed stuff
-
genericRenderStateList
- Overrides:
genericRenderStateListin classGObject
-
explode
-
getPoints
-
copy
Description copied from interface:CanCopyCopies the properties of this object based on the providedCopyProperties. The implementation should handle how the copying is performed, potentially creating a new instance or modifying an existing one.- Specified by:
copyin interfaceCanCopy- Overrides:
copyin classGObject- Parameters:
props- The properties defining how the copy operation should be performed.- Throws:
InvalidCopyException- If the copy operation cannot be completed due to invalid properties or state.
-
copy
-
getWindingDir
-
setWindingDir
-
getTriangles
-
generatedPoints
-
getTrianglesForSelectionPurposes
-
setTriangulation
-
getTriangulation
-
generateOutline
-
toObject
Description copied from interface:SceneObjectConverts this SceneObject to aEngineObjectbeing a Jaiva-readableArrayListof data.- Specified by:
toObjectin interfaceSceneObject- Overrides:
toObjectin classGObject- Returns:
- An
EngineObject
-