本文整理汇总了Java中net.jafama.FastMath.sinQuick方法的典型用法代码示例。如果您正苦于以下问题:Java FastMath.sinQuick方法的具体用法?Java FastMath.sinQuick怎么用?Java FastMath.sinQuick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.jafama.FastMath
的用法示例。
在下文中一共展示了FastMath.sinQuick方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: logicLoop
import net.jafama.FastMath; //导入方法依赖的package包/类
public void logicLoop(float calcX, float deltaX) {
this.mouthCurvePos = this.parent.getPos().add(this.pos).addX(0.5f * this.size.x).addX(-calcX);
this.mouthCurveTimer.logicLoop();
float maxDelta = this.size.y * 0.5f * this.parent.getState().getMouthAmplitude();
while (this.mouthCurveTimer.timeUp()) {
this.mouthCurveTimer.reset();
Vec newVec = new Vec(calcX, (float) (FastMath.tan(calcX * 10) * FastMath.sinQuick(calcX * 4) * FastMath.cosQuick(calcX * 0.5f) * maxDelta));
if (newVec.y > maxDelta) {
newVec = newVec.setY(maxDelta);
}
if (newVec.y < -maxDelta) {
newVec = newVec.setY(-maxDelta);
}
this.mouthCurve.add(newVec);
}
Iterator<Vec> it = this.mouthCurve.iterator();
while (it.hasNext()) {
if (it.next().x <= calcX - this.size.x) {
it.remove();
} else {
break;
}
}
}
示例2: innerLogicLoop
import net.jafama.FastMath; //导入方法依赖的package包/类
@Override
protected void innerLogicLoop() {
this.x += this.deltaTime / 1000F;
if (Coin.SIN != this.sin) {
this.sin = Coin.SIN;
this.setSize(new Vec((float) (0.7f * this.sin), 0.7f));
return;
}
Coin.SIN = this.sin = FastMath.sinQuick(this.x * 3);
this.setSize(new Vec((float) (0.7f * this.sin), 0.7f));
}
示例3: innerLogicLoop
import net.jafama.FastMath; //导入方法依赖的package包/类
@Override
protected void innerLogicLoop() {
this.x += this.deltaTime / 1000F;
this.sin = FastMath.sinQuick(this.x * 6);
this.setSize(BluePill.SIZE.scalar((float) this.sin));
}
示例4: innerLogicLoop
import net.jafama.FastMath; //导入方法依赖的package包/类
@Override
public void innerLogicLoop() {
super.innerLogicLoop();
if (this.nextPosTimer != null) {
this.nextPosTimer.logicLoop();
}
// add deltaTime with factor to local x (1000 to get u/s)
float deltaX = this.deltaTime * this.getState().getTimeFactor() / 1000;
this.calcX += deltaX;
// calculate and update position
Vec scaleVec = new Vec(//
(float) FastMath.sinQuick(RocketBoss.MOVEMENT_PERIOD.x * this.calcX), (float) FastMath.cosQuick(RocketBoss.MOVEMENT_PERIOD.y * this.calcX));
Vec scaledUnit = RocketBoss.MOVEMENT_RANGE.multiply(scaleVec);
this.setPos(this.getCurrentBasePos().add(scaledUnit));
this.mouth.logicLoop(this.calcX, deltaX);
// spawn particles
this.particleTimer.logicLoop();
// this.paricleTimer.removeTime(this.deltaTime);
if (this.particleTimer.timeUp()) {
this.particleTimer.reset();
// RocketBoss.sparkParticles.spawn(this.getScene(),
// this.getPos().addX(-this.getXSignum() * this.getSize().x /
// 2));
for (int i = -1; i <= 1; i += 2) {
RocketBoss.jetSparkSpawner.spawn(this.getScene(), this.getPos().add(RocketBoss.PARTICLE_SPAWN_POS.scalar(i, 1)));
}
}
Iterator<Arm> it = this.arms.iterator();
while (it.hasNext()) {
it.next().logicLoop(deltaX, this.calcX);
}
if (this.brain == null) {
this.brain = new Brain(this, this.team);
this.getScene().addGameElement(this.brain);
}
}
示例5: fn
import net.jafama.FastMath; //导入方法依赖的package包/类
private float fn(float y) {
return this.parent.getXSignum() * this.curveA * (float) FastMath
.sinQuick(this.getParent().getState().getTimeFactor() * (y / this.maxLengthY) * (2 * Math.PI));
}
示例6: sin
import net.jafama.FastMath; //导入方法依赖的package包/类
/**
* Calculate the sin of x and y.
*
* @return a new vector (sinx, siny)
*/
public Vec sin() {
return new Vec((float) FastMath.sinQuick(this.x), (float) FastMath.sinQuick(this.y));
}