当前位置: 首页>>代码示例>>C++>>正文


C++ SharedPtr::AddGeometry方法代码示例

本文整理汇总了C++中SharedPtr::AddGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedPtr::AddGeometry方法的具体用法?C++ SharedPtr::AddGeometry怎么用?C++ SharedPtr::AddGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SharedPtr的用法示例。


在下文中一共展示了SharedPtr::AddGeometry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CreateComponent

void GridDescriptor::CreateComponent(Node *node, Engine *engine)
{
	SharedPtr<Mesh> mesh = new Mesh(engine);
	mesh->AddGeometry(GeometryGenerator::GenerateGrid(engine, size, countX, countZ), BoundingBox(-vec3(size.x, 1, size.y) * 0.5f, vec3(size.x, 1, size.y) * 0.5f), engine->GetResourceCache()->GetResource<Material>(materialFileName));
	auto staticModel = node->CreateComponent<StaticModel>(mesh);

	staticModel->SetCastShadow(castShadow);
	component = staticModel;
}
开发者ID:ibachar,项目名称:firecube,代码行数:9,代码来源:GridDescriptor.cpp

示例2: Recreate

void GridDescriptor::Recreate(FireCube::Engine *engine)
{
	if (component)
	{
		auto staticModel = static_cast<StaticModel *>(component);
		SharedPtr<Mesh> mesh = new Mesh(engine);
		mesh->AddGeometry(GeometryGenerator::GenerateGrid(engine, size, countX, countZ), BoundingBox(-vec3(size.x, 1, size.y) * 0.5f, vec3(size.x, 1, size.y) * 0.5f), engine->GetResourceCache()->GetResource<Material>(materialFileName));
		staticModel->CreateFromMesh(mesh);
	}
}
开发者ID:ibachar,项目名称:firecube,代码行数:10,代码来源:GridDescriptor.cpp

示例3: UpdatePreview

void MaterialEditorWindow::UpdatePreview(FireCube::Material *material)
{
	auxRenderWindow.Reset();
	auto root = auxRenderWindow.GetRoot();

	auto lightNode1 = root->CreateChild();
	auto light = lightNode1->CreateComponent<Light>();
	light->SetLightType(LightType::DIRECTIONAL);
	light->SetColor(vec3(1.0f));
	lightNode1->Rotate(vec3((float)-PI * 0.25f, (float)-PI * 0.25f, 0.0f));

	auto lightNode2 = root->CreateChild();
	light = lightNode2->CreateComponent<Light>();
	light->SetLightType(LightType::DIRECTIONAL);
	light->SetColor(vec3(1.0f));
	lightNode2->Rotate(vec3((float)PI * 0.25f, (float)PI * 0.25f, 0.0f));

	auto meshNode = root->CreateChild();	
	auto geometry = GeometryGenerator::GenerateSphere(engine, 0.5f, 16, 16);
	SharedPtr<Mesh> sphereMesh = new Mesh(engine);
	sphereMesh->AddGeometry(geometry, BoundingBox(vec3(-0.5f), vec3(0.5f)), material);
	meshNode->CreateComponent<StaticModel>(sphereMesh);
}
开发者ID:ibachar,项目名称:firecube,代码行数:23,代码来源:MaterialEditorWindow.cpp


注:本文中的SharedPtr::AddGeometry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。