载入中...
搜索中...
未找到
VegetationMotion.h
浏览该文件的文档.
1#pragma once
2#include <glm/mat4x4.hpp>
3#include <glm/vec2.hpp>
4#include <glm/vec3.hpp>
5#include <glm/vec4.hpp>
6#include <optional>
7#include <span>
8#include <vector>
9#include "common/Export.h"
10#include "common/Result.h"
12
13namespace eve::graphics {
16
22 glm::vec3 position{0.f}, normal{0.f, 1.f, 0.f}, pivot{0.f};
23 float bending = 0.f, branch = 0.f, flutter = 0.f;
24 float variation = 0.5f, occlusion = 1.f, detail = 0.f;
25 float boundsHeight = 1.f, boundsRadius = 1.f;
26 glm::vec2 texcoord{0.f}, secondaryTexcoord{0.f}, detailCoord{0.f};
28 std::optional<glm::vec4> tangent;
29};
30
39 double time = 0.;
40 double timeScale = 1., timeOffset = 0.;
41 float timeOverride = 0.f;
42 glm::mat4 objectToWorld{1.f};
43 glm::vec3 camera{0.f}, worldOrigin{0.f};
45 bool usePivots = true;
46 float dynamicMode = 0.f, rigidity = 0.5f, facing = 0.5f;
47 float bending = 0.2f, bendingSpeed = 2.f, bendingScale = 1.f, bendingVariation = 0.f;
48 float branch = 0.2f, rolling = 0.2f, branchSpeed = 6.f, branchScale = 3.f, branchVariation = 0.f;
49 float flutter = 0.2f, flutterSpeed = 20.f, flutterScale = 10.f, flutterVariation = 0.f;
50 float globalBending = 1.f, globalBranch = 1.f, globalFlutter = 1.f, noiseTiling = 1.f;
51 float interaction = 1.f, interactionMask = 1.f, fadeDistance = 100.f;
52 float globalSize = 1.f, sizeFadeStart = 1000000.f, sizeFadeEnd = 1000001.f, distanceFadeBias = 1.f;
54 uint8_t motionLayer = 0, vertexLayer = 0;
56 2,
57 {glm::vec4(0.2f, 0.7f, 0.85f, 1.f), glm::vec4(0.8f, 0.4f, 0.55f, 1.f),
59 glm::vec4(0.4f, 0.2f, 0.65f, 1.f), glm::vec4(0.7f, 0.8f, 1.f, 1.f)}};
60};
61
64 std::vector<float> positions, normals;
66 std::vector<float> vegetationFactors;
73 std::vector<float> motionHighlights;
75 std::vector<float> tangents, bitangents;
76};
77
87 const VegetationField& field, std::span<const VegetationVertex> vertices, const VegetationMotion& motion);
88} // namespace eve::graphics
#define EVENGINE_API_BACKENDS
Definition Export.h:108
std::vector< Point > vertices
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Backend-independent, owning vegetation influence field. Single writer; concurrent const evaluation is...
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
VegetationBatchMode
Object mode rotates around pivots; batched mode uses height-scaled offsets.
Result< VegetationGeometry > deformVegetation(const VegetationField &field, std::span< const VegetationVertex > vertices, const VegetationMotion &motion)
Evaluate plant bending, squash, rolling, flutter, interaction and perspective. Worker-safe with immut...
Owning geometry projection, packed world XYZ positions and unit normals.
std::vector< float > vegetationFactors
Interleaved variation, occlusion, detail mask and detail UV, five floats per vertex.
std::vector< float > motionHighlights
Owning per-rest-vertex motion highlight scalar, parallel to positions/3. Evaluated before raster inte...
std::vector< float > tangents
Owning deformed world XYZ frame streams; both empty when source tangents are absent.
Owning linear RGBA mask, sampled bilinearly with clamped addressing.
Source-equivalent plant motion parameters with explicit time and texture inputs. All data is owned....
Owning rest vertex in object space, with unpacked authoring channels. Bending/branch/flutter/variatio...
std::optional< glm::vec4 > tangent
Optional authored tangent XYZ plus signed unit handedness; all vertices agree on presence.