本文整理汇总了C++中luabind::object::abegin方法的典型用法代码示例。如果您正苦于以下问题:C++ object::abegin方法的具体用法?C++ object::abegin怎么用?C++ object::abegin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类luabind::object
的用法示例。
在下文中一共展示了object::abegin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setGeometryIndices
void setGeometryIndices( Geometry * pGeom, const luabind::object & indexTable )
{
if ( indexTable.is_valid() && indexTable.type() == LUA_TTABLE )
{
if ( !pGeom->m_indexBuffer ) pGeom->m_indexBuffer.reset( new vector<unsigned short> );
unsigned int uiNewIndices = 0;
pGeom->m_indexBuffer->clear();
for( luabind::object::array_iterator iter = indexTable.abegin();
iter != indexTable.aend();
iter++, uiNewIndices++ )
{
boost::optional<unsigned short> oindex = luabind::object_cast_nothrow<unsigned short>( *iter );
if ( oindex )
pGeom->m_indexBuffer->push_back( *oindex.get() );
}
pGeom->m_indexCount = uiNewIndices;
}
}
示例2: setGeometryTexture1
void setGeometryTexture1( Geometry * pGeom, const luabind::object & texture1Table )
{
if ( texture1Table.is_valid() && texture1Table.type() == LUA_TTABLE )
{
if ( !pGeom->m_texture1Buffer ) pGeom->m_texture1Buffer.reset( new vector<float> );
pGeom->m_texture1Buffer->clear();
for( luabind::object::array_iterator iter = texture1Table.abegin();
iter != texture1Table.aend();
iter++ )
{
boost::optional<Point2> opt = luabind::object_cast_nothrow<Point2>( *iter );
if ( opt )
{
Point2 * pt = opt.get();
pGeom->m_texture1Buffer->push_back( pt->x );
pGeom->m_texture1Buffer->push_back( pt->y );
}
}
}
}
示例3: setGeometryColor
void setGeometryColor( Geometry * pGeom, const luabind::object & colorTable )
{
if ( colorTable.is_valid() && colorTable.type() == LUA_TTABLE )
{
if ( !pGeom->m_colorBuffer ) pGeom->m_colorBuffer.reset( new vector<float> );
pGeom->m_colorBuffer->clear();
for( luabind::object::array_iterator iter = colorTable.abegin();
iter != colorTable.aend();
iter++ )
{
boost::optional<ColorA> opt = luabind::object_cast_nothrow<ColorA>( *iter );
if ( opt )
{
ColorA * pt = opt.get();
pGeom->m_colorBuffer->push_back( pt->r );
pGeom->m_colorBuffer->push_back( pt->g );
pGeom->m_colorBuffer->push_back( pt->b );
pGeom->m_colorBuffer->push_back( pt->a );
}
}
}
}
示例4: setGeometryVertices
//
// Local Functions
//
void setGeometryVertices( Geometry * pGeom, const luabind::object & vertexTable )
{
if ( vertexTable.is_valid() && vertexTable.type() == LUA_TTABLE )
{
if ( !pGeom->m_vertexBuffer ) pGeom->m_vertexBuffer.reset( new vector<float> );
pGeom->m_vertexBuffer->clear();
unsigned uiNewVertices = 0;
for( luabind::object::array_iterator iter = vertexTable.abegin();
iter != vertexTable.aend();
iter++, uiNewVertices++ )
{
boost::optional<Point3> opt = luabind::object_cast_nothrow<Point3>( *iter );
if ( opt )
{
Point3 * pt = opt.get();
pGeom->m_vertexBuffer->push_back( pt->x );
pGeom->m_vertexBuffer->push_back( pt->y );
pGeom->m_vertexBuffer->push_back( pt->z );
}
}
pGeom->m_vertexCount = uiNewVertices;
}
}