载入中...
搜索中...
未找到
LSystemMesh.cpp
浏览该文件的文档.
24V3 cross(V3 a, V3 b) { return {a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x}; }
97 out.addVertex(points[i].x, points[i].y, points[i].z, normal.x, normal.y, normal.z, uv[i][0], uv[i][1]);
211 schema.params.push_back(ParamDescriptor::choice("leafMode", "Leaf Mode", "cards", {"cards", "none"}));
213 schema.params.push_back(ParamDescriptor::floating("angle", "Turn Angle", 22.f, 5.f, 90.f, 1.f));
214 schema.params.push_back(ParamDescriptor::floating("branchRadius", "Branch Radius", 0.16f, 0.005f, 5.f, 0.005f));
215 schema.params.push_back(ParamDescriptor::floating("radiusFalloff", "Radius Falloff", 0.62f, 0.05f, 1.f, 0.01f));
216 schema.params.push_back(ParamDescriptor::floating("leafSize", "Leaf Size", 0.4f, 0.02f, 10.f, 0.01f));
218 schema.params.push_back(ParamDescriptor::integer("branchSegments", "Branch Segments", 6, 3, 24));
219 schema.params.push_back(ParamDescriptor::integer("leavesPerMarker", "Leaves Per Marker", 1, 1, 8));
void setBranchRadiusFalloff(float factor)
Set the per-depth radius multiplier.
Definition LSystem.cpp:57
void generate(LSystemResult &out) const
Expand then interpret with the turtle.
Definition LSystem.cpp:231
void setTropism(float x, float y, float z)
Bias growth toward a direction (phototropism).
Definition LSystem.cpp:65
CPU triangle mesh from procedural mesh recipes (e.g. marching cubes). Positions/normals are xyz-packe...
Definition MeshBuild.h:19
void setMeta(const std::string &key, const std::string &value)
Sets the meta.
Definition MeshBuild.cpp:244
void registerRecipe(const std::string &id, MeshRecipeFn fn)
Register a recipe without metadata.
Definition MarchingCubes.cpp:456
std::vector< double > forward(const Policy &p, const Observation &o)
Forward.
Definition Learning.h:65
Definition EvpackPointGraphLoader.h:12
bool generateLSystemMesh(const Params ¶ms, MeshBuild &out, std::string &error)
Build a grammar-based tree/plant mesh from Params.
Definition LSystemMesh.cpp:147
void registerLSystemRecipes(MeshRecipeRegistry ®istry)
Register the mesh.lsystem grammar-based plant recipe.
Definition LSystemMesh.cpp:206
WidgetDesc card(std::vector< WidgetDesc > children, std::string id)
Bordered surface container with editor-friendly padding.
Definition Widget.cpp:502
WidgetDesc row(std::vector< WidgetDesc > children, std::string id)
Horizontal elastic layout row.
Definition Widget.cpp:679
Full result of expanding an L-system grammar and tracing the turtle.
Definition LSystem.h:31
One drawn segment produced by an L-system turtle.
Definition LSystem.h:20
static ParamDescriptor choice(std::string key, std::string label, std::string defaultValue, std::vector< std::string > choices)
Construct a finite-choice string descriptor.
Definition ParamSchema.cpp:65
static ParamDescriptor floating(std::string key, std::string label, float defaultValue, float minimum, float maximum, float step)
Construct a bounded floating-point descriptor.
Definition ParamSchema.cpp:33
static ParamDescriptor integer(std::string key, std::string label, int defaultValue, int minimum, int maximum, int step=1)
Construct a bounded integer descriptor.
Definition ParamSchema.cpp:19
Complete metadata and parameter schema shared by every procgen recipe family.
Definition ParamSchema.h:52
std::vector< ParamDescriptor > params
Definition ParamSchema.h:56