Class GObject
java.lang.Object
com.j3d.engine.react.events.EventEmitter
com.j3d.engine.scene.nodes.geometry.GObject
- All Implemented Interfaces:
EventEmitterInterface,EventListener,CanCopy,SceneObject,HasProperties
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 Vector3The pivot point of this geometry.Fields inherited from class com.j3d.engine.react.events.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.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()Methods inherited from class com.j3d.engine.react.events.EventEmitter
attachListener, broadcast, detachAll, detachListener, genericAttach, genericBroadcast, genericDetach, genericDetachAll, isAttached
-
Field Details
-
col
-
pivot
The pivot point of this geometry. Unless aGPointwhere this represents the actual location of the point. -
Id
A Unique UUID to identify this geometry. -
properties
-
pivotProperty
-
-
Constructor Details
-
GObject
public GObject()Default Constructor. -
GObject
Default Constructor. with color- Parameters:
colour- The colour.
-
-
Method Details
-
genericRenderStateList
-
addProps
private void addProps() -
getPivot
Returns the pivot point.- Returns:
- a CartesianPoint
-
deleteSelf
public boolean deleteSelf()Deletes itself- Returns:
- true if the object was deleted
-
setPivot
Sets the pivot point.- Parameters:
pivot- The new pivot point.
-
setColour
Sets the colour- Parameters:
colour- The new colour
-
getColour
Returns this geometry's color- Returns:
- The Color
-
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
public int 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
-
asReference
-