Пример #1
0
// *********************************************************
void CPrimLook::init(const CLuaObject &params)
{
	//H_AUTO(R2_CPrimLook_init)
	if (!params.isTable())
	{
		nlwarning("<CPrimLook::init> parameters are not a table");
		return;
	}
	// vertices
	READ_FROM_LUA(VertexShapeName);
	READ_FROM_LUA(VertexShapeScale);
	VertexLook.init(params["VertexLook"]);
	if (!params["FirstVertexLook"].isNil())
	{
		FirstVertexLook.init(params["FirstVertexLook"]);
	}
	else
	{
		FirstVertexLook = VertexLook;
	}
	EdgeLook.init(params["EdgeLook"]);
	READ_FROM_LUA(LastEdgeIsValid);
	READ_FROM_LUA(ClipDownFacing);
	// enums
	uint shape = Star;
	readFromLua(params, "Shape", shape);
	if (shape < ShapeCount) Shape = (TShape) shape;
	//
}
Пример #2
0
// *********************************************************************************************************
void CEntityCustomSelectBox::fromTable(CLuaObject &table)
{
	//H_AUTO(R2_CEntityCustomSelectBox_fromTable)
	if (!table.isTable())
	{
		nlwarning("trying to rerieve bbox from an object that is not a table");
		return;
	}
	Enabled = table["Enabled"].toBoolean();
	Box.setMinMax(CVector((float) table["XMin"].toNumber(),
		                  (float) table["YMin"].toNumber(),
						  (float) table["ZMin"].toNumber()),
				  CVector((float) table["XMax"].toNumber(),
		                  (float) table["YMax"].toNumber(),
						  (float) table["ZMax"].toNumber()));
}
Пример #3
0
// *********************************************************************************************************
void CEntityCustomSelectBox::toTable(CLuaObject &table)
{
	//H_AUTO(R2_CEntityCustomSelectBox_toTable)
	if (!table.isTable())
	{
		nlwarning("trying to store bbox in an object that is not a table");
		return;
	}
	table.setValue("Enabled", Enabled);
	//
	table.setValue("XMin", (double) Box.getMin().x);
	table.setValue("YMin", (double) Box.getMin().y);
	table.setValue("ZMin", (double) Box.getMin().z);
	//
	table.setValue("XMax", (double) Box.getMax().x);
	table.setValue("YMax", (double) Box.getMax().y);
	table.setValue("ZMax", (double) Box.getMax().z);


}