osg.CopyOp

class osg.CopyOp
Represents

c++ class

Wraps

osg::CopyOp

Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clone operation.

-- CopyOp example

-- See results in the console

local origNode = osg.Group()
origNode:setName("Original Node")
origNode:setUpdateCallback(osg.NodeCallback(function(node, noveVisitor)
    loginfo("Updating '" .. node:getName() .. "'") end))

local clonedNode1 = origNode:clone(
    osg.CopyOp(bit_or(osg.CopyOp.DEEP_COPY_NODES))):asNode()
clonedNode1:setName("Cloned Node 1")
local clonedNode2 = origNode:clone(
    osg.CopyOp(bit_or(osg.CopyOp.DEEP_COPY_NODES,
                      osg.CopyOp.DEEP_COPY_CALLBACKS))):asNode()
clonedNode2:setName("Cloned Node 2")

local root = osg.Group()
root:addChild(origNode)
root:addChild(clonedNode1)
root:addChild(clonedNode2)


local scene = reactorController:getReactorByName("Scene")
scene.node:addChild(root)

Constructors:

osg.CopyOp()

Construct a CopyOp with osg.CopyOp.SHALLOW_COPY flag

osg.CopyOp(unsigned flags)

Construct a CopyOp with bitmask flags.

Параметры

flags (unsigned) – Bitmask of osg.CopyOp.Options

Methods:

:setCopyFlags(unsigned flags)

Set bitmask flags

Параметры

flags (unsigned) – Bitmask of osg.CopyOp.Options

:getCopyFlags()

Get bitmask flags

Тип результата

osg.CopyOp