Class GPoint
java.lang.Object
com.j3d.engine.react.events.EventEmitter
com.j3d.engine.scene.nodes.geometry.GObject
com.j3d.engine.scene.nodes.geometry.GPoint
- All Implemented Interfaces:
EventEmitterInterface,EventListener,CanCopy,DecomposeWhenDrawn<Point>,HasParents<GObject>,SceneObject,HasProperties
GPoint is a class that represents a single point in 3D space.
Unlike other GObjects who's pivot has to be calculated to be
it's geometric centre, a GPoint's pivot is just its position.
a Thing stores GPoints separately as they form the core
of any transformation irrespective of whether it's part of some
other geometry. This means all transformations need to be point based
and applied to the GPoint.
A GPoint is also stored within SceneManager.points for redundancy.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.j3d.engine.scene.nodes.geometry.GObject
GObject.EngineObjectUtils -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe diameter of the point when drawn on screen.private RenderState<Point, GObject> Fields inherited from class com.j3d.engine.scene.nodes.geometry.GObject
col, pivotProperty, propertiesFields inherited from class com.j3d.engine.react.events.EventEmitter
registered -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a parent to this object's set of parents.private voidaddProps()voidcopy(CopyProperties props) Copies the properties of this object based on the providedCopyProperties.protected GPointcopySelf()voidbooleanDeletes itselfbooleanvoidstatic GPointConstructs a GPoint.Retrieves the set of all parent objects that this object belongs to.inthashCode()voidremoveParent(GObject parent) Removes a parent from this object's set of parents.voidSets the pivot point.toPoint()toString()Methods inherited from class com.j3d.engine.scene.nodes.geometry.GObject
asReference, getColour, getId, getName, getPivot, getProperties, isDeletedState, onEvent, setColour, setId, toObjectMethods inherited from class com.j3d.engine.react.events.EventEmitter
attachListener, broadcast, detachAll, detachListener, genericAttach, genericBroadcast, genericDetach, genericDetachAll, isAttachedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.j3d.engine.scene.nodes.geometry.base.DecomposeWhenDrawn
invalidateAllMethods inherited from interface com.j3d.engine.scene.nodes.geometry.base.HasParents
addParents, clearParents, hasParent
-
Field Details
-
DIAMETER
public static final int DIAMETERThe diameter of the point when drawn on screen.This should be used as the standard diameter for all points.
- See Also:
-
parents
-
renderState
-
-
Constructor Details
-
GPoint
Default Constructor- Parameters:
v3- The position of this point.
-
-
Method Details
-
fromRaw
Constructs a GPoint.- Parameters:
id- The ID of the GPoint defined by the filepoint- The position of the GPoint defined by the file- Returns:
- A GPoint
-
setPivot
Description copied from class:GObjectSets the pivot point. -
toPoint
-
addProps
private void addProps() -
deleteSelf
public boolean deleteSelf()Description copied from class:GObjectDeletes itself- Overrides:
deleteSelfin classGObject- Returns:
- true if the object was deleted
-
equals
-
toString
-
getParents
Description copied from interface:HasParentsRetrieves the set of all parent objects that this object belongs to.- Specified by:
getParentsin interfaceHasParents<GObject>- Returns:
- A
HashSetcontaining all parent objects. Using a Set ensures that a parent can only be added once.
-
addParent
Description copied from interface:HasParentsAdds a parent to this object's set of parents.- Specified by:
addParentin interfaceHasParents<GObject>- Parameters:
parent- The parent object to add.
-
removeParent
Description copied from interface:HasParentsRemoves a parent from this object's set of parents.- Specified by:
removeParentin interfaceHasParents<GObject>- Parameters:
parent- The parent object to remove.
-
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.
-
copySelf
-
explode
-
hashCode
public int hashCode() -
decompose
public void decompose()- Specified by:
decomposein interfaceDecomposeWhenDrawn<Point>
-
getDecomposeList
- Specified by:
getDecomposeListin interfaceDecomposeWhenDrawn<Point>
-
genericRenderStateList
- Overrides:
genericRenderStateListin classGObject
-
getEngineObjectType
- Specified by:
getEngineObjectTypein classGObject
-