本文整理汇总了C++中point::getY方法的典型用法代码示例。如果您正苦于以下问题:C++ point::getY方法的具体用法?C++ point::getY怎么用?C++ point::getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类point
的用法示例。
在下文中一共展示了point::getY方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawPoint
void drawPoint(point p, double size) {
glBegin(GL_POLYGON);
glVertex2d(p.getX()-size, p.getY()-size);
glVertex2d(p.getX()-size, p.getY()+size);
glVertex2d(p.getX()+size, p.getY()+size);
glVertex2d(p.getX()+size, p.getY()-size);
glEnd();
}
示例2: miseAjour
/*cubeCol* joueur::getCube()
{
return &collision;
}*/
void joueur::miseAjour(point newPosition, uint16_t newAngleX, uint16_t newAngleY, uint8_t newGaz, uint8_t newAxeX, uint8_t newAxeY, float newVitesse)
{
if(newPosition.getX() > -251 && newPosition.getX() < 251 && newPosition.getY() > -251 && newPosition.getY() < 251 && newPosition.getZ() > -251 && newPosition.getZ() < 251)
{
position = newPosition;
}
if(newAngleX < 361)
{
angleX = newAngleX;
}
if(newAngleY < 361)
{
angleY = newAngleY;
}
if(newGaz == 0 || newGaz == 1)
{
gaz = newGaz;
}
if(newAxeX == 0 || newAxeX == 1 || newAxeX == 2 )
{
axeX = newAxeX;
}
if(newAxeY == 0 || newAxeY == 1 || newAxeY == 2 )
{
axeY = newAxeY;
}
if(newVitesse >= 0 && newVitesse <= vitesseMax)
{
vitesse = newVitesse;
}
}
示例3: validPosition
bool validPosition(point p, int width, int height, Obstacle obstacles[], int numObstacles) {
if(!((0<=p.getX()) && (p.getX()<width) && (0<=p.getY()) && (p.getY()<height))) {
return false;
}
for(int i=0; i < numObstacles; i++) {
Obstacle o = obstacles[i];
if((o.x1 <= p.getX()) && (p.getX() <= o.x2) &&
(o.y1 <= p.getY()) && (p.getY() <= o.y2)) {
// cout << o.x1 << " " << p.getX() << " " << o.x2 << endl;
// cout << o.y1 << " " << p.getY() << " " << o.y2 << endl;
return false;
}
}
return true;
}
示例4:
Ship::Ship(point originPoint, direction o, int l)
{
origin = originPoint;
orientation = o;
length = l;
lencopy = length;
hits = 0;
points.add(originPoint);
if (orientation == HORIZONTAL)
{
while((lencopy - 1) > 0)
{
points.add((originPoint.getX() + 1), originPoint.getY)
lencopy -= 1;
}
}
else
{
while((lencopy - 1) > 0)
{
points.add(originPoint.getX(), (originPoint.getY()+1))
lencopy -= 1;
}
}
}
示例5: update
void update(point changeCell)
{
double dCell[] = {changeCell.getX(),changeCell.getY(),changeCell.getZ()};
if(dCell[0] <= length && dCell[1] <= width && dCell[2] <= height)
{
//find the node in the k-tree with the same location
Node *getN = mesh.search(mesh.getRoot(),dCell);
//update everything else
getN->cell=changeCell;
}
}
示例6: Ship
PlayerShip::PlayerShip(const point& origin, direction dir,
int len, Player *parent)
: Ship(origin, dir, len)
{
p = parent;
co_x = origin.getX();
co_y = origin.getY();
length = len;
d = dir;
}
示例7: hasilGeser
polygon polygon::hasilGeser(point delta){
return hasilGeser(delta.getX(), delta.getY());
}
示例8:
bool point::operator==(const point p) const {
if ((p.getX() == x_) && (p.getY() == y_)) return 1;
return 0;
}
示例9: return
bool operator== (const point &other) const {
return (x == other.getX() &&
y == other.getY());
}
示例10: distance
double point::distance(point &p1){
return sqrt(pow((x-p1.getX()),2) + pow((y-p1.getY()),2));
}
示例11: compare_y
bool compare_y(const point& lhs, const point& rhs){
return lhs.getY() <= rhs.getY();
}
示例12: glVertex2dp
void glVertex2dp(point p) {
glVertex2d(p.getX(), p.getY());
}
示例13: dist
int dist(const point& lhs, const point& rhs){
return (lhs.getX() - rhs.getX()) * (lhs.getX() - rhs.getX()) + (lhs.getY() - rhs.getY()) * (lhs.getY() - rhs.getY());
}
示例14: distance
double joueur::distance(point a)
{
double distanceXZ = sqrt(double(a.getX()*a.getX()) + double(a.getZ()*a.getZ()));
return sqrt(distanceXZ + double(a.getY() * a.getY()));
}