osg.NodeCallback

class osg.NodeCallback
Represents

c++ class

Wraps

osg::NodeCallback

Bases

osg.Callback

-- Example of usage osg.NodeCallback for rotation animation.

local model = reactorController:getReactorByName("logo_model") -- must be presented in the project

-- initial object transformation using high-level api
model.trans     = osg.Vec3(0.0, 0.0, -0.3)
model.rotate    = osg.Vec3(0.0, 0.0, 0.0)

local period    = 5.0   -- seconds
local step      = 360.0/period

model.node:setUpdateCallback(osg.NodeCallback(function()
    -- Rotate object around 0y axis using high-level api
    model.rotate = osg.Vec3(0.0, timer:getTime() % period * step, 0.0)
end))

viewer:getCamera():setClearColor(osg.Vec4(163/255.0, 182/255.0, 1.0, 1.0))  -- change clear color for convenience

Constructors:

osg.NodeCallback(luafunction__ f)

Параметры

f (luafunction) –

Methods:

:run(osg.Object object, osg.Object data)

Параметры
Тип результата

bool

:call(osg.Node node, osg.NodeVisitor nv)

Параметры