本文整理汇总了C++中TriangleArray::AddPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ TriangleArray::AddPoint方法的具体用法?C++ TriangleArray::AddPoint怎么用?C++ TriangleArray::AddPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TriangleArray
的用法示例。
在下文中一共展示了TriangleArray::AddPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lua_TriangleArray_AddPoint
void lua_TriangleArray_AddPoint(lua_State* L,
TriangleArray<IndexIntegerType, VertexCoordType, TexCoordType, NormalCoordType, textureCount, supportVertexVBOs, supportTexVBOs, supportNormalVBOs, VertexCoordinateCount, TexCoordCount>& array,
const typename VertexArray<VertexCoordType, VertexCoordinateCount, supportVertexVBOs>::value_type& vertex,
const object& lua_texcoords,
const typename NormalArray<NormalCoordType, supportNormalVBOs>::value_type& normal)
{
typedef TriangleArray<IndexIntegerType, VertexCoordType, TexCoordType, NormalCoordType, textureCount, supportVertexVBOs, supportTexVBOs, supportNormalVBOs, VertexCoordinateCount, TexCoordCount> array_t;
typedef typename array_t::vertex_type vertex_type;
typedef typename array_t::texcoord_type texcoord_type;
typedef typename array_t::normal_type normal_type;
luaL_checktype(L, 3, LUA_TTABLE);
if (lua_objlen(L, 3) != textureCount)
{
const char *msg = lua_pushfstring(L, "list of %u texture coordinates expected, got %u",
static_cast<unsigned int>(textureCount), lua_objlen(L, 3));
luaL_argerror(L, 3, msg);
return;
}
boost::array<texcoord_type, textureCount> texcoords;
typename boost::array<texcoord_type, textureCount>::iterator out_texcoords = texcoords.begin();
for (iterator i(lua_texcoords), end; i != end; ++i)
{
assert(out_texcoords != texcoords.end());
*out_texcoords++ = object_cast<texcoord_type>(*i);
}
array.AddPoint(vertex, texcoords.begin(), texcoords.end(), normal);
}