當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。