Added Vector serialization and support in lua plugin top enable script users to set/get vector properties such as osg::Array, osg::PrimitiveSet and children lists.
This commit is contained in:
@@ -189,6 +189,22 @@ const Array* Geometry::getTexCoordArray(unsigned int index) const
|
||||
else return 0;
|
||||
}
|
||||
|
||||
void Geometry::setTexCoordArrayList(const ArrayList& arrayList)
|
||||
{
|
||||
_texCoordList = arrayList;
|
||||
|
||||
dirtyDisplayList();
|
||||
|
||||
if (_useVertexBufferObjects)
|
||||
{
|
||||
for(ArrayList::iterator itr = _texCoordList.begin();
|
||||
itr != _texCoordList.end();
|
||||
++itr)
|
||||
{
|
||||
addVertexBufferObjectIfRequired(itr->get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Geometry::setVertexAttribArray(unsigned int index, Array* array, osg::Array::Binding binding)
|
||||
{
|
||||
@@ -216,6 +232,23 @@ const Array *Geometry::getVertexAttribArray(unsigned int index) const
|
||||
else return 0;
|
||||
}
|
||||
|
||||
void Geometry::setVertexAttribArrayList(const ArrayList& arrayList)
|
||||
{
|
||||
_vertexAttribList = arrayList;
|
||||
|
||||
dirtyDisplayList();
|
||||
|
||||
if (_useVertexBufferObjects)
|
||||
{
|
||||
for(ArrayList::iterator itr = _vertexAttribList.begin();
|
||||
itr != _vertexAttribList.end();
|
||||
++itr)
|
||||
{
|
||||
addVertexBufferObjectIfRequired(itr->get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Geometry::addPrimitiveSet(PrimitiveSet* primitiveset)
|
||||
{
|
||||
@@ -712,7 +745,7 @@ void Geometry::drawImplementation(RenderInfo& renderInfo) const
|
||||
// draw the primitives themselves.
|
||||
//
|
||||
drawPrimitivesImplementation(renderInfo);
|
||||
|
||||
|
||||
// unbind the VBO's if any are used.
|
||||
state.unbindVertexBufferObject();
|
||||
state.unbindElementBufferObject();
|
||||
|
||||
Reference in New Issue
Block a user