Remove ball (meshes must be loaded from file)
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
%module couch
|
||||
|
||||
%include "typemaps.i"
|
||||
#ifdef SWIGLUA
|
||||
%include "lua/helpers.i"
|
||||
#endif // SWIGLUA
|
||||
|
||||
%{
|
||||
#include "types.h"
|
||||
@@ -8,7 +11,6 @@
|
||||
#include "Transform.h"
|
||||
#include "Spatial.h"
|
||||
#include "Mesh.h"
|
||||
#include "Ball.h"
|
||||
#include "Material.h"
|
||||
#include "Camera.h"
|
||||
%}
|
||||
@@ -38,7 +40,6 @@ public:
|
||||
%include "Node.h"
|
||||
%include "Spatial.h"
|
||||
%include "Mesh.h"
|
||||
%include "Ball.h"
|
||||
%include "Transform.h"
|
||||
%include "Material.h"
|
||||
%include "Camera.h"
|
||||
|
||||
19
scripting/lua/helpers.i
Normal file
19
scripting/lua/helpers.i
Normal file
@@ -0,0 +1,19 @@
|
||||
%module helpers
|
||||
|
||||
%luacode {
|
||||
function couch.TexturedMesh(meshfile, ...)
|
||||
local mesh = couch.Mesh.FromFile(meshfile)
|
||||
for i, texturefile in ipairs({...}) do
|
||||
local material = couch.Material()
|
||||
material.usesTex = true
|
||||
material.tex = couch.Texture.FromFile(texturefile)
|
||||
mesh:SetMaterial(i - 1, material)
|
||||
end
|
||||
return mesh
|
||||
end
|
||||
|
||||
} // luacode
|
||||
|
||||
// Local Variables:
|
||||
// mode: poly-swig
|
||||
// End:
|
||||
Reference in New Issue
Block a user