示例#1
0
void QVX_FEA::ExecuteSolveSystem(QString* Param)
{
	bool KeepGoing = true;
	std::string ParamString = Param->toStdString();

	if (!ImportObj(NULL, &ParamString)) KeepGoing = false; //import the linked VXC oject
	if (KeepGoing) Solve(&ParamString); //Solve the system
	*Param = ParamString.c_str();
}
示例#2
0
文件: oapi.cpp 项目: darwin/pacwars2
void ImportEntity(GEntity * ge, SCENTITY * se)
{
	ImportObj((GObj *) ge, &se->obj);

	ge->anim = se->anim;
	ge->frame = se->frame;
	ge->framedelay = se->framedelay;
//  ge->radius = se->radius;
//  ge->xaccel = se->xaccel;
	ge->xpos = se->xpos;
	ge->xsize = se->xsize;
//  ge->xspeed = se->xspeed;
//  ge->yaccel = se->yaccel;
	ge->ypos = se->ypos;
	ge->ysize = se->ysize;
//  ge->yspeed = se->yspeed;
}
示例#3
0
// INITIALIZE CORE FUNCTIONS
bool RenderEngine::Init(){

	if (!InitWindow()){
		return false; //gick inte att skapa window
	}

	if (!InitDirect3D(hWindow)){
		return false; //gick inte att skapa Direct3D
	}
	// Sets and creates viewport
	SetViewport();

	//Initialize Shaders and triangle data
	Shaders();
	CreatePlaneData();
	TextureFunc();

	//Font
	Fonts();

	//Import
	
	ImportObj("Objects/testPlayer1.obj", "Objects/testPlayer1.mtl", gDevice, true);
	
	ImportObj("Objects/mapPart1.obj", "Objects/mapPart1.mtl", gDevice, false);
	ImportObj("Objects/mapPart2.obj", "Objects/mapPart2.mtl", gDevice, false);
	ImportObj("Objects/mapPart3.obj", "Objects/mapPart3.mtl", gDevice, false);
	ImportObj("Objects/mapPart4.obj", "Objects/mapPart4.mtl", gDevice, false);
	ImportObj("Objects/mapPart5.obj", "Objects/mapPart5.mtl", gDevice, false);
	ImportObj("Objects/mapPart6.obj", "Objects/mapPart6.mtl", gDevice, false);
	ImportObj("Objects/mapPart7.obj", "Objects/mapPart7.mtl", gDevice, false);
	ImportObj("Objects/mapPart7.obj", "Objects/mapPart7.mtl", gDevice, false);

	

	//LIGHT TEST ZONE BITCHES
	/*float l1Int = 1.0f;
	XMFLOAT3 l1Pos = XMFLOAT3(0.0f, 1.0f, -2.0f);
	XMFLOAT4 l1Amb = XMFLOAT4(1.0f, 1.0f, 1.0f,1.0f);
	XMFLOAT4 l1Diff = XMFLOAT4(1.0f, 1.0f, 1.0f, 1.0f);
	XMFLOAT4 l1Spec = XMFLOAT4(0.5f, 0.2f, 0.2f, 1.0f);
	XMFLOAT3 l1Dir = XMFLOAT3(0.0f, -50.0f, 30.0f);*/



	testLight[0] = LightClass(l_Directional, XMFLOAT3(1.0f, 1.0f, -5.0f), true, true);
	testLight[0].lightObject.Color = XMFLOAT4(Colors::White);
	/*testLight[0].ToggleActive();*/

	LightClass snoppe(l_Point, XMFLOAT3(1.0f, 1.0f, 0.0f), true, true);

	testLight[1] = snoppe;
	snoppe.lightObject.Type = 2;
	testLight[1].lightObject.Position = XMFLOAT4(-4.0f, 8.0f, 1.0f, 1.0f);
	testLight[1].lightObject.Color = XMFLOAT4(Colors::LightGoldenrodYellow);
	testLight[1].lightObject.AttConst = 1.0f;
	testLight[1].lightObject.AttLinear = 0.08f;
	testLight[1].lightObject.AttQuadratic = 0.00000f;
	//testLight[1].ToggleActive();
 	globalAmb = XMFLOAT4(Colors::Black);

	D3D11_BUFFER_DESC lbuffDesc;
	ZeroMemory(&lbuffDesc, sizeof(lbuffDesc));
	lbuffDesc.Usage = D3D11_USAGE_DEFAULT;
	lbuffDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
	lbuffDesc.CPUAccessFlags = 0;
	lbuffDesc.MiscFlags = 0;
	lbuffDesc.ByteWidth = sizeof(LightProperties);

	HRESULT hr = gDevice->CreateBuffer(&lbuffDesc, NULL, &lightConstBuff);


	// Material Buffers Init
	ZeroMemory(&lbuffDesc, sizeof(lbuffDesc));
	lbuffDesc.ByteWidth = sizeof(MaterialProperties);
	hr = gDevice->CreateBuffer(&lbuffDesc, NULL, &matConstBuff);



	return true; //om båda funkade så returnera true (y)
}