Class GObject
java.lang.Object
com.j3d.engine.react.events.EventEmitter
com.j3d.engine.react.events.EventEmitterAndListener
com.j3d.engine.scene.nodes.geometry.GObject
- All Implemented Interfaces:
EventEmitterInterface, EventListener, CanCopy, SceneObject, HasProperties
public abstract sealed class GObject
extends EventEmitterAndListener
implements CanCopy, SceneObject
permits GPoint, GLine, GTri, GCurve, GPolygon, GPolyline
Graphics Object is an abstract class that represents any actual tangible
Geometry in the 3d space (Cartesian space) that a user can see and
interact with. This only has 3 extenders,
GPoint, GLine
and GTri as these form the base objects and cannot be broken
down further.
Any GObject also has event listening and emitting capabilities
as an extender of EventEmitter and an implementor of
EventListener. It is up to the child classes to decide
which events it wants to listen to or emit.
- Author:
- Lehlogonolo Poole
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Colorprivate UUIDA Unique UUID to identify this geometry.private final SceneObjectTagsprivate Vector3The pivot point of this geometry.Fields 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.booleanDeletes itselfboolean<T extends Pure>
ArrayList<RenderState<T, GObject>> Returns this geometry's colorabstract EngineObject.TypegetId()Returns this geometry's unique identifiergetName()The name of any GObject is irrelevant and is jsut the UUID.getPivot()Returns the pivot point.getTags()Returns the map of instance tags.inthashCode()booleanvoidonEvent(EventType event, EventPayload properties) onEvent is called byEventEmitterviaEventEmitter.broadcast(EventType, EventPayload).voidSets the colourvoidSets this geometry's unique identifiervoidSets the pivot point.toObject()Converts this SceneObject to aEngineObjectbeing a Jaiva-readableArrayListof data.Methods 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 SceneObject
tag
-
Field Details
-
col
-
pivot
-
Id
A Unique UUID to identify this geometry. -
properties
-
objectTags
-
pivotProperty
-
-
Constructor Details
-
GObject
public GObject()Default Constructor. -
GObject
-
-
Method Details
-
genericRenderStateList
-
addProps
private void addProps() -
getPivot
-
deleteSelf
public boolean deleteSelf()Deletes itself- Returns:
- true if the object was deleted
-
setPivot
-
setColour
-
getColour
-
getId
Returns this geometry's unique identifier- Specified by:
getIdin interfaceSceneObject- Returns:
- The UUID
-
getName
The name of any GObject is irrelevant and is jsut the UUID.- Specified by:
getNamein interfaceSceneObject- Returns:
- The UUID as a String
-
setId
Sets this geometry's unique identifier- Parameters:
id- The new UUID- See Also:
-
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- 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.
-
getProperties
Description copied from interface:HasPropertiesReturns anArrayListofPropertyobjects associated with this instance. Each property can hold a value of a specific type and have a specific key type.- Specified by:
getPropertiesin interfaceHasProperties- Returns:
- an ArrayList of properties.
-
equals
-
hashCode
-
onEvent
Description copied from interface:EventListeneronEvent is called byEventEmitterviaEventEmitter.broadcast(EventType, EventPayload). Allowing the emitter to call any other object that implements this.- Specified by:
onEventin interfaceEventListener- Parameters:
event- The type of eventproperties- The given event payload
-
isDeletedState
public boolean isDeletedState() -
getEngineObjectType
-
toObject
Description copied from interface:SceneObjectConverts this SceneObject to aEngineObjectbeing a Jaiva-readableArrayListof data.- Specified by:
toObjectin interfaceSceneObject- Returns:
- An
EngineObject
-
asReference
-
getTags
Description copied from interface:SceneObjectReturns the map of instance tags.- Specified by:
getTagsin interfaceSceneObject- Returns:
- A
SceneObjectTags
-