Raylib C++  1.0.0
Encapsulates the raylib library
Static Public Member Functions | List of all members
raylib::helper::draw::Draw3DHelper Class Reference

Helper class for drawing 3D shapes. More...

#include <Draw3DHelper.hpp>

Collaboration diagram for raylib::helper::draw::Draw3DHelper:
Collaboration graph

Static Public Member Functions

static void drawLine (const Vector3f &startPos, const Vector3f &endPos, const RlColor &color)
 Draw a line in 3D. More...
 
static void drawPoint (const Vector3f &position, const RlColor &color)
 Draw a point in 3D. More...
 
static void drawCircle (const Vector3f &center, const float &radius, const Vector3f &rotationAxis, const float &rotationAngle, const RlColor &color)
 Draw a circle in 3D. More...
 
static void drawTriangle3D (const Vector3f &v1, const Vector3f &v2, const Vector3f &v3, const RlColor &color)
 Draw a color-filled triangle (vertex in counter-clockwise order!) in 3D. More...
 
static void drawTriangleStrip3D (const std::vector< Vector3f > &points, const RlColor &color)
 Draw a triangle strip defined by points in 3D. More...
 
static void drawCube (const Vector3f &position, const float &width, const float &height, const float &length, const RlColor &color)
 Draw a cube in 3D. More...
 
static void drawCube (const Vector3f &position, const Vector3f &size, const RlColor &color)
 Draw a cube (Vector version) in 3D. More...
 
static void drawCubeWires (const Vector3f &position, const float &width, const float &height, const float &length, const RlColor &color)
 Draw cube wires in 3D. More...
 
static void drawCubeWires (const Vector3f &position, const Vector3f &size, const RlColor &color)
 Draw cube wires (Vector version) in 3D. More...
 
static void drawCubeTexture (const texture::RlTexture &texture, const Vector3f &position, const float &width, const float &height, const float &length, const RlColor &color)
 Draw cube textured in 3D. More...
 
static void drawCubeTextureRec (const texture::RlTexture &texture, const Rectangle &source, const Vector3f &position, const float &width, const float &height, const float &length, const RlColor &color)
 Draw cube with a region of a texture in 3D. More...
 
static void drawSphere (const Vector3f &centerPos, const float &radius, const RlColor &color)
 Draw a sphere in 3D. More...
 
static void drawSphere (const Vector3f &centerPos, const float &radius, const int &rings, const int &slices, const RlColor &color)
 Draw sphere with extended parameters in 3D. More...
 
static void drawSphereWires (const Vector3f &centerPos, const float &radius, const int &rings, const int &slices, const RlColor &color)
 Draw sphere wires in 3D. More...
 
static void drawCylinder (const Vector3f &position, const float &radiusTop, const float &radiusBottom, const float &height, const int &slices, const RlColor &color)
 Draw a cylinder/cone in 3D. More...
 
static void drawCylinder (const Vector3f &startPos, const Vector3f &endPos, const float &startRadius, const float &endRadius, const int &sides, const RlColor &color)
 Draw a cylinder with base at startPos and top at endPos in 3D. More...
 
static void drawCylinderWires (const Vector3f &position, const float &radiusTop, const float &radiusBottom, const float &height, const int &slices, const RlColor &color)
 Draw a cylinder/cone wires in 3D. More...
 
static void drawCylinderWires (const Vector3f &startPos, const Vector3f &endPos, const float &startRadius, const float &endRadius, const int &sides, const RlColor &color)
 Draw a cylinder wires with base at startPos and top at endPos in 3D. More...
 
static void drawPlane (const Vector3f &centerPos, const Vector2f &size, const RlColor &color)
 Draw a plane XZ in 3D. More...
 
static void drawRay (const Ray &ray, const RlColor &color)
 Draw a ray line. More...
 
static void drawGrid (const int &slices, const float &spacing)
 Draw a grid. More...
 
static void drawGrid (const Vector2i &size, const float &spacing)
 Draw a grid of size (width/height) with some spacing, centered on (0, 0, 0) More...
 
static void drawGrid (const Vector2i &size, const Vector3f &position, const float &spacing)
 Draw a grid of size (width/height) with some spacing, centered on position. More...
 
static void drawGrid (const Vector2i &size, const Vector3f &position, const float &spacing, const RlColor &color)
 Draw a grid of size (width/height) with some spacing, centered on position, with a color. More...
 
static void drawBoundingBox (const BoundingBox &box, const RlColor &color)
 Draw bounding box (wires) More...
 
static void drawBillboard (const RlCamera &camera, const texture::RlTexture &texture, const Vector3f &position, float size, const RlColor &tint)
 Draw a billboard texture. More...
 
static void drawBillboardRec (const RlCamera &camera, const texture::RlTexture &texture, const Rectangle &source, const Vector3f &position, const Vector2f &size, const RlColor &tint)
 Draw a billboard texture defined by source. More...
 
static void drawBillboardPro (const RlCamera &camera, const texture::RlTexture &texture, const Rectangle &source, const Vector3f &position, const Vector3f &up, const Vector2f &size, const Vector2f &origin, float rotation, const RlColor &tint)
 Draw a billboard texture defined by source and rotation. More...
 

Detailed Description

Helper class for drawing 3D shapes.

Member Function Documentation

◆ drawBillboard()

void raylib::helper::draw::Draw3DHelper::drawBillboard ( const RlCamera camera,
const texture::RlTexture texture,
const Vector3f position,
float  size,
const RlColor tint 
)
static

Draw a billboard texture.

Parameters
camerathe camera to use
texturethe texture to use
positionthe position of the billboard
sizethe size of the billboard
tintthe tint of the billboard
Here is the call graph for this function:

◆ drawBillboardPro()

void raylib::helper::draw::Draw3DHelper::drawBillboardPro ( const RlCamera camera,
const texture::RlTexture texture,
const Rectangle &  source,
const Vector3f position,
const Vector3f up,
const Vector2f size,
const Vector2f origin,
float  rotation,
const RlColor tint 
)
static

Draw a billboard texture defined by source and rotation.

Parameters
camerathe camera to use
texturethe texture to use
sourcethe source of the texture
positionthe position of the billboard
upthe up vector of the billboard
sizethe size of the billboard
originthe origin of the billboard
rotationthe rotation of the billboard
tintthe tint of the billboard
Here is the call graph for this function:

◆ drawBillboardRec()

void raylib::helper::draw::Draw3DHelper::drawBillboardRec ( const RlCamera camera,
const texture::RlTexture texture,
const Rectangle &  source,
const Vector3f position,
const Vector2f size,
const RlColor tint 
)
static

Draw a billboard texture defined by source.

Parameters
camerathe camera to use
texturethe texture to use
sourcethe source of the texture
positionthe position of the billboard
sizethe size of the billboard
tintthe tint of the billboard

◆ drawBoundingBox()

void raylib::helper::draw::Draw3DHelper::drawBoundingBox ( const BoundingBox &  box,
const RlColor color 
)
static

Draw bounding box (wires)

Parameters
boxto use
colorto use
Here is the call graph for this function:

◆ drawCircle()

void raylib::helper::draw::Draw3DHelper::drawCircle ( const Vector3f center,
const float &  radius,
const Vector3f rotationAxis,
const float &  rotationAngle,
const RlColor color 
)
static

Draw a circle in 3D.

Parameters
centerthe center of the circle
radiusthe radius of the circle
rotationAxisthe rotation axis of the circle
rotationAnglethe rotation angle of the circle
colorthe color of the circle
Here is the call graph for this function:

◆ drawCube() [1/2]

void raylib::helper::draw::Draw3DHelper::drawCube ( const Vector3f position,
const float &  width,
const float &  height,
const float &  length,
const RlColor color 
)
static

Draw a cube in 3D.

Parameters
positionthe position of the cube
widththe width of the cube
heightthe height of the cube
lengththe length of the cube
colorthe color of the cube
Here is the call graph for this function:

◆ drawCube() [2/2]

void raylib::helper::draw::Draw3DHelper::drawCube ( const Vector3f position,
const Vector3f size,
const RlColor color 
)
static

Draw a cube (Vector version) in 3D.

Parameters
positionthe position of the cube
sizethe size of the cube
colorthe color of the cube

◆ drawCubeTexture()

void raylib::helper::draw::Draw3DHelper::drawCubeTexture ( const texture::RlTexture texture,
const Vector3f position,
const float &  width,
const float &  height,
const float &  length,
const RlColor color 
)
static

Draw cube textured in 3D.

Parameters
texturethe texture of the cube
positionthe position of the cube
widththe width of the cube
heightthe height of the cube
lengththe length of the cube
colorthe color of the cube
Here is the call graph for this function:

◆ drawCubeTextureRec()

void raylib::helper::draw::Draw3DHelper::drawCubeTextureRec ( const texture::RlTexture texture,
const Rectangle &  source,
const Vector3f position,
const float &  width,
const float &  height,
const float &  length,
const RlColor color 
)
static

Draw cube with a region of a texture in 3D.

Parameters
texturethe texture of the cube
sourcethe source of the texture
positionthe position of the cube
widththe width of the cube
heightthe height of the cube
lengththe length of the cube
colorthe color of the cube
Here is the call graph for this function:

◆ drawCubeWires() [1/2]

void raylib::helper::draw::Draw3DHelper::drawCubeWires ( const Vector3f position,
const float &  width,
const float &  height,
const float &  length,
const RlColor color 
)
static

Draw cube wires in 3D.

Parameters
positionthe position of the cube
widththe width of the cube
heightthe height of the cube
lengththe length of the cube
colorthe color of the cube
Here is the call graph for this function:

◆ drawCubeWires() [2/2]

void raylib::helper::draw::Draw3DHelper::drawCubeWires ( const Vector3f position,
const Vector3f size,
const RlColor color 
)
static

Draw cube wires (Vector version) in 3D.

Parameters
positionthe position of the cube
sizethe size of the cube
colorthe color of the cube

◆ drawCylinder() [1/2]

void raylib::helper::draw::Draw3DHelper::drawCylinder ( const Vector3f position,
const float &  radiusTop,
const float &  radiusBottom,
const float &  height,
const int &  slices,
const RlColor color 
)
static

Draw a cylinder/cone in 3D.

Parameters
positionthe position of the cylinder/cone
radiusTopthe radius of the top of the cylinder/cone
radiusBottomthe radius of the bottom of the cylinder/cone
heightthe height of the cylinder/cone
slicesthe number of slices
colorthe color of the cylinder/cone
Here is the call graph for this function:

◆ drawCylinder() [2/2]

void raylib::helper::draw::Draw3DHelper::drawCylinder ( const Vector3f startPos,
const Vector3f endPos,
const float &  startRadius,
const float &  endRadius,
const int &  sides,
const RlColor color 
)
static

Draw a cylinder with base at startPos and top at endPos in 3D.

Parameters
startPosthe start position of the cylinder
endPosthe end position of the cylinder
startRadiusthe start radius of the cylinder
endRadiusthe end radius of the cylinder
sidesthe number of sides
colorthe color of the cylinder
Here is the call graph for this function:

◆ drawCylinderWires() [1/2]

void raylib::helper::draw::Draw3DHelper::drawCylinderWires ( const Vector3f position,
const float &  radiusTop,
const float &  radiusBottom,
const float &  height,
const int &  slices,
const RlColor color 
)
static

Draw a cylinder/cone wires in 3D.

Parameters
positionthe position of the cylinder/cone
radiusTopthe radius of the top of the cylinder/cone
radiusBottomthe radius of the bottom of the cylinder/cone
heightthe height of the cylinder/cone
slicesthe number of slices
colorthe color of the cylinder/cone
Here is the call graph for this function:

◆ drawCylinderWires() [2/2]

void raylib::helper::draw::Draw3DHelper::drawCylinderWires ( const Vector3f startPos,
const Vector3f endPos,
const float &  startRadius,
const float &  endRadius,
const int &  sides,
const RlColor color 
)
static

Draw a cylinder wires with base at startPos and top at endPos in 3D.

Parameters
startPosthe start position of the cylinder
endPosthe end position of the cylinder
startRadiusthe start radius of the cylinder
endRadiusthe end radius of the cylinder
sidesthe number of sides
colorthe color of the cylinder
Here is the call graph for this function:

◆ drawGrid() [1/4]

void raylib::helper::draw::Draw3DHelper::drawGrid ( const int &  slices,
const float &  spacing 
)
static

Draw a grid.

Parameters
slicesNumber of slices of the grid
spacingSpacing of the grid
Here is the caller graph for this function:

◆ drawGrid() [2/4]

void raylib::helper::draw::Draw3DHelper::drawGrid ( const Vector2i size,
const float &  spacing 
)
static

Draw a grid of size (width/height) with some spacing, centered on (0, 0, 0)

Parameters
sizethe size of the grid (width & height)
spacingthe spacing between each rect

◆ drawGrid() [3/4]

void raylib::helper::draw::Draw3DHelper::drawGrid ( const Vector2i size,
const Vector3f position,
const float &  spacing 
)
static

Draw a grid of size (width/height) with some spacing, centered on position.

Parameters
sizethe size of the grid (width & height)
positionthe position of the grid
spacingthe spacing between each rect

◆ drawGrid() [4/4]

void raylib::helper::draw::Draw3DHelper::drawGrid ( const Vector2i size,
const Vector3f position,
const float &  spacing,
const RlColor color 
)
static

Draw a grid of size (width/height) with some spacing, centered on position, with a color.

Parameters
sizethe size of the grid (width & height)
positionthe position of the grid
spacingthe spacing between each rect
colorthe color of the grid
Here is the call graph for this function:

◆ drawLine()

void raylib::helper::draw::Draw3DHelper::drawLine ( const Vector3f startPos,
const Vector3f endPos,
const RlColor color 
)
static

Draw a line in 3D.

Parameters
startPosthe start position of the line
endPosthe end position of the line
colorthe color of the line
Here is the call graph for this function:

◆ drawPlane()

void raylib::helper::draw::Draw3DHelper::drawPlane ( const Vector3f centerPos,
const Vector2f size,
const RlColor color 
)
static

Draw a plane XZ in 3D.

Parameters
centerPosthe center position of the plane
sizethe size of the plane
colorthe color of the plane
Here is the call graph for this function:

◆ drawPoint()

void raylib::helper::draw::Draw3DHelper::drawPoint ( const Vector3f position,
const RlColor color 
)
static

Draw a point in 3D.

Parameters
positionthe position of the point
colorthe color of the point
Here is the call graph for this function:

◆ drawRay()

void raylib::helper::draw::Draw3DHelper::drawRay ( const Ray &  ray,
const RlColor color 
)
static

Draw a ray line.

Parameters
raythe ray to draw
colorthe color of the ray
Here is the call graph for this function:

◆ drawSphere() [1/2]

void raylib::helper::draw::Draw3DHelper::drawSphere ( const Vector3f centerPos,
const float &  radius,
const int &  rings,
const int &  slices,
const RlColor color 
)
static

Draw sphere with extended parameters in 3D.

Parameters
centerPosthe center position of the sphere
radiusthe radius of the sphere
ringsthe number of rings
slicesthe number of slices
colorthe color of the sphere
Here is the call graph for this function:

◆ drawSphere() [2/2]

void raylib::helper::draw::Draw3DHelper::drawSphere ( const Vector3f centerPos,
const float &  radius,
const RlColor color 
)
static

Draw a sphere in 3D.

Parameters
centerPosthe center position of the sphere
radiusthe radius of the sphere
colorthe color of the sphere

◆ drawSphereWires()

void raylib::helper::draw::Draw3DHelper::drawSphereWires ( const Vector3f centerPos,
const float &  radius,
const int &  rings,
const int &  slices,
const RlColor color 
)
static

Draw sphere wires in 3D.

Parameters
centerPosthe center position of the sphere
radiusthe radius of the sphere
ringsthe number of rings
slicesthe number of slices
colorthe color of the sphere
Here is the call graph for this function:

◆ drawTriangle3D()

void raylib::helper::draw::Draw3DHelper::drawTriangle3D ( const Vector3f v1,
const Vector3f v2,
const Vector3f v3,
const RlColor color 
)
static

Draw a color-filled triangle (vertex in counter-clockwise order!) in 3D.

Parameters
v1the first vertex of the triangle
v2the second vertex of the triangle
v3the third vertex of the triangle
colorthe color of the triangle
Here is the call graph for this function:

◆ drawTriangleStrip3D()

void raylib::helper::draw::Draw3DHelper::drawTriangleStrip3D ( const std::vector< Vector3f > &  points,
const RlColor color 
)
static

Draw a triangle strip defined by points in 3D.

Parameters
pointsthe points of the triangle strip
colorthe color of the triangle strip
Here is the call graph for this function:

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