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 TypeMethodDescriptionvoidAdds an object to a specific partition.voidAdds an object to the world in the default partition.voidaddAll(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.voidClears 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.doublegetSunX()Returns the x-component of the sunlight vector.doublegetSunY()Returns the y-component of the sunlight vector.doublegetSunZ()Returns the z-component of the sunlight vector.intReturns the total number of vertices for all objects in this world.final voidsetSunSource(double x, double y, double z) Sets the light source point.final voidSets 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 (nullnot permitted).- Since:
- 1.2
-
add
Adds an object to the world in the default partition.- Parameters:
object- the object (nullnot permitted).
-
add
Adds an object to a specific partition.- Parameters:
partition- the partition (nullnot permitted).object- the object (nullnot permitted).- Since:
- 1.2
-
addAll
Adds a collection of objects to the world (in the default partition).- Parameters:
objects- the objects (nullnot permitted).
-
clear
Clears any objects belonging to the specified partition.- Parameters:
partitionKey- the partition key (nullnot 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 (nullnot 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 (nullnot 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
-