Example #1
0
void KDPartition(aabb_t *aabb, int size, int axis, float plane, kdbuffer_t *left, kdbuffer_t *right)
{
	// Partition and count MinMaxBin
	int i;
	for(i=0; i < size; i++)
	{
		float min = aabb[i].min[axis];
		float max = aabb[i].max[axis];
	
		if(min < plane)
		{
			// left
			MoveAABB(&aabb[i], &left->aabb[left->count++]); 
			MinMaxBinCountAll(&aabb[i], &lmmb, &left->baabb, splitaxis, nsplitaxises);
		}

		if(max > plane)
		{
			// right
			MoveAABB(&aabb[i], &right->aabb[right->count++]);
			MinMaxBinCountAll(&aabb[i], &rmmb, &right->baabb, splitaxis, nsplitaxises);
		}
	}	
}
Example #2
0
void BroadPhaseTest::MoveProxy()
{
	for (int32 i = 0; i < k_actorCount; ++i)
	{
		int32 j = rand() % k_actorCount;
		//int32 j = 1;
		Actor* actor = m_actors + j;
		if (actor->proxyId == b2_nullProxy)
		{
			continue;
		}

		MoveAABB(&actor->aabb);
		m_broadPhase->MoveProxy(actor->proxyId, actor->aabb);
		return;
	}
}