Package rosequartz.coll
Class SphereCollider
java.lang.Object
rosequartz.coll.Collider
rosequartz.coll.SphereCollider
- All Implemented Interfaces:
Serializable
Represents a collider in the shape of a sphere.
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionSphereCollider(float x, float y, float z, float radius)Constructs a sphere-collider from the position of its center and its radius.SphereCollider(Vec3 xyz, float radius)Constructs a sphere-collider from the position of its center and its radius. -
Method Summary
Modifier and TypeMethodDescriptionfloatfloatfloatfloatGets the radius of the sphere.setPosition(float x, float y, float z)Sets the position of the center of the sphere.setPosition(Vec3 xyz)Sets the position of the center of the sphere.setRadius(float radius)Sets the radius of the sphere.toString()Methods inherited from class rosequartz.coll.Collider
acceptColliderType, getCenter, getColliding, getPointInside, getPointInside
-
Constructor Details
-
SphereCollider
public SphereCollider(float x, float y, float z, float radius)Constructs a sphere-collider from the position of its center and its radius.- Parameters:
x- position of the center on the x-axisy- position of the center on the y-axisz- position of the center on the z-axisradius- radius
-
SphereCollider
Constructs a sphere-collider from the position of its center and its radius.- Parameters:
xyz- position of the centerradius- radius
-
-
Method Details
-
setPosition
Sets the position of the center of the sphere.- Parameters:
x- position of the center on the x-axisy- position of the center on the y-axisz- position of the center on the z-axis- Returns:
- this
-
setPosition
Sets the position of the center of the sphere.- Parameters:
xyz- position of the center- Returns:
- this
-
setRadius
Sets the radius of the sphere.- Parameters:
radius- radius- Returns:
- this
-
getCenterX
public float getCenterX() -
getCenterY
public float getCenterY() -
getCenterZ
public float getCenterZ() -
getRadius
public float getRadius()Gets the radius of the sphere.- Returns:
- radius
-
toString
-