Record Class Sphere
java.lang.Object
java.lang.Record
nl.colorize.multimedialib.math.Sphere
- All Implemented Interfaces:
Shape3D
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncenter()Returns the value of thecenterrecord component.booleanfinal booleanIndicates whether some other object is "equal to" this one.Returns the smallest possible bounding box that can fit this shape.final inthashCode()Returns a hash code value for this object.floatradius()Returns the value of theradiusrecord component.reposition(Point3D offset) Returns a newShape3Dinstance that is repositioned by the specified offset.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Sphere
Creates an instance of aSphererecord class.- Parameters:
center- the value for thecenterrecord componentradius- the value for theradiusrecord component
-
Sphere
public Sphere(float radius) Creates a sphere with its center point located at the origin (0, 0, 0).
-
-
Method Details
-
getBoundingBox
Description copied from interface:Shape3DReturns the smallest possible bounding box that can fit this shape.- Specified by:
getBoundingBoxin interfaceShape3D
-
getCenter
-
contains
-
reposition
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
center
Returns the value of thecenterrecord component.- Returns:
- the value of the
centerrecord component
-
radius
public float radius()Returns the value of theradiusrecord component.- Returns:
- the value of the
radiusrecord component
-