本文整理了Java中pythagoras.f.Point.mult()
方法的一些代码示例,展示了Point.mult()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Point.mult()
方法的具体详情如下:
包路径:pythagoras.f.Point
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!