13using namespace Tempest;
30 std::lock_guard<std::recursive_mutex> guard(owner.sync);
31 bucket = &owner.getBucket(*decl);
38 auto& owner = world.
view()->pfxGroup;
41 if(decl==
nullptr || decl->visMaterial.tex==
nullptr)
43 std::lock_guard<std::recursive_mutex> guard(owner.sync);
44 bucket = &owner.getBucket(*decl);
47 else if(
auto decal =
dynamic_cast<const zenkit::VisualDecal*
>(vob.visual.get())) {
49 std::lock_guard<std::recursive_mutex> guard(owner.sync);
50 bucket = &owner.getBucket(mat,vob);
57 std::lock_guard<std::recursive_mutex> guard(bucket->
parent.sync);
63 :bucket(b.bucket), id(b.id), zone(std::move(b.zone)) {
68 std::swap(bucket,b.bucket);
70 std::swap(zone, b.zone);
81 std::lock_guard<std::recursive_mutex> guard(bucket->
parent.sync);
82 auto& v = bucket->
get(
id);
87 v.next->setPosition(pos);
88 if(v.block==
size_t(-1))
90 auto& p = bucket->getBlock(*
this);
97 std::lock_guard<std::recursive_mutex> guard(bucket->
parent.sync);
98 auto& v = bucket->
get(
id);
105 std::lock_guard<std::recursive_mutex> guard(bucket->
parent.sync);
106 auto& v = bucket->
get(
id);
107 v.
direction[0] = Vec3(d.at(0,0),d.at(0,1),d.at(0,2));
108 v.direction[1] = Vec3(d.at(1,0),d.at(1,1),d.at(1,2));
109 v.direction[2] = Vec3(d.at(2,0),d.at(2,1),d.at(2,2));
112 v.next->setDirection(d);
118 std::lock_guard<std::recursive_mutex> guard(bucket->
parent.sync);
119 auto& v = bucket->
get(
id);
125 v.next->setActive(act);
133 std::lock_guard<std::recursive_mutex> guard(bucket->
parent.sync);
134 auto& v = bucket->
get(
id);
141 std::lock_guard<std::recursive_mutex> guard(bucket->
parent.sync);
142 auto& v = bucket->
get(
id);
145 v.next->setLooped(loop);
151 std::lock_guard<std::recursive_mutex> guard(bucket->
parent.sync);
152 auto& v = bucket->
get(
id);
156 v.next->setMesh(mesh,pose);
160 std::lock_guard<std::recursive_mutex> guard(bucket->
parent.sync);
161 auto& v = bucket->
get(
id);
179 std::lock_guard<std::recursive_mutex> guard(bucket->
parent.sync);
180 auto& v = bucket->
get(
id);
181 if(v.block==
size_t(-1))
183 auto& b = bucket->block[v.block];
void setCallback(std::function< void(Npc &npc)> f)
void setPosition(const Tempest::Vec3 &p)
auto loadParticleFx(std::string_view name, bool relaxed=false) -> const ParticleFx *
const Tempest::Texture2d * tex
void setObjMatrix(const Tempest::Matrix4x4 &mt)
const PfxEmitterMesh * toMeshEmitter() const
uint64_t ppsCreateEmDelay
uint64_t effectPrefferedTime() const
const PfxEmitterMesh * shpMesh
void freeEmitter(size_t &id)
ImplEmitter & get(size_t id)
void setLooped(bool loop)
uint64_t effectPrefferedTime() const
void setObjMatrix(const Tempest::Matrix4x4 &mt)
void setPhysicsEnable(World &physic, std::function< void(Npc &npc)> cb)
void setMesh(const MeshObjects::Mesh *mesh, const Pose *pose)
void setDirection(const Tempest::Matrix4x4 &pos)
void setPosition(float x, float y, float z)
PfxEmitter & operator=(PfxEmitter &&b)
void setTarget(const Npc *tg)
MeshObjects::Mesh addView(std::string_view visual, int32_t headTex, int32_t teethTex, int32_t bodyColor)
bool hasExt(std::string_view s, const char *extIn)
Tempest::Vec3 direction[3]
const PfxEmitterMesh * mesh