Loading...
Searching...
No Matches
juce::Box2DRenderer Class Reference

## Detailed Description

A simple implementation of the b2Draw class, used to draw a Box2D world.

To use it, simply create an instance of this class in your paint() method, and call its render() method.

The documentation for this class was generated from the following file:

- juce_box2d/utils/juce_Box2DRenderer.h

Inherits b2Draw.

## Public Member Functions

| Box2DRenderer () noexcept
void | render (Graphics &g, b2World &world, float box2DWorldLeft, float box2DWorldTop, float box2DWorldRight, float box2DWorldBottom, const Rectangle< float > &targetArea)
| Renders the world.
void | DrawPolygon (const b2Vec2 *, int32, const b2Color &) override
void | DrawSolidPolygon (const b2Vec2 *, int32, const b2Color &) override
void | DrawCircle (const b2Vec2 &center, float32 radius, const b2Color &) override
void | DrawSolidCircle (const b2Vec2 &center, float32 radius, const b2Vec2 &axis, const b2Color &) override
void | DrawSegment (const b2Vec2 &p1, const b2Vec2 &p2, const b2Color &) override
void | DrawTransform (const b2Transform &xf) override
virtual Colour | getColour (const b2Color &) const
| Converts a b2Color to a juce Colour.
virtual float | getLineThickness () const
| Returns the thickness to use for drawing outlines.

## Protected Attributes

Graphics * | graphics

## Constructors and Destructors

## Box2DRenderer()

juce::Box2DRenderer::Box2DRenderer | ( |  | ) |

noexcept

## Member Functions

## render()

void juce::Box2DRenderer::render | ( | Graphics & | g,
|  | b2World & | world,
|  | float | box2DWorldLeft,
|  | float | box2DWorldTop,
|  | float | box2DWorldRight,
|  | float | box2DWorldBottom,
|  | const Rectangle< float > & | targetArea )

Renders the world.

Parameters

  g | the context to render into
  world | the world to render
  box2DWorldLeft | the left coordinate of the area of the world to be drawn
  box2DWorldTop | the top coordinate of the area of the world to be drawn
  box2DWorldRight | the right coordinate of the area of the world to be drawn
  box2DWorldBottom | the bottom coordinate of the area of the world to be drawn
  targetArea | the area within the target context onto which the source world rectangle should be mapped

References render().

Referenced by render().

## DrawPolygon()

void juce::Box2DRenderer::DrawPolygon | ( | const b2Vec2 * | ,
|  | int32 | ,
|  | const b2Color & | )

override

References DrawPolygon().

Referenced by DrawPolygon().

## DrawSolidPolygon()

void juce::Box2DRenderer::DrawSolidPolygon | ( | const b2Vec2 * | ,
|  | int32 | ,
|  | const b2Color & | )

override

References DrawSolidPolygon().

Referenced by DrawSolidPolygon().

## DrawCircle()

void juce::Box2DRenderer::DrawCircle | ( | const b2Vec2 & | center,
|  | float32 | radius,
|  | const b2Color & | )

override

References DrawCircle().

Referenced by DrawCircle().

## DrawSolidCircle()

void juce::Box2DRenderer::DrawSolidCircle | ( | const b2Vec2 & | center,
|  | float32 | radius,
|  | const b2Vec2 & | axis,
|  | const b2Color & | )

override

References DrawSolidCircle().

Referenced by DrawSolidCircle().

## DrawSegment()

void juce::Box2DRenderer::DrawSegment | ( | const b2Vec2 & | p1,
|  | const b2Vec2 & | p2,
|  | const b2Color & | )

override

References DrawSegment().

Referenced by DrawSegment().

## DrawTransform()

void juce::Box2DRenderer::DrawTransform | ( | const b2Transform & | xf | ) |

override

References DrawTransform().

Referenced by DrawTransform().

## getColour()

virtual Colour juce::Box2DRenderer::getColour | ( | const b2Color & |  | ) | const

virtual

Converts a b2Color to a juce Colour.

References getColour().

Referenced by getColour().

## getLineThickness()

virtual float juce::Box2DRenderer::getLineThickness | ( |  | ) | const

virtual

Returns the thickness to use for drawing outlines.

References getLineThickness().

Referenced by getLineThickness().

## Member Data Documentation

## graphics

Graphics* juce::Box2DRenderer::graphics

protected

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited