mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
add 'lighting-mode' entity property
This commit is contained in:
parent
507f32f1e5
commit
8911cded07
9 changed files with 61 additions and 18 deletions
|
|
@ -482,6 +482,7 @@ void Entities::render(
|
|||
if (eid.uid == fpsEntity) {
|
||||
continue;
|
||||
}
|
||||
const auto& def = eid.def;
|
||||
const auto& pos = transform.pos;
|
||||
const auto& size = transform.size;
|
||||
if (frustum && !frustum->isBoxVisible(pos - size, pos + size)) {
|
||||
|
|
@ -491,7 +492,13 @@ void Entities::render(
|
|||
const auto& rigConfig = skeleton.config;
|
||||
if (rigConfig) {
|
||||
rigConfig->render(
|
||||
assets, batch, skeleton, transform.rot, pos, size
|
||||
assets,
|
||||
batch,
|
||||
skeleton,
|
||||
def.lightingMode,
|
||||
transform.rot,
|
||||
pos,
|
||||
size
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,4 +14,5 @@ void EntityDef::cloneTo(EntityDef& dst) {
|
|||
dst.elasticity = elasticity;
|
||||
dst.stepHeight = stepHeight;
|
||||
dst.save = save;
|
||||
dst.lightingMode = lightingMode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,10 +8,7 @@
|
|||
#include "data/dv.hpp"
|
||||
#include "maths/aabb.hpp"
|
||||
#include "physics/Hitbox.hpp"
|
||||
|
||||
namespace rigging {
|
||||
class SkeletonConfig;
|
||||
}
|
||||
#include "animation/rigging.hpp"
|
||||
|
||||
struct ComponentInstance {
|
||||
std::string component;
|
||||
|
|
@ -42,6 +39,9 @@ struct EntityDef {
|
|||
/// @brief Solid entity material material
|
||||
std::string material;
|
||||
|
||||
/// @brief Model lighting mode
|
||||
ModelLightingMode lightingMode = ModelLightingMode::BONE_BASED;
|
||||
|
||||
/// @brief Can the entity be interacted with cursor (on_attack, on_use)
|
||||
bool selectable = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue