载入中...
搜索中...
未找到
MeshDeformationGeometry.cpp
浏览该文件的文档.
28void addFace(MeshBuild& mesh, float ax, float ay, float az, float bx, float by, float bz, float cx, float cy, float cz,
46 if (sx < 1 || sx > 1024 || sz < 1 || sz > 1024 || !std::isfinite(width) || !std::isfinite(depth) ||
47 !std::isfinite(curvature) || width <= 0.f || depth <= 0.f || (sx + 1LL) * (sz + 1LL) > 1000000LL) {
65 addFace(output, a[0], a[1], a[2], d[0], d[1], d[2], c[0], c[1], c[2], b[0], b[1], b[2], 0.f, 1.f, 0.f);
90 const float radius = params.getFloat("radius", 0.5f), randomHeight = params.getFloat("randomHeight", 0.f);
92 const bool planar = params.getBool("planar", false), flipFaces = params.getBool("flipFaces", false);
93 if (width < 1 || width > 256 || height < 1 || height > 256 || !std::isfinite(radius) || radius <= 0.f ||
94 !std::isfinite(baseHeight) || !std::isfinite(randomHeight) || baseHeight < 0.f || randomHeight < 0.f) {
103 const float cz = radius * 1.73205080757f * (static_cast<float>(row) + (column & 1 ? 0.5f : 0.f));
104 const float h = planar ? 0.f : baseHeight + randomHeight * hash01(seed + row * 4099u + column * 131u);
131 plane.params.push_back(ParamDescriptor::floating("width", "Width", 4.f, 0.01f, 10000.f, 0.01f));
132 plane.params.push_back(ParamDescriptor::floating("depth", "Depth", 4.f, 0.01f, 10000.f, 0.01f));
135 plane.params.push_back(ParamDescriptor::floating("curvature", "Curvature", 0.f, -1000.f, 1000.f, 0.01f));
142 hex.params.push_back(ParamDescriptor::floating("radius", "Radius", 0.5f, 0.01f, 1000.f, 0.01f));
143 hex.params.push_back(ParamDescriptor::floating("height", "Base Height", 0.2f, 0.f, 1000.f, 0.01f));
144 hex.params.push_back(ParamDescriptor::floating("randomHeight", "Random Height", 0.f, 0.f, 1000.f, 0.01f));
void registerRecipe(const std::string &id, MeshRecipeFn fn)
Register a recipe without metadata.
Definition MarchingCubes.cpp:456
Definition EvpackPointGraphLoader.h:12
void registerMeshDeformationGeometryRecipes(MeshRecipeRegistry ®istry)
Register the extended-plane and customizable hex-grid mesh recipes.
Definition MeshDeformationGeometry.cpp:129
WidgetDesc row(std::vector< WidgetDesc > children, std::string id)
Horizontal elastic layout row.
Definition Widget.cpp:679
static ParamDescriptor boolean(std::string key, std::string label, bool defaultValue)
Construct a Boolean descriptor stored as zero or one in Params.
Definition ParamSchema.cpp:47
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