Пример #1
0
static VALUE stabilized_tip_position(VALUE self)
{
  Leap::Pointable * pointer;
  Leap::Vector * vector;

  Data_Get_Struct(self, Leap::Pointable, pointer);

  vector = new Leap::Vector(pointer->stabilizedTipPosition());

  return WrapVector(vector);
}
Пример #2
0
static VALUE tip_velocity(VALUE self)
{
  Leap::Pointable * pointer;
  Leap::Vector * vector;

  Data_Get_Struct(self, Leap::Pointable, pointer);

  vector = new Leap::Vector(pointer->tipVelocity());

  return WrapVector(vector);
}
Пример #3
0
static VALUE direction(VALUE self)
{
  Leap::Pointable * pointer;
  Leap::Vector * vector;

  Data_Get_Struct(self, Leap::Pointable, pointer);

  vector = new Leap::Vector(pointer->direction());

  return WrapVector(vector);
}
Пример #4
0
//updates an asteroid
void UpdateAsteroid(ASTEROID * a)
{
   if(a)
   {
      a->pos.x += a->vel.x;
      a->pos.y += a->vel.y;
      WrapVector(&a->pos);
      a->region = GetRegion(&a->pos, 0.5f * a->scale);

      a->clip_circle.center.x = a->pos.x;
      a->clip_circle.center.y = a->pos.y;

      if((a->rot += a->rot_vel) >= 360.0f)
         a->rot -= 360.0f;
   }
}