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


C++ Planet::GetGeoSphere方法代码示例

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


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

示例1: OnChangeGeoSphereStyle

void ObjectViewerView::OnChangeGeoSphereStyle()
{
	SBody sbody;

	const fixed volatileGas = fixed(65536.0*atof(m_sbodyVolatileGas->GetText().c_str()), 65536);
	const fixed volatileLiquid = fixed(65536.0*atof(m_sbodyVolatileLiquid->GetText().c_str()), 65536);
	const fixed volatileIces = fixed(65536.0*atof(m_sbodyVolatileIces->GetText().c_str()), 65536);
	const fixed life = fixed(65536.0*atof(m_sbodyLife->GetText().c_str()), 65536);
	const fixed volcanicity = fixed(65536.0*atof(m_sbodyVolcanicity->GetText().c_str()), 65536);
	const fixed metallicity = fixed(65536.0*atof(m_sbodyMetallicity->GetText().c_str()), 65536);
	const fixed mass = fixed(65536.0*atof(m_sbodyMass->GetText().c_str()), 65536);
	const fixed radius = fixed(65536.0*atof(m_sbodyRadius->GetText().c_str()), 65536);

	sbody.parent = 0;
	sbody.name = "Test";
	/* These should be the only SBody attributes GeoSphereStyle uses */
	sbody.type = SBody::TYPE_PLANET_TERRESTRIAL;
	sbody.seed = atoi(m_sbodySeed->GetText().c_str());
	sbody.radius = radius;
	sbody.mass = mass;
	sbody.averageTemp = 273;
	sbody.m_metallicity = metallicity;
	sbody.m_volatileGas = volatileGas;
	sbody.m_volatileLiquid = volatileLiquid;
	sbody.m_volatileIces = volatileIces;
	sbody.m_volcanicity = volcanicity;
	sbody.m_life = life;
	sbody.heightMapFilename = 0;

	Body *body = Pi::player->GetNavTarget();
	if (body->IsType(Object::PLANET)) {
		Planet *planet = static_cast<Planet*>(body);
		GeoSphere *gs = planet->GetGeoSphere();
		gs->m_style = GeoSphereStyle(&sbody);
		// force rebuild
		gs->OnChangeDetailLevel();
	}
}
开发者ID:GAlexx,项目名称:pioneer,代码行数:38,代码来源:ObjectViewerView.cpp


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