java.lang.Object
org.jfree.chart3d.graphics3d.World
A world is a model containing a collection of objects in 3D space and a
direction vector for the sunlight. A viewing point (
ViewPoint3D
) is
specified externally. Objects in the world are assigned to a partition,
providing the ability to group objects.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an object to a specific partition.void
Adds an object to the world in the default partition.void
addAll
(Collection<Object3D> objects) Adds a collection of objects to the world (in the default partition).Point3D[]
Returns an array containing the vertices for all objects in this world, transformed to eye coordinates.Point2D[]
calculateProjectedPoints
(ViewPoint3D vp, double d) Calculates the projected points in 2D-space for all the vertices of the objects in the world.void
Clears any objects belonging to the specified partition.getFaces()
Fetches the faces for all the objects in this world, updating the offset to match the current position.Returns a newly created list containing all the objects in the world model.double
getSunX()
Returns the x-component of the sunlight vector.double
getSunY()
Returns the y-component of the sunlight vector.double
getSunZ()
Returns the z-component of the sunlight vector.int
Returns the total number of vertices for all objects in this world.final void
setSunSource
(double x, double y, double z) Sets the light source point.final void
Sets the light source point.
-
Field Details
-
DEFAULT_PARTITION_KEY
The default partition key. All objects in the world are added with a partition key. There always exists at least one partition (the default partition).- Since:
- 1.2
- See Also:
-
-
Constructor Details
-
World
public World()Creates a new empty world.
-
-
Method Details
-
getSunX
Returns the x-component of the sunlight vector.- Returns:
- The x-component of the sunlight vector.
-
getSunY
Returns the y-component of the sunlight vector.- Returns:
- The y-component of the sunlight vector.
-
getSunZ
Returns the z-component of the sunlight vector.- Returns:
- The z-component of the sunlight vector.
-
setSunSource
Sets the light source point.- Parameters:
x
- the x-coordinate.y
- the y-coordinate.z
- the z-coordinate.- Since:
- 1.2
-
setSunSource
Sets the light source point.- Parameters:
p
- the point (null
not permitted).- Since:
- 1.2
-
add
Adds an object to the world in the default partition.- Parameters:
object
- the object (null
not permitted).
-
add
Adds an object to a specific partition.- Parameters:
partition
- the partition (null
not permitted).object
- the object (null
not permitted).- Since:
- 1.2
-
addAll
Adds a collection of objects to the world (in the default partition).- Parameters:
objects
- the objects (null
not permitted).
-
clear
Clears any objects belonging to the specified partition.- Parameters:
partitionKey
- the partition key (null
not permitted).- Since:
- 1.2
-
getVertexCount
Returns the total number of vertices for all objects in this world.- Returns:
- The total number of vertices.
-
calculateEyeCoordinates
Returns an array containing the vertices for all objects in this world, transformed to eye coordinates.- Parameters:
vp
- the view point (null
not permitted).- Returns:
- The eye coordinates.
-
calculateProjectedPoints
Calculates the projected points in 2D-space for all the vertices of the objects in the world.- Parameters:
vp
- the view point (null
not permitted).d
- the distance.- Returns:
- The projected points.
-
getFaces
Fetches the faces for all the objects in this world, updating the offset to match the current position.- Returns:
- A list of faces.
-
getObjects
Returns a newly created list containing all the objects in the world model.- Returns:
- The list of objects.
- Since:
- 1.2
-