本文整理汇总了Java中com.jme3.math.FastMath.pow方法的典型用法代码示例。如果您正苦于以下问题:Java FastMath.pow方法的具体用法?Java FastMath.pow怎么用?Java FastMath.pow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.math.FastMath
的用法示例。
在下文中一共展示了FastMath.pow方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: camTakeOver
import com.jme3.math.FastMath; //导入方法依赖的package包/类
/**
* Forcefully takes over Camera adding functionality and placing it behind the character
* @param tpf Tickes Per Frame
*/
private void camTakeOver(float tpf) {
cam.setLocation(player.getLocalTranslation().add(-8, 2, 0));
cam.lookAt(player.getLocalTranslation(), Vector3f.UNIT_Y);
Quaternion rot = new Quaternion();
rot.fromAngleNormalAxis(camAngle, Vector3f.UNIT_Z);
cam.setRotation(cam.getRotation().mult(rot));
camAngle *= FastMath.pow(.99f, fpsRate * tpf);
}
示例2: updateFrustumSplits
import com.jme3.math.FastMath; //导入方法依赖的package包/类
/**
* Updates the frustum splits stores in <code>splits</code> using PSSM.
*/
public static void updateFrustumSplits(float[] splits, float near, float far, float lambda) {
for (int i = 0; i < splits.length; i++) {
float IDM = i / (float) splits.length;
float log = near * FastMath.pow((far / near), IDM);
float uniform = near + (far - near) * IDM;
splits[i] = log * lambda + uniform * (1.0f - lambda);
}
// This is used to improve the correctness of the calculations. Our main near- and farplane
// of the camera always stay the same, no matter what happens.
splits[0] = near;
splits[splits.length - 1] = far;
}
示例3: generateTag
import com.jme3.math.FastMath; //导入方法依赖的package包/类
protected byte[] generateTag() {
int width = ((int) FastMath.log(aliasCount, 256) + 1);
int count = aliasCount;
aliasCount++;
byte[] bytes = new byte[width];
for (int x = width - 1; x >= 0; x--) {
int pow = (int) FastMath.pow(256, x);
int factor = count / pow;
bytes[width - x - 1] = (byte) factor;
count %= pow;
}
return bytes;
}
示例4: apply
import com.jme3.math.FastMath; //导入方法依赖的package包/类
@Override
public float apply (float a) {
if (a <= 0.5f) {
a *= 2;
return FastMath.pow(value, power * (a - 1)) * FastMath.sin(a * 20) * 1.0955f / 2;
}
a = 1 - a;
a *= 2;
return 1 - (float)Math.pow(value, power * (a - 1)) * FastMath.sin((a) * 20) * 1.0955f / 2;
}
示例5: setData
import com.jme3.math.FastMath; //导入方法依赖的package包/类
@Override
public void setData(ActionData data) {
super.setData(data);
walkPosTotal = data.getAsInteger("walkPosTotal", walkPosTotal);
walkRadius = data.getAsFloat("walkRadius", walkRadius);
walkRadiusSquared = FastMath.pow(walkRadius, 2);
walkDiameterSquared = FastMath.pow(walkRadius * 2, 2);
waitingTimeMax = data.getAsFloat("waitingTimeMax", waitingTimeMax);
}
示例6: erase
import com.jme3.math.FastMath; //导入方法依赖的package包/类
private void erase(SceneEdit se, List<EntityData> sourceList, Vector3f eraseWorldPoint, float radius, int density) {
SafeArrayList<ControlTile> cts = se.getControlTiles();
Entity en;
float radiusSquared = FastMath.pow(radius, 2);
int eraseCount = 0;
EntityData tempEd;
for (ControlTile ct : cts.getArray()) {
if (eraseCount >= density) {
break;
}
if (!(ct.getTarget() instanceof Entity)) {
continue;
}
en = (Entity) ct.getTarget();
if (en.getSpatial().getWorldTranslation().distanceSquared(eraseWorldPoint) > radiusSquared) {
continue;
}
// 通ID匹配来擦除
for (int i = 0; i < sourceList.size(); i++) {
tempEd = sourceList.get(i);
if (tempEd.getId().equals(en.getData().getId())) {
se.removeControlTile(ct);
ectRemoveList.add(ct);
eraseCount++;
break;
}
}
}
}
示例7: eaxDbToAmp
import com.jme3.math.FastMath; //导入方法依赖的package包/类
private static final float eaxDbToAmp(float eaxDb){
float dB = eaxDb / 2000f;
return FastMath.pow(10f, dB);
}
示例8: setWalkRadius
import com.jme3.math.FastMath; //导入方法依赖的package包/类
/**
* 设置IDLE半径
* @param walkRadius
*/
public void setWalkRadius(float walkRadius) {
this.walkRadius = walkRadius;
this.walkRadiusSquared = FastMath.pow(walkRadius, 2);
this.walkDiameterSquared = FastMath.pow(walkRadius * 2, 2);
}