载入中...
搜索中...
未找到
DecalCapabilities.cpp
浏览该文件的文档.
1#include "common/Capability.h"
2#include "common/DecalQuery.h"
3#include "decal/Decal.h"
5
6#include "graphics/Texture.h"
7
8#include <string>
9
10namespace eve::decal {
11namespace {
12
13class DecalQueryImpl final : public eve::IDecalQuery {
14public:
15 int project(float x, float y, float z, float nx, float ny, float nz, void *albedoTexture,
16 const std::string &kind, float size, float depth, bool randomYaw, int seed,
17 float fadeIn, float lifetime, float fadeOut) override {
19 x, y, z, nx, ny, nz, static_cast<graphics::Texture *>(albedoTexture), kind, size,
20 depth, randomYaw, seed, fadeIn, lifetime, fadeOut, 0.f, 0.f, 0.f, 0.f);
21 }
22
23 bool remove(int id) override { return DecalManager::inst().remove(id); }
24
25 void clearAll() override { DecalManager::inst().clearAll(); }
26
27 int count() override { return DecalManager::inst().count(); }
28
29 void setLimit(const std::string &kind, int limit) override {
31 }
32};
33
34} // namespace
35
37 static DecalQueryImpl impl;
38 eve::cap::provide<eve::IDecalQuery>(&impl);
40}
41
42} // namespace eve::decal
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
float z
Definition AnimClip.cpp:738
void * impl
float nx
float nz
float ny
TokenKind kind
std::weak_ptr< const void > lifetime
std::uint32_t seed
Definition PointSet.cpp:807
std::uint32_t count
int limit
Definition TreeMesh.cpp:164
float size
Definition TreeMesh.cpp:156
std::uint32_t depth
Runtime decal query surface (provided by the decal module).
Definition DecalQuery.h:17
static DecalManager & inst()
Inst.
void setLimit(const std::string &kind, int limit)
Per-kind quota ("blood" -> 64 etc.); oldest of the kind is evicted.
int count() const
Returns the number of .
bool remove(int id)
Removes .
int project(float x, float y, float z, float nx, float ny, float nz, graphics::Texture *albedo, const std::string &kind, float size, float depth, bool randomYaw, int seed, float fadeIn, float lifetime, float fadeOut, float normalStrength, float roughnessStrength, float metalStrength, float emissiveStrength)
Spawn a decal at a world-space point facing along (nx,ny,nz).
void registerDecalCapabilities()
Register the IDecalQuery capability (implemented in DecalCapabilities.cpp).
void registerDecalAttackVfxExecutor()
Register the AttackVfx Decal layer executor (soft-skips when Graphics is absent).
ssq::Table project(HSQUIRRELVM vm, const eve::Result< void > &result)
Project a completed editing result that has no payload.