Hi Martin,
For basic types like Vec3, BoundingBox you can simply create a table with
the named elements and the LuaScriptEngine will adapt these to the
appropriate osg::Vec3 i.e.
For a vec3 :
{x=10,y=2,z=20}
For a colour vec4:
{r=0.4,g=0.2,b=0.1,a=1.0}
For a bounding box:
{xMin=0, yMin=0, zMin=0, xMax=10, yMax=10, zMax=10}
For a Matrix it'll match against 16 numbers in a table. Which I can't
remember off the top of my head the most convenient form for.
Robert.
On 22 February 2015 at 20:45, Martin Ferry <[email protected]> wrote:
> Hi, Robert
>
> After long debuging I found issue in your code. In file
> LuaScriptEngine.cpp, method void LuaScriptEngine::pushValue(const
> osg::Vec2f& value) const on line 3777 is double call lua_newtable(_lua); so
> if I remove one call , all works OK without error in lua. Can you look at
> it, and to similar overloaded call of method pushValue ? I think that call
> lua_newtable is redudant , and breaks ValueObject as input parameter to
> Lua table error.
>
> Second question. Can you write me a simple example how to create new
> Matrixf Object in Lua script ?
> I am using
> mobject = new ("osg::MatrixdValueObject");
> matrix = mo.Value
>
> but I think it' so ugly .
>
> And how to call methods of Matrix object, for example method makeRotate ?
> Please write simple example in which is called update method which rotate
> matrix of MatrixTransform object. It is possible ?
>
> I have problem with methods of value objects . Lua still say that called
> method is nill. Please write simple lua example with using these value
> object (Matrixd, Vec3, transforming Matrix ....)
>
>
> Many thanks!
>
> Cheers,
> Martin
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=62758#62758
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org