Luanti 5.15.0-dev
 
Loading...
Searching...
No Matches
wieldmesh.h File Reference
#include <string>
#include <vector>
#include "irr_aabb3d.h"
#include "irr_v3d.h"
#include <EMaterialTypes.h>
#include <IMeshSceneNode.h>
#include <SColor.h>
#include <memory>
#include "tile.h"
#include "nodedef.h"
+ Include dependency graph for wieldmesh.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ItemMeshBufferInfo
 
struct  ItemMesh
 
class  WieldMeshSceneNode
 

Namespaces

namespace  scene
 

Functions

std::vector< FrameSpeccreateAnimationFrames (ITextureSource *tsrc, const std::string &image_name, const TileAnimationParams &animation, int &result_frame_length_ms)
 
scene::SMesh * getExtrudedMesh (video::ITexture *texture, video::ITexture *overlay_texture=nullptr)
 
void getAdHocNodeShader (video::SMaterial &mat, IShaderSource *shdsrc, const char *shader, AlphaMode mode, int layer)
 Replace the material's shader with a custom one while respecting the usual things expected of node rendering (texture type, alpha mode, overlay).
 
void createItemMesh (Client *client, const ItemDefinition &def, const AnimationInfo &animation_normal, const AnimationInfo &animation_overlay, ItemMesh *result)
 NOTE: The item mesh is only suitable for inventory rendering (due to its material types).
 

Function Documentation

◆ createAnimationFrames()

std::vector< FrameSpec > createAnimationFrames ( ITextureSource * tsrc,
const std::string & image_name,
const TileAnimationParams & animation,
int & result_frame_length_ms )

References TileAnimationParams::determineParams(), ITextureSource::getTextureDimensions(), ITextureSource::getTextureForMesh(), TileAnimationParams::getTextureModifer(), TAT_NONE, and TileAnimationParams::type.

Referenced by ItemVisualsManager::createItemVisuals(), fillTileAttribs(), and WieldMeshSceneNode::setItem().

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

◆ createItemMesh()

void createItemMesh ( Client * client,
const ItemDefinition & def,
const AnimationInfo & animation_normal,
const AnimationInfo & animation_overlay,
ItemMesh * result )

NOTE: The item mesh is only suitable for inventory rendering (due to its material types).

In-world rendering of items must go through WieldMeshSceneNode.

References ContentFeatures::alpha, ItemMesh::buffer_info, createGenericNodeMesh(), ContentFeatures::drawtype, extractTexture(), FATAL_ERROR_IF, g_extrusion_mesh_cache, NodeDefManager::get(), getAdHocNodeShader(), getExtrudedMesh(), NodeDefManager::getId(), AnimationInfo::getTexture(), ITextureSource::getTexture(), ITEM_NODE, TileSpec::layers, ItemMesh::mesh, ItemDefinition::name, NDT_AIRLIKE, NDT_PLANTLIKE, NDT_PLANTLIKE_ROOTED, ItemMesh::needs_shading, ItemDefinition::place_param2, rotateMeshXZby(), rotateMeshYZby(), scaleMesh(), MapNode::setParam2(), NodeVisuals::special_tiles, ContentFeatures::tiledef, ContentFeatures::tiledef_special, NodeVisuals::tiles, and ItemDefinition::type.

Referenced by ItemVisualsManager::createItemVisuals().

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

◆ getAdHocNodeShader()

void getAdHocNodeShader ( video::SMaterial & mat,
IShaderSource * shdsrc,
const char * shader,
AlphaMode mode,
int layer )

Replace the material's shader with a custom one while respecting the usual things expected of node rendering (texture type, alpha mode, overlay).

Call this after TileLayer::applyMaterialOptions.

Parameters
matmaterial to modify
shdsrcshader source
shadername of shader
modealpha mode from nodedef
layerindex of this layer

References alpha_mode_to_material_type(), IShaderSource::getShader(), IShaderSource::getShaderInfo(), ShaderInfo::material, material_type_with_alpha(), and NDT_NORMAL.

Referenced by createItemMesh(), generateNodeMesh(), and WieldMeshSceneNode::setItem().

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

◆ getExtrudedMesh()

scene::SMesh * getExtrudedMesh ( video::ITexture * texture,
video::ITexture * overlay_texture = nullptr )

References cloneMeshBuffer(), cloneStaticMesh(), ExtrusionMeshCache::create(), g_extrusion_mesh_cache, and scaleMesh().

Referenced by createItemMesh().

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