Package toxi.geom
Class PointCloud3D
java.lang.Object
toxi.geom.PointCloud3D
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionApplies the given transformation matrix to all points in the cloud.center()
Updates all points in the cloud so that their new centroid is at the origin.center
(ReadonlyVec3D origin) Updates all points in the cloud so that their new centroid is at the given point.clear()
Removes all points from the cloud and resets the bounds and centroid.copy()
Creates a deep copy of the clouditerator()
boolean
Removes the point from the cloud, but doesn't update the bounds automatically.int
size()
Recalculates the bounding box, bounding sphere and centroid of the cloud.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PointCloud3D
public PointCloud3D() -
PointCloud3D
public PointCloud3D(int numPoints)
-
-
Method Details
-
addAll
-
addPoint
-
applyMatrix
Applies the given transformation matrix to all points in the cloud.- Parameters:
m
- transformation matrix- Returns:
- itself
-
center
Updates all points in the cloud so that their new centroid is at the origin.- Returns:
- itself
-
center
Updates all points in the cloud so that their new centroid is at the given point.- Parameters:
origin
- new centroid- Returns:
- itself
-
clear
Removes all points from the cloud and resets the bounds and centroid.- Returns:
- itself
-
copy
Creates a deep copy of the cloud- Returns:
- copied instance
-
getBoundingBox
-
getBoundingSphere
-
getCentroid
- Returns:
- the cloud centroid
-
iterator
-
removePoint
Removes the point from the cloud, but doesn't update the bounds automatically.- Parameters:
p
-- Returns:
- true, if point has been removed.
-
size
public int size()- Returns:
- the current number of points in the cloud
-
updateBounds
Recalculates the bounding box, bounding sphere and centroid of the cloud.- Returns:
- itself
-