Gamedev Framework (gf)  0.11.0
A C++14 framework for 2D games
Public Member Functions | List of all members
gf::CircleGeometry Class Reference

A circle physics geometry. More...

#include <gf/PhysicsGeometry.h>

Inheritance diagram for gf::CircleGeometry:
Inheritance graph

Public Member Functions

 CircleGeometry (float radius)
 Constructor. More...
 CircleGeometry (CircF circle)
 Constructor. More...
const CircFget () const
 Get the circle. More...
virtual float getArea () const override
 Compute the area of the geometry. More...
virtual CircF getBoundingCircle () const override
 Get a bouding circle. More...
virtual void renderAt (RenderTarget &target, const RenderStates &states, Vector2f position, float angle) const override
 Render the geometry. More...
- Public Member Functions inherited from gf::PhysicsGeometry
 PhysicsGeometry (Type type)
 Constructor. More...
virtual ~PhysicsGeometry ()
 Destructor. More...
Type getType () const
 Get the type of the geometry. More...

Additional Inherited Members

- Public Types inherited from gf::PhysicsGeometry
enum  Type {
 The type of geometry. More...

Detailed Description

A circle physics geometry.

Constructor & Destructor Documentation

◆ CircleGeometry() [1/2]

gf::CircleGeometry::CircleGeometry ( float  radius)


The geometry is centered in \( (0,0) \)

radiusThe radius of the circle

◆ CircleGeometry() [2/2]

gf::CircleGeometry::CircleGeometry ( CircF  circle)


circleThe base circle

Member Function Documentation

◆ get()

const CircF& gf::CircleGeometry::get ( ) const

Get the circle.

The current circle

◆ getArea()

virtual float gf::CircleGeometry::getArea ( ) const

Compute the area of the geometry.

The area in world units

Implements gf::PhysicsGeometry.

◆ getBoundingCircle()

virtual CircF gf::CircleGeometry::getBoundingCircle ( ) const

Get a bouding circle.

The circle may not be the minimum bouding circle.

A bounding circle

Implements gf::PhysicsGeometry.

◆ renderAt()

virtual void gf::CircleGeometry::renderAt ( RenderTarget target,
const RenderStates states,
Vector2f  position,
float  angle 
) const

Render the geometry.

targetThe render target
statesThe render states to use for drawing
positionThe position of the geometry
angleThe angle of the geometry

Implements gf::PhysicsGeometry.