本文整理汇总了C++中ogre::SceneNode::_getWorldAABB方法的典型用法代码示例。如果您正苦于以下问题:C++ SceneNode::_getWorldAABB方法的具体用法?C++ SceneNode::_getWorldAABB怎么用?C++ SceneNode::_getWorldAABB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::SceneNode
的用法示例。
在下文中一共展示了SceneNode::_getWorldAABB方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetupBottomWall
void DefaultGameObjectFactory::SetupBottomWall(GameObject* wall) {
Ogre::SceneNode* node = scene_manager_->getSceneNode("bottom_wall");
node->_update(true, true);
const Ogre::AxisAlignedBox& wall_rect = node->_getWorldAABB();
Ogre::Vector3 wall_size = wall_rect.getSize();
Size size = { wall_size.x , wall_size.y, wall_size.z };
wall->set_position(center_x_, size.y / 2.f);
wall->set_size(size);
}
示例2: SetupBall
void DefaultGameObjectFactory::SetupBall(GameObject* ball) {
Ogre::SceneNode* node = scene_manager_->getSceneNode("ball");
node->_update(true, true);
const Ogre::AxisAlignedBox& ball_rect = node->_getWorldAABB();
Ogre::Vector3 ball_size = ball_rect.getSize();
Size size = { ball_size.x, ball_size.y, ball_size.z };
ball->set_position(center_x_, center_y_);
ball->set_size(size);
ball->set_movement_velocity(50.f);
ball->set_rotation_velocity(10.f);
Clamp clamp = { { 0.f, 500.f }, { 0.f, 10.f } };
ball->set_clamp(clamp);
}
示例3:
void DefaultGameObjectFactory::SetupPlayer1(GameObject* player) {
Ogre::MeshManager& mesh_manager = Ogre::MeshManager::getSingleton();
const Ogre::AxisAlignedBox& wall_rect = static_cast<Ogre::MeshPtr>(
mesh_manager.getByName("wall.mesh"))->getBounds();
Ogre::SceneNode* node = scene_manager_->getSceneNode("pad_1");
node->_update(true, true);
const Ogre::AxisAlignedBox& pad_rect = node->_getWorldAABB();
mxgame::Real offset = wall_rect.getSize().y + pad_rect.getHalfSize().y;
pad_1_lower_limit_ = offset - center_y_;
pad_1_upper_limit_ = center_y_ - offset;
Ogre::Vector3 pad_size = pad_rect.getSize();
Size size = { pad_size.x, pad_size.y, pad_size.z };
player->set_position(x_border_offset_, center_y_);
player->set_size(size);
player->set_movement_velocity(250.f);
}