Luanti 5.15.0-dev
 
Loading...
Searching...
No Matches
WieldMeshSceneNode Class Reference

#include <wieldmesh.h>

+ Inheritance diagram for WieldMeshSceneNode:
+ Collaboration diagram for WieldMeshSceneNode:

Public Member Functions

 WieldMeshSceneNode (scene::ISceneManager *mgr, s32 id=-1)
 
virtual ~WieldMeshSceneNode ()
 
void setExtruded (const TileDef &d0, const TileLayer &l0, const TileDef &d1, const TileLayer &l1, v3f wield_scale, ITextureSource *tsrc)
 
void setItem (const ItemStack &item, Client *client, bool check_wield_image=true)
 
void setColor (video::SColor color)
 
void setLightColorAndAnimation (video::SColor color, float animation_time)
 
scene::IMesh * getMesh ()
 
virtual void render ()
 
virtual const aabb3fgetBoundingBox () const
 

Private Member Functions

void setExtruded (video::ITexture *base, video::ITexture *overlay, v3f wield_scale)
 
void changeToMesh (scene::IMesh *mesh)
 

Private Attributes

scene::IMeshSceneNode * m_meshnode = nullptr
 
video::E_MATERIAL_TYPE m_material_type
 
bool m_anisotropic_filter
 
bool m_bilinear_filter
 
bool m_trilinear_filter
 
std::vector< ItemMeshBufferInfom_buffer_info
 
video::SColor m_base_color
 
std::vector< FrameSpecm_wield_image_frames
 
std::vector< FrameSpecm_wield_overlay_frames
 
const aabb3f m_bounding_box {{0, 0, 0}}
 
ShadowRendererm_shadow
 

Constructor & Destructor Documentation

◆ WieldMeshSceneNode()

WieldMeshSceneNode::WieldMeshSceneNode ( scene::ISceneManager * mgr,
s32 id = -1 )

References ShadowRenderer::addNodeToShadowList(), ExtrusionMeshCache::createCube(), g_extrusion_mesh_cache, g_settings, RenderingEngine::get_shadow_renderer(), Settings::getBool(), m_anisotropic_filter, m_bilinear_filter, m_meshnode, m_shadow, and m_trilinear_filter.

+ Here is the call graph for this function:

◆ ~WieldMeshSceneNode()

WieldMeshSceneNode::~WieldMeshSceneNode ( )
virtual

References g_extrusion_mesh_cache, m_meshnode, m_shadow, ShadowRenderer::removeNodeFromShadowList(), and sanity_check.

+ Here is the call graph for this function:

Member Function Documentation

◆ changeToMesh()

void WieldMeshSceneNode::changeToMesh ( scene::IMesh * mesh)
private

References ExtrusionMeshCache::createCube(), g_extrusion_mesh_cache, and m_meshnode.

Referenced by setExtruded(), and setItem().

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

◆ getBoundingBox()

virtual const aabb3f & WieldMeshSceneNode::getBoundingBox ( ) const
inlinevirtual

References m_bounding_box.

◆ getMesh()

scene::IMesh * WieldMeshSceneNode::getMesh ( )
inline

References m_meshnode.

◆ render()

void WieldMeshSceneNode::render ( )
virtual

◆ setColor()

void WieldMeshSceneNode::setColor ( video::SColor color)

References m_base_color, m_buffer_info, m_meshnode, and setMeshBufferColor().

Referenced by setItem().

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

◆ setExtruded() [1/2]

void WieldMeshSceneNode::setExtruded ( const TileDef & d0,
const TileLayer & l0,
const TileDef & d1,
const TileLayer & l1,
v3f wield_scale,
ITextureSource * tsrc )

References extractTexture(), m_buffer_info, and setExtruded().

Referenced by setExtruded(), and setItem().

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

◆ setExtruded() [2/2]

void WieldMeshSceneNode::setExtruded ( video::ITexture * base,
video::ITexture * overlay,
v3f wield_scale )
private

References changeToMesh(), cloneMeshBuffer(), cloneStaticMesh(), ExtrusionMeshCache::create(), g_extrusion_mesh_cache, m_anisotropic_filter, m_bilinear_filter, m_material_type, m_meshnode, m_trilinear_filter, setMaterialFilters(), TEXTURE_FILTER_MIN_SIZE, and WIELD_SCALE_FACTOR_EXTRUDED.

+ Here is the call graph for this function:

◆ setItem()

void WieldMeshSceneNode::setItem ( const ItemStack & item,
Client * client,
bool check_wield_image = true )

References ContentFeatures::alpha, ItemImageDef::animation, BS, changeToMesh(), createAnimationFrames(), createGenericNodeMesh(), ContentFeatures::drawtype, NodeDefManager::get(), getAdHocNodeShader(), ItemStack::getDefinition(), NodeDefManager::getId(), ItemVisualsManager::getInventoryAnimation(), ItemVisualsManager::getInventoryOverlayAnimation(), ItemVisualsManager::getInventoryOverlayTexture(), ItemVisualsManager::getInventoryTexture(), ItemVisualsManager::getItemstackColor(), IShaderSource::getShader(), IShaderSource::getShaderInfo(), ITextureSource::getTexture(), ItemStack::getWieldImage(), ItemStack::getWieldOverlay(), ItemStack::getWieldScale(), ITEM_NODE, TileSpec::layers, m_anisotropic_filter, m_base_color, m_bilinear_filter, m_buffer_info, m_material_type, m_meshnode, m_trilinear_filter, m_wield_image_frames, m_wield_overlay_frames, ShaderInfo::material, ItemDefinition::name, ItemImageDef::name, NDT_AIRLIKE, NDT_FLOWINGLIQUID, NDT_NORMAL, NDT_PLANTLIKE, NDT_PLANTLIKE_ROOTED, NDT_RAILLIKE, NDT_SIGNLIKE, NDT_TORCHLIKE, ItemDefinition::place_param2, setColor(), setExtruded(), setMaterialFilters(), MapNode::setParam2(), NodeVisuals::special_tiles, TILE_MATERIAL_BASIC, ContentFeatures::tiledef, ContentFeatures::tiledef_overlay, ContentFeatures::tiledef_special, NodeVisuals::tiles, ItemDefinition::type, ContentFeatures::visual_scale, and WIELD_SCALE_FACTOR.

Referenced by Camera::Camera(), GenericCAO::addToScene(), and Camera::step().

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

◆ setLightColorAndAnimation()

void WieldMeshSceneNode::setLightColorAndAnimation ( video::SColor color,
float animation_time )

References ItemMeshBufferInfo::animation_info, m_buffer_info, m_meshnode, and AnimationInfo::updateTexture().

Referenced by GenericCAO::setNodeLight(), Camera::step(), and Camera::update().

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

Member Data Documentation

◆ m_anisotropic_filter

bool WieldMeshSceneNode::m_anisotropic_filter
private

◆ m_base_color

video::SColor WieldMeshSceneNode::m_base_color
private

The base color of this mesh. This is the default for all mesh buffers.

Referenced by setColor(), and setItem().

◆ m_bilinear_filter

bool WieldMeshSceneNode::m_bilinear_filter
private

◆ m_bounding_box

const aabb3f WieldMeshSceneNode::m_bounding_box {{0, 0, 0}}
private

Referenced by getBoundingBox().

◆ m_buffer_info

std::vector<ItemMeshBufferInfo> WieldMeshSceneNode::m_buffer_info
private

Stores the colors and animation data of the mesh's mesh buffers. This does not include lighting.

Referenced by setColor(), setExtruded(), setItem(), and setLightColorAndAnimation().

◆ m_material_type

video::E_MATERIAL_TYPE WieldMeshSceneNode::m_material_type
private

Referenced by setExtruded(), and setItem().

◆ m_meshnode

scene::IMeshSceneNode* WieldMeshSceneNode::m_meshnode = nullptr
private

◆ m_shadow

ShadowRenderer* WieldMeshSceneNode::m_shadow
private

◆ m_trilinear_filter

bool WieldMeshSceneNode::m_trilinear_filter
private

◆ m_wield_image_frames

std::vector<FrameSpec> WieldMeshSceneNode::m_wield_image_frames
private

Referenced by setItem().

◆ m_wield_overlay_frames

std::vector<FrameSpec> WieldMeshSceneNode::m_wield_overlay_frames
private

Referenced by setItem().


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