本文整理汇总了C++中Sector::get_ceiling方法的典型用法代码示例。如果您正苦于以下问题:C++ Sector::get_ceiling方法的具体用法?C++ Sector::get_ceiling怎么用?C++ Sector::get_ceiling使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sector
的用法示例。
在下文中一共展示了Sector::get_ceiling方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// Test case generated from prender.c printf statements
TEST(PlayerTest, MoveCrossedSegment) {
Vertex vs1{1, 16};
Vertex vs2{1, 2};
Vertex vs3{5, 7};
std::vector<Sector> sectors;
Sector s1{0, 100};
s1.set_number_of_points(4);
s1.add_vertex(vs1);
s1.add_vertex(vs2);
s1.add_vertex(vs3);
s1.add_neighbor(-1);
s1.add_neighbor(1);
sectors.push_back(s1);
float FLOOR = 999;
float CEILING = 1000;
Sector s2{FLOOR, CEILING};
sectors.push_back(s2);
Vector3D<float> location{4.184440, 6, 0};
float ANGLE = 30;
Player player{location, ANGLE, s1};
float dx = 0.190669;
float dy = 0;
player.move(dx, dy, sectors);
Sector result = player.get_sector();
EXPECT_EQ(FLOOR, result.get_floor());
EXPECT_EQ(CEILING, result.get_ceiling());
EXPECT_EQ(ANGLE, player.get_angle());
EXPECT_EQ(location.getX()+dx, player.get_location().getX());
EXPECT_EQ(location.getY()+dy, player.get_location().getY());
}