Implemented the keyword argument parser.
This commit is contained in:
@@ -138,7 +138,7 @@ LuaDefine(tangible_build, "configtable",
|
||||
LuaRet database;
|
||||
LuaStack LS(L, config, classname, classtab, database, mt);
|
||||
|
||||
LS.checktable(config);
|
||||
LS.checktable(config, "config");
|
||||
// Get the class of the new tangible.
|
||||
LS.rawget(classname, config, "class");
|
||||
eng::string err = LS.getclass(classtab, classname);
|
||||
@@ -346,8 +346,13 @@ LuaDefine(tangible_find, "config",
|
||||
"|"
|
||||
"| wholeplane: the name of the plane to scan in its entirety"
|
||||
"|"
|
||||
"|It is valid to use 0.0 as the radius. If you do so, then only"
|
||||
"|objects at the exact center you specify will be found."
|
||||
"|It is valid to use 0.0 as a radius. For example, you could"
|
||||
"|use shape='cylinder' and radiusz=0.0 to scan a flat"
|
||||
"|circular area."
|
||||
"|"
|
||||
"|It is also valid to use math.huge (infinity) as a radius. For"
|
||||
"|example, you could use shape='cylinder' and radiusz=math.huge"
|
||||
"|to scan an infinitely tall cylinder."
|
||||
"|"
|
||||
"|If you are making a 2D game, it works fine to set all object Z"
|
||||
"|coordinates to zero, and then do searches with centerz=0.0"
|
||||
@@ -356,11 +361,11 @@ LuaDefine(tangible_find, "config",
|
||||
LuaArg config;
|
||||
LuaRet result;
|
||||
LuaStack LS(L, config, result);
|
||||
LuaKeywordParser kw(LS, config);
|
||||
PlaneScan scan;
|
||||
eng::string error = scan.configure(LS, config);
|
||||
if (!error.empty()) {
|
||||
luaL_error(L, "%s", error.c_str());
|
||||
}
|
||||
scan.configure(kw);
|
||||
kw.check_unparsed_keywords();
|
||||
|
||||
// When the configure routine sees the 'near' flag, it stores the tangible
|
||||
// ID, but not the center and plane, because doing so would require it to
|
||||
// know about world models. We have to handle center and plane for 'near'
|
||||
|
||||
Reference in New Issue
Block a user