当前位置: 首页>>代码示例>>Java>>正文


Java FastMath.pow方法代码示例

本文整理汇总了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);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:14,代码来源:CubeField.java

示例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;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:17,代码来源:PssmShadowUtil.java

示例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;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:14,代码来源:BinaryExporter.java

示例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;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:11,代码来源:Interpolation.java

示例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);
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:12,代码来源:PatrolIdleAction.java

示例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;
            }
        }
    }
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:30,代码来源:EraseTool.java

示例7: eaxDbToAmp

import com.jme3.math.FastMath; //导入方法依赖的package包/类
private static final float eaxDbToAmp(float eaxDb){
    float dB = eaxDb / 2000f;
    return FastMath.pow(10f, dB);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:5,代码来源:Environment.java

示例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);
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:10,代码来源:PatrolIdleAction.java


注:本文中的com.jme3.math.FastMath.pow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。