本文整理汇总了C++中BoundBox::getStaticObjects方法的典型用法代码示例。如果您正苦于以下问题:C++ BoundBox::getStaticObjects方法的具体用法?C++ BoundBox::getStaticObjects怎么用?C++ BoundBox::getStaticObjects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoundBox
的用法示例。
在下文中一共展示了BoundBox::getStaticObjects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
SPtr<ModelRecord> BoundBox_Loader::loadModel(WorldEntity *we, const std::string &model_id, varconf::Config &model_config) {
assert (we);
SPtr<ModelRecord> model_record = ModelLoader::loadModel(we, model_id, model_config);
BoundBox *model = new BoundBox();
WFMath::AxisBox<3> bbox = we->hasBBox() ? (we->getBBox()) : (WFMath::AxisBox<3>(WFMath::Point<3>(0.0f,0.0f,0.0f), WFMath::Point<3>(1.0f,1.0f,1.0f)));
std::string texture = we->type();
bool wrap = false; //default to false
// Check whether we specify texture wrapping
if (model_config.findItem(model_id, KEY_texture)) {
texture = (std::string)model_config.getItem(model_id, KEY_texture);
}
// Get texture name
if (model_config.findItem(model_id, KEY_wrap_texture)) {
wrap = (bool)model_config.getItem(model_id, KEY_wrap_texture);
}
// Initialise model
if (model->init(bbox, texture, wrap)) {
std::cerr<< "BoundBoxLoader: Error initialising model" << std::endl;
delete model;
return SPtr<ModelRecord>();
}
bool use_stencil = RenderSystem::getInstance().getState(RenderSystem::RENDER_STENCIL) && model_record->outline;
StaticObjectList &sol = model->getStaticObjects();
StaticObjectList::iterator I = sol.begin();
while (I != sol.end()) {
(*I)->setState(model_record->state);
(*I)->setSelectState(model_record->select_state);
(*I)->setUseStencil(use_stencil);
++I;
}
model_record->model = SPtr<Model>(model);
return model_record;
}