本文整理匯總了Java中com.jme3.math.Vector2f.divideLocal方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector2f.divideLocal方法的具體用法?Java Vector2f.divideLocal怎麽用?Java Vector2f.divideLocal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.jme3.math.Vector2f
的用法示例。
在下文中一共展示了Vector2f.divideLocal方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPointPercentagePosition
import com.jme3.math.Vector2f; //導入方法依賴的package包/類
private @NotNull Vector2f getPointPercentagePosition(@NotNull final Terrain terrain, @NotNull final Vector3f localPoint,
@NotNull final Vector3f localScale, @NotNull final Vector2f result) {
result.set(localPoint.x, -localPoint.z);
float scale = localScale.getX();
// already centered on Terrain's node origin (0,0)
float scaledSize = terrain.getTerrainSize() * scale;
result.addLocal(scaledSize / 2, scaledSize / 2); // shift the bottom left corner up to 0,0
result.divideLocal(scaledSize); // get the location as a percentage
return result;
}
示例2: getPointPercentagePosition
import com.jme3.math.Vector2f; //導入方法依賴的package包/類
public Vector2f getPointPercentagePosition(Terrain terrain, Vector3f worldLoc) {
Vector2f uv = new Vector2f(worldLoc.x,-worldLoc.z);
float scale = ((Node)terrain).getWorldScale().x;
// already centered on Terrain's node origin (0,0)
//uv.subtractLocal(((Node)terrain).getWorldTranslation().x*scale, ((Node)terrain).getWorldTranslation().z*scale); // center it on 0,0
float scaledSize = terrain.getTerrainSize()*scale;
uv.addLocal(scaledSize/2, scaledSize/2); // shift the bottom left corner up to 0,0
uv.divideLocal(scaledSize); // get the location as a percentage
return uv;
}
示例3: getPointPercentagePosition
import com.jme3.math.Vector2f; //導入方法依賴的package包/類
private Vector2f getPointPercentagePosition(Terrain terrain, Vector3f worldLoc) {
Vector2f uv = new Vector2f(worldLoc.x,-worldLoc.z);
float scale = ((Node)terrain).getWorldScale().x;
// already centered on Terrain's node origin (0,0)
//uv.subtractLocal(((Node)terrain).getWorldTranslation().x*scale, ((Node)terrain).getWorldTranslation().z*scale); // center it on 0,0
float scaledSize = terrain.getTerrainSize()*scale;
uv.addLocal(scaledSize/2, scaledSize/2); // shift the bottom left corner up to 0,0
uv.divideLocal(scaledSize); // get the location as a percentage
return uv;
}