pythagoras.f.Point.mult()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(173)

本文整理了Java中pythagoras.f.Point.mult()方法的一些代码示例,展示了Point.mult()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Point.mult()方法的具体详情如下:
包路径:pythagoras.f.Point
类名称:Point
方法名:mult

Point.mult介绍

[英]Multiplies this point by a scale factor.
[中]将该点乘以比例因子。

代码示例

代码示例来源:origin: samskivert/pythagoras

/** Multiplies this point by a scale factor.
 * @return a a reference to this point, for chaining. */
public Point multLocal (float s) {
  return mult(s, this);
}

代码示例来源:origin: threerings/tripleplay

@Override public void onEnd (Pointer.Interaction iact) {
  // just dispatch a click if the pointer didn't move very far
  if (_maxDeltaSq < maxClickDeltaSq()) {
    clicked.emit(iact.event);
    return;
  }
  // if not, maybe impart some velocity
  float dragTime = (float)(iact.event.time - _prevStamp);
  if (dragTime > 0) {
    Point delta = new Point(_cur.x - _prev.x, _cur.y - _prev.y);
    Point dragVel = delta.mult(1 / dragTime);
    float dragSpeed = dragVel.distance(0, 0);
    if (dragSpeed > maxFlickSpeed) {
      dragVel.multLocal(maxFlickSpeed / dragSpeed);
      dragSpeed = maxFlickSpeed;
    }
    _vel.set(dragVel);
    _vel.multLocal(flickXfer);
    float sx = Math.signum(_vel.x), sy = Math.signum(_vel.y);
    _accel.x = -sx * friction;
    _accel.y = -sy * friction;
  }
}

代码示例来源:origin: com.samskivert/pythagoras

/** Multiplies this point by a scale factor.
 * @return a a reference to this point, for chaining. */
public Point multLocal (float s) {
  return mult(s, this);
}

相关文章