Luanti 5.16.0-dev
Loading...
Searching...
No Matches
mesh.h File Reference
Include dependency graph for mesh.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  scene
namespace  video

Functions

void applyFacesShading (video::SColor &color, v3f normal)
scene::IAnimatedMesh * createCubeMesh (v3f scale)
void scaleMesh (scene::IMesh *mesh, v3f scale)
void translateMesh (scene::IMesh *mesh, v3f vec)
void setMeshBufferColor (scene::IMeshBuffer *buf, video::SColor color)
void setMeshColor (scene::IMesh *mesh, video::SColor color)
void colorizeMeshBuffer (scene::IMeshBuffer *buf, video::SColor buf_color, f32 ambient_light, v3f dir_light)
void setMeshColorByNormalXYZ (scene::IMesh *mesh, video::SColor colorX, video::SColor colorY, video::SColor colorZ)
void setMeshColorByNormal (scene::IMesh *mesh, v3f normal, video::SColor color)
void rotateMeshBy6dFacedir (scene::IMesh *mesh, u8 facedir)
void rotateMeshXYby (scene::IMesh *mesh, f64 degrees)
void rotateMeshXZby (scene::IMesh *mesh, f64 degrees)
void rotateMeshYZby (scene::IMesh *mesh, f64 degrees)
scene::IMeshBuffer * cloneMeshBuffer (scene::IMeshBuffer *mesh_buffer)
scene::SMesh * cloneStaticMesh (scene::IMesh *src_mesh)
 Clone a mesh. For an animated mesh, this will clone the static pose.
scene::IMesh * convertNodeboxesToMesh (const std::vector< aabb3f > &boxes, const f32 *uv_coords=nullptr, f32 expand=0)
void recalculateBoundingBox (scene::IMesh *src_mesh)
bool checkMeshNormals (scene::IMesh *mesh)
void setMaterialFilters (video::SMaterialLayer &tex, bool bilinear, bool trilinear, bool anisotropic)

Function Documentation

◆ applyFacesShading()

void applyFacesShading ( video::SColor & color,
v3f normal )

Applies shading to a color based on the surface's normal vector.

References applyShadeFactor().

Referenced by MapblockMeshGenerator::blendLightColor(), MapblockMeshGenerator::drawAutoLightedCuboid(), MapblockMeshGenerator::drawMeshNode(), MapblockMeshGenerator::drawQuad(), and MapblockMeshGenerator::drawSolidNode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkMeshNormals()

bool checkMeshNormals ( scene::IMesh * mesh)

Referenced by GenericCAO::addToScene(), and NodeVisuals::updateMesh().

Here is the caller graph for this function:

◆ cloneMeshBuffer()

scene::IMeshBuffer * cloneMeshBuffer ( scene::IMeshBuffer * mesh_buffer)

References cloneMeshBuffer(), and sanity_check.

Here is the call graph for this function:

◆ cloneStaticMesh()

scene::SMesh * cloneStaticMesh ( scene::IMesh * src_mesh)

Clone a mesh. For an animated mesh, this will clone the static pose.

References cloneMeshBuffer().

Referenced by MapblockMeshGenerator::drawMeshNode(), getExtrudedMesh(), WieldMeshSceneNode::setExtruded(), and NodeVisuals::updateMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ colorizeMeshBuffer()

void colorizeMeshBuffer ( scene::IMeshBuffer * buf,
video::SColor buf_color,
f32 ambient_light,
v3f dir_light )

Overwrites the color of a mesh buffer. The color is darkened based on the normal vector of the vertices and the given directional light source + ambient light.

References applyShadeFactor(), and applyToMeshBuffer().

Referenced by drawItemStack().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ convertNodeboxesToMesh()

scene::IMesh * convertNodeboxesToMesh ( const std::vector< aabb3f > & boxes,
const f32 * uv_coords = nullptr,
f32 expand = 0 )

References BS.

Referenced by Hud::updateSelectionMesh().

Here is the caller graph for this function:

◆ createCubeMesh()

scene::IAnimatedMesh * createCubeMesh ( v3f scale)

References scaleMesh().

Referenced by ExtrusionMeshCache::ExtrusionMeshCache(), and GenericCAO::addToScene().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ recalculateBoundingBox()

void recalculateBoundingBox ( scene::IMesh * src_mesh)

Referenced by MapblockMeshGenerator::drawMeshNode(), and NodeVisuals::updateMesh().

Here is the caller graph for this function:

◆ rotateMeshBy6dFacedir()

void rotateMeshBy6dFacedir ( scene::IMesh * mesh,
u8 facedir )

References rotateMeshXYby(), rotateMeshXZby(), and rotateMeshYZby().

Referenced by MapblockMeshGenerator::drawMeshNode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotateMeshXYby()

void rotateMeshXYby ( scene::IMesh * mesh,
f64 degrees )

References rotateMesh().

Referenced by rotateMeshBy6dFacedir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotateMeshXZby()

void rotateMeshXZby ( scene::IMesh * mesh,
f64 degrees )

References rotateMesh().

Referenced by createItemMesh(), MapblockMeshGenerator::drawMeshNode(), and rotateMeshBy6dFacedir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotateMeshYZby()

void rotateMeshYZby ( scene::IMesh * mesh,
f64 degrees )

References rotateMesh().

Referenced by createItemMesh(), and rotateMeshBy6dFacedir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scaleMesh()

void scaleMesh ( scene::IMesh * mesh,
v3f scale )

References applyToMeshBuffer().

Referenced by createCubeMesh(), createExtrusionMesh(), createItemMesh(), getExtrudedMesh(), and NodeVisuals::updateMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMaterialFilters()

void setMaterialFilters ( video::SMaterialLayer & tex,
bool bilinear,
bool trilinear,
bool anisotropic )

Referenced by ClientMap::renderMap(), WieldMeshSceneNode::setExtruded(), WieldMeshSceneNode::setItem(), and setMaterialTextureAndFilters().

Here is the caller graph for this function:

◆ setMeshBufferColor()

void setMeshBufferColor ( scene::IMeshBuffer * buf,
video::SColor color )

Sets a constant color for all vertices in the mesh buffer.

References applyToMeshBuffer().

Referenced by drawItemStack(), WieldMeshSceneNode::setColor(), and setMeshColor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMeshColor()

void setMeshColor ( scene::IMesh * mesh,
video::SColor color )

References setMeshBufferColor().

Referenced by GenericCAO::addToScene(), Hud::drawSelectionMesh(), and GenericCAO::updateTextures().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMeshColorByNormal()

void setMeshColorByNormal ( scene::IMesh * mesh,
v3f normal,
video::SColor color )

References applyToMesh().

Referenced by Hud::drawSelectionMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMeshColorByNormalXYZ()

void setMeshColorByNormalXYZ ( scene::IMesh * mesh,
video::SColor colorX,
video::SColor colorY,
video::SColor colorZ )

References applyToMesh(), x, y, and z.

Here is the call graph for this function:

◆ translateMesh()

void translateMesh ( scene::IMesh * mesh,
v3f vec )

References applyToMeshBuffer().

Here is the call graph for this function: