Workspace 6.21.5
Public Member Functions | List of all members
RodMesher Class Reference

Creates a mesh for a rod. More...

#include <Rendering/SceneComponents/Models/rodmesher.h>

Public Member Functions

Mesh::Vector3d baseModelDirection () const
 
bool meshRod (double radius, double halfLength, double tipLength, int levelOfDetail, Mesh::MeshModelInterface &model, bool generateHemisphericalCaps=true, bool includeTipsInLength=false)
 

Detailed Description

Create a mesh of a rod, which is essentially a long cylinder with hemispherical caps at the end. Its shape is determined by the following parameters:

The mesher does not presently support the addition of texture coordinates.

Member Function Documentation

◆ baseModelDirection()

Vector3d baseModelDirection ( ) const

◆ meshRod()

bool meshRod ( double  radius,
double  halfLengthIn,
double  tipLengthIn,
int  levelOfDetail,
Mesh::MeshModelInterface model,
bool  generateHemisphericalCaps = true,
bool  includeTipsInLength = false 
)
Parameters
radiusThe radius of the cylinder, and the hemispherical domes at each end.
halfLengthInHalf the length of the cylinder in the z-dimension, excluding one of the hemispherical domes. 2 * halfLength == totalCylinderLength (excluding hemispherical domes)
tipLengthInThe tip length
levelOfDetailControls the number of elements in the mesh. Increases exponentially.
modelThe model to generate the mesh data inside.
generateHemisphericalCapsIf true (default), the rods will be capped with hemispheres
includeTipsInLengthIf true, the distance between the tips / caps of the rod glypher will be the length. If false, the distance between the ends of the cylinder part will be the length.
Returns
true if successful, false if one of the parameters was incorrect.

Generates a rod mesh in the target mesh model using the input radius, halfLength and level-of-detail.