//--------------------------------------------------------------
void Page::rebuild(float bendTopPct, float bendBottomPct)
{
    path.clear();

    // try to keep the page area the same as it bends...

    float bendTopY = pageSize * 0.5 * bendTopPct;
    float bendTopZ = -pageSize * (1 - ABS(bendTopPct) * 0.5);
    
    float bendBottomY = pageSize * 0.5 * bendBottomPct;
    float bendBottomZ = pageSize * (1 - ABS(bendBottomPct) * 0.5);

    path.moveTo(ofPoint(-pageSize, bendTopY, bendTopZ));

    path.bezierTo(ofPoint(-pageSize, bendTopY * 0.5, bendTopZ),
                  ofPoint(-pageSize, 0, bendTopZ * 0.5),
                  ofPoint(-pageSize, 0, 0));
    path.bezierTo(ofPoint(-pageSize, 0, bendBottomZ * 0.5),
                  ofPoint(-pageSize, bendBottomY * 0.5, bendBottomZ),
                  ofPoint(-pageSize, bendBottomY, bendBottomZ));

    path.lineTo(ofPoint(pageSize, bendBottomY, bendBottomZ));

    path.bezierTo(ofPoint(pageSize, bendBottomY * 0.5, bendBottomZ),
                  ofPoint(pageSize, 0, bendBottomZ * 0.5),
                  ofPoint(pageSize, 0, 0));
    path.bezierTo(ofPoint(pageSize, 0, bendTopZ * 0.5),
                  ofPoint(pageSize, bendTopY * 0.5, bendTopZ),
                  ofPoint(pageSize, bendTopY, bendTopZ));

    remesh(PageOverwriteFirst);
}
//--------------------------------------------------------------
void Page::rebuild()
{
    path.clear();

    path.moveTo(ofPoint(-pageSize, 0, -pageSize));
    path.lineTo(ofPoint(-pageSize, 0,  pageSize));
    path.lineTo(ofPoint( pageSize, 0,  pageSize));
    path.lineTo(ofPoint( pageSize, 0, -pageSize));

    remesh(PageOverwriteNone);
}
//--------------------------------------------------------------
void Page::rebuild(float bendPct)
{
    path.clear();

    float bendY = pageSize * bendPct;
    float bendZ = ABS(pageSize * bendPct * 2);

    path.moveTo(ofPoint(-pageSize, 0, -pageSize));
    path.lineTo(ofPoint(-pageSize, 0, pageSize - bendZ));
    path.bezierTo(ofPoint(-pageSize, 0, pageSize - bendZ * 0.5), ofPoint(-pageSize, bendY * 0.5, pageSize), ofPoint(-pageSize, bendY, pageSize));
    path.lineTo(ofPoint(pageSize, bendY, pageSize));
    path.bezierTo(ofPoint(pageSize, bendY * 0.5, pageSize), ofPoint(pageSize, 0, pageSize - bendZ * 0.5), ofPoint(pageSize, 0, pageSize - bendZ));
    path.lineTo(ofPoint(pageSize, 0, -pageSize));
    path.lineTo(ofPoint(-pageSize, 0, -pageSize));

    remesh(PageOverwriteAll);
}
예제 #4
0
bool Building::checkconstruction()
{
	BuildingT* t = &g_bltype[type];

	bool haveall = true;

	for(int i=0; i<RESOURCES; i++)
		if(conmat[i] < t->conmat[i])
		{
			haveall = false;
			break;
		}

#if 0
	if(owner == g_localP)
	{
		char msg[128];
		sprintf(msg, "%s construction complete.", t->name);
		Chat(msg);
		ConCom();
	}
#endif

	if(haveall && !finished)
		for(char ctype=0; ctype<CONDUIT_TYPES; ctype++)
			ReNetw(ctype);

	//if(owner == g_localP)
	//	OnFinishedB(type);

	finished = haveall;

	remesh();

	return finished;
}