Пример #1
0
void RayIntersectorKDTreeNode::MakeLeafNode(const Vector<UINT> &TriangleIndices, Vector<UINT> &LeafTriangles)
{
    _Flags.Leaf = 1;
    _Leaf.TrianglesStartIndex = LeafTriangles.Length();
    _Leaf.TrianglesCount = TriangleIndices.Length();
    LeafTriangles.Append(TriangleIndices);
}
Пример #2
0
		Result Patcher::Test(const Block* const blocks,const uint numBlocks) const
		{
			NST_ASSERT( blocks || !numBlocks );

			if (numBlocks > 1)
			{
				Vector<byte> buffer;

				try
				{
					dword size = 0;

					for (uint i=0; i < numBlocks; ++i)
						size += blocks[i].size;

					buffer.Reserve( size );
				}
				catch (...)
				{
					return RESULT_ERR_OUT_OF_MEMORY;
				}

				for (uint i=0; i < numBlocks; ++i)
					buffer.Append( blocks[i].data, blocks[i].size );

				return Test( buffer.Begin(), buffer.Size() );
			}
			else
			{
				return Test( blocks ? blocks->data : NULL, blocks ? blocks->size : 0 );
			}
		}
Пример #3
0
void HashTable::EnumerateTable(Vector& v_items)
{
	for(int i=0;i<(int)m_table_size;i++){
		v_items.Append(&mp_vector_array[i]);
	}
}