Make tangible.find use center={x,y,z} instead of centerx= etc

This commit is contained in:
2024-03-13 15:39:09 -04:00
parent 357e3766fb
commit fd8166f09c
7 changed files with 81 additions and 115 deletions

View File

@@ -840,40 +840,24 @@ void PlaneScan::configure(LuaKeywordParser &kp) {
have_plane = true;
}
kp.parse(vx, "centerx");
kp.parse(vy, "centery");
kp.parse(vz, "centerz");
if ((!LS.isnil(vx)) || (!LS.isnil(vy)) || (!LS.isnil(vz))) {
LS.checknumber(vx, "centerx");
LS.checknumber(vy, "centery");
LS.checknumber(vz, "centerz");
center_.x = LS.cknumber(vx);
center_.y = LS.cknumber(vy);
center_.z = LS.cknumber(vz);
if (kp.parse(val, "center")) {
LS.checkxyz(val, "center");
util::DXYZ xyz = LS.ckxyz(val);
center_ = xyz;
have_center = true;
}
if (kp.parse(val, "radius")) {
LS.checknumber(val, "radius");
radius_.x = LS.cknumber(val);
radius_.y = radius_.z = radius_.x;
have_radius = true;
}
kp.parse(vx, "radiusx");
kp.parse(vy, "radiusy");
kp.parse(vz, "radiusz");
if ((!LS.isnil(vx)) || (!LS.isnil(vy)) || (!LS.isnil(vz))) {
LS.checknumber(vx, "radiusx");
LS.checknumber(vy, "radiusy");
LS.checknumber(vz, "radiusz");
if (have_radius) {
luaL_error(L, "scan configuration: specified both 'radius' and 'radiusx'");
if (LS.isnumber(val)) {
radius_.x = LS.cknumber(val);
radius_.y = radius_.z = radius_.x;
have_radius = true;
} else {
LS.checkxyz(val, "radius");
util::DXYZ xyz = LS.ckxyz(val);
radius_ = xyz;
have_radius = true;
}
radius_.x = LS.cknumber(vx);
radius_.y = LS.cknumber(vy);
radius_.z = LS.cknumber(vz);
have_radius = true;
}
if (kp.parse(val, "shape")) {