Cross-platform C SDK logo

Cross-platform C SDK

2D Circles

❮ Back
Next ❯
This page has been automatically translated using the Google Translate API services. We are working on improving texts. Thank you for your understanding and patience.

Functions

Cir2Dcir2d (...)
bool_tcir2d_null (...)
voidcir2d_add (...)
voidcir2d_addn (...)
voidcir2d_add_box (...)
voidcir2d_merge (...)

Types and Constants

Cir2DkNULL

Circles provide the simplest container volume (Figure 1), where collision detection occurs optimally.

Drawing a circle on the plane.
Figure 1: Circles as bounding volume.

kNULL

const Cir2Df kCIR2D_NULLf;

const Cir2Dd kCIR2D_NULLd;

const Cir2D Cir2D::kNULL;

Represents a null circle (no geometry).


cir2d ()

Create a 2d circle from its components.

Cir2Df
cir2df(const real32_t x,
       const real32_t y,
       const real32_t r);

Cir2Dd
cir2dd(const real64_t x,
       const real64_t y,
       const real64_t r);

Cir2D
Cir2D(const real x,
      const real y,
      const real r);
x

Center x coordinate.

y

Center y coordinate.

r

Radius.

Return

The 2d circle.


cir2d_null ()

Check if a circle is null (dimensionless).

bool_t
cir2d_nullf(const Cir2Df *cir);

bool_t
cir2d_nulld(const Cir2Dd *cir);

bool_t
Cir2D::null(const Cir2D *cir);
cir

The circle.

Return

TRUE if it is null, FALSE if it contains any point.

Remarks

A single point is a valid circle with radius = 0.


cir2d_add ()

Expand the dimensions of the circle to accommodate the entry point. If the point is already within your area, it will not be modified.

void
cir2d_addf(Cir2Df *cir,
           const V2Df *p);

void
cir2d_addd(Cir2Dd *cir,
           const V2Dd *p);

void
Cir2D::add(Cir2D *cir,
           const V2D *p);
cir

The circle.

p

The point to include.


cir2d_addn ()

Expand the dimensions of the circle to accommodate multiple points. It is equivalent to calling successively the cir2d_addf method.

void
cir2d_addnf(Cir2Df *cir,
            const V2Df *p,
            const uint32_t n);

void
cir2d_addnd(Cir2Dd *cir,
            const V2Dd *p,
            const uint32_t n);

void
Cir2D::addn(Cir2D *cir,
            const V2D *p,
            const uint32_t n);
cir

The circle.

p

Vector of points to include.

n

Number of points.


cir2d_add_box ()

Expand the dimensions of the circle to accommodate a 2D box.

void
cir2d_add_boxf(Cir2Df *cir,
               const B2D *box);

void
cir2d_add_boxd(Cir2Dd *cir,
               const B2D *box);

void
Cir2D::add_box(Cir2D *cir,
               const B2D *box);
cir

The circle.

box

The box.


cir2d_merge ()

Expand the dimensions of the circle dest to contain the circle src.

void
cir2d_mergef(Cir2Df *dest,
             const Cir2Df *src);

void
cir2d_merged(Cir2Dd *dest,
             const Cir2Dd *src);

void
Cir2D::merge(Cir2D *dest,
             const Cir2D *src);
dest

The destiny circle.

src

The origin circle.

❮ Back
Next ❯