void CCTDebugData::addOBB(const NxBox& box, NxU32 color, bool renderFrame)
{
	// Compute box vertices
	NxVec3 pp[8];
	//box.computePoints(pp);
	computeBoxPoints(box, pp);

	// Draw all lines
	const NxU32* Indices = getBoxEdges();
	for(NxU32 i=0;i<12;i++)
		{
		NxU32 VRef0 = *Indices++;
		NxU32 VRef1 = *Indices++;
		addLine(pp[VRef0], pp[VRef1], color);
		}

	// Render frame if needed
	if(renderFrame)
		{
		NxVec3 Axis0; box.rot.getColumn(0, Axis0);
		NxVec3 Axis1; box.rot.getColumn(1, Axis1);
		NxVec3 Axis2; box.rot.getColumn(2, Axis2);
		
		addLine(box.center, box.center + Axis0, 0x00ff0000);
		addLine(box.center, box.center + Axis1, 0x0000ff00);
		addLine(box.center, box.center + Axis2, 0x000000ff);
		}
}
Example #2
0
Edge getFirstBoxCompletingMove(UnscoredState * state) {
    const Edge * boxEdges;

    for(Box b=0; b < NUM_BOXES; b++) {
        if(getBoxNumTakenEdges(state, b) == 3) {
            // Find the first free edge
            boxEdges = getBoxEdges(b);

            for(short i=0; i<4; i++) {
                if (!isEdgeTaken(state, boxEdges[i]))
                    return boxEdges[i];
            }
        }
    }

    return NO_EDGE;
}