com.badlogic.gdx.math
Class Circle

java.lang.Object
  extended by com.badlogic.gdx.math.Circle
All Implemented Interfaces:
Serializable

public class Circle
extends Object
implements Serializable

A convenient 2D circle class.

Author:
mzechner
See Also:
Serialized Form

Field Summary
 float radius
           
 float x
           
 float y
           
 
Constructor Summary
Circle()
          Constructs a new circle with all values set to zero
Circle(Circle circle)
           
Circle(float x, float y, float radius)
           
Circle(Vector2 position, float radius)
           
 
Method Summary
 boolean contains(Circle c)
           
 boolean contains(float x, float y)
           
 boolean contains(Vector2 point)
           
 boolean overlaps(Circle c)
           
 void set(Circle circle)
           
 void set(float x, float y, float radius)
           
 void set(Vector2 position, float radius)
           
 void setPosition(float x, float y)
          Sets the x and y-coordinates of circle center
 void setPosition(Vector2 position)
          Sets the x and y-coordinates of circle center from vector
 void setRadius(float radius)
          Sets the radius of circle
 void setX(float x)
          Sets the x-coordinate of circle center
 void setY(float y)
          Sets the y-coordinate of circle center
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public float x

y

public float y

radius

public float radius
Constructor Detail

Circle

public Circle()
Constructs a new circle with all values set to zero


Circle

public Circle(float x,
              float y,
              float radius)

Circle

public Circle(Vector2 position,
              float radius)

Circle

public Circle(Circle circle)
Method Detail

set

public void set(float x,
                float y,
                float radius)

set

public void set(Vector2 position,
                float radius)

set

public void set(Circle circle)

setPosition

public void setPosition(Vector2 position)
Sets the x and y-coordinates of circle center from vector

Parameters:
position - The position vector

setPosition

public void setPosition(float x,
                        float y)
Sets the x and y-coordinates of circle center

Parameters:
x - The x-coordinate
y - The y-coordinate

setX

public void setX(float x)
Sets the x-coordinate of circle center

Parameters:
x - The x-coordinate

setY

public void setY(float y)
Sets the y-coordinate of circle center

Parameters:
y - The y-coordinate

setRadius

public void setRadius(float radius)
Sets the radius of circle

Parameters:
radius - The radius

contains

public boolean contains(float x,
                        float y)

contains

public boolean contains(Vector2 point)

contains

public boolean contains(Circle c)
Parameters:
c - the other Circle
Returns:
whether this circle contains the other circle.

overlaps

public boolean overlaps(Circle c)
Parameters:
c - the other Circle
Returns:
whether this circle overlaps the other circle.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.