Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
nodedef.cpp File Reference
#include "nodedef.h"
#include "itemdef.h"
#include "log.h"
#include "settings.h"
#include "nameidmapping.h"
#include "util/numeric.h"
#include "util/serialize.h"
#include "util/string.h"
#include "exceptions.h"
#include "debug.h"
#include "gamedef.h"
#include "mapnode.h"
#include <fstream>
#include <algorithm>
#include <cmath>
+ Include dependency graph for nodedef.cpp:

Macros

#define WRITEBOX(box)
 
#define READBOXES(box)
 
#define TILE_FLAG_BACKFACE_CULLING   (1 << 0)
 
#define TILE_FLAG_TILEABLE_HORIZONTAL   (1 << 1)
 
#define TILE_FLAG_TILEABLE_VERTICAL   (1 << 2)
 
#define TILE_FLAG_HAS_COLOR   (1 << 3)
 
#define TILE_FLAG_HAS_SCALE   (1 << 4)
 
#define TILE_FLAG_HAS_ALIGN_STYLE   (1 << 5)
 

Functions

void boxVectorUnion (const std::vector< aabb3f > &boxes, aabb3f *box_union)
 
void getNodeBoxUnion (const NodeBox &nodebox, const ContentFeatures &features, aabb3f *box_union)
 
NodeDefManagercreateNodeDefManager ()
 
static void removeDupes (std::vector< content_t > &list)
 

Macro Definition Documentation

◆ READBOXES

#define READBOXES ( box)
Value:
{ \
count = readU16(is); \
(box).reserve(count); \
while (count--) { \
v3f min = readV3F32(is); \
v3f max = readV3F32(is); \
(box).emplace_back(min, max); }; }
core::vector3df v3f
Definition irr_v3d.h:11
u16 readU16(const u8 *data)
Definition serialize.h:108
v3f readV3F32(const u8 *data)
Definition serialize.h:266

Referenced by NodeBox::deSerialize().

◆ TILE_FLAG_BACKFACE_CULLING

#define TILE_FLAG_BACKFACE_CULLING   (1 << 0)

◆ TILE_FLAG_HAS_ALIGN_STYLE

#define TILE_FLAG_HAS_ALIGN_STYLE   (1 << 5)

◆ TILE_FLAG_HAS_COLOR

#define TILE_FLAG_HAS_COLOR   (1 << 3)

◆ TILE_FLAG_HAS_SCALE

#define TILE_FLAG_HAS_SCALE   (1 << 4)

◆ TILE_FLAG_TILEABLE_HORIZONTAL

#define TILE_FLAG_TILEABLE_HORIZONTAL   (1 << 1)

◆ TILE_FLAG_TILEABLE_VERTICAL

#define TILE_FLAG_TILEABLE_VERTICAL   (1 << 2)

◆ WRITEBOX

#define WRITEBOX ( box)
Value:
writeU16(os, (box).size()); \
for (const aabb3f &i: (box)) { \
writeV3F32(os, i.MinEdge); \
writeV3F32(os, i.MaxEdge); \
};
core::aabbox3d< f32 > aabb3f
Definition irr_aabb3d.h:11
void writeU16(u8 *data, u16 i)
Definition serialize.h:130

Referenced by NodeBox::serialize().

Function Documentation

◆ boxVectorUnion()

void boxVectorUnion ( const std::vector< aabb3f > & boxes,
aabb3f * box_union )

Returns the smallest box that contains all boxes in the vector. Box_union is expanded.

Parameters
[in]boxesthe vector containing the boxes
[in,out]box_unionthe union of the arguments

Referenced by getNodeBoxUnion().

+ Here is the caller graph for this function:

◆ createNodeDefManager()

NodeDefManager * createNodeDefManager ( )

Referenced by Game::init().

+ Here is the caller graph for this function:

◆ getNodeBoxUnion()

void getNodeBoxUnion ( const NodeBox & nodebox,
const ContentFeatures & features,
aabb3f * box_union )

Returns a box that contains the nodebox in every case. The argument node_union is expanded.

Parameters
[in]nodeboxthe nodebox to be measured
[in]featuresused to decide whether the nodebox can be rotated
[in,out]box_unionthe union of the arguments

References boxVectorUnion(), BS, CPT2_4DIR, CPT2_COLORED_4DIR, CPT2_COLORED_FACEDIR, CPT2_FACEDIR, NodeBox::fixed, NodeBox::getConnected(), NODEBOX_CONNECTED, NODEBOX_FIXED, NODEBOX_LEVELED, NODEBOX_WALLMOUNTED, ContentFeatures::param_type_2, NodeBox::type, NodeBox::wall_bottom, NodeBox::wall_side, and NodeBox::wall_top.

Referenced by NodeDefManager::deSerialize(), and NodeDefManager::set().

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

◆ removeDupes()

static void removeDupes ( std::vector< content_t > & list)
static

Referenced by NodeDefManager::resolveCrossrefs().

+ Here is the caller graph for this function: