本文整理汇总了Java中net.minecraft.util.math.MathHelper.floor_double_long方法的典型用法代码示例。如果您正苦于以下问题:Java MathHelper.floor_double_long方法的具体用法?Java MathHelper.floor_double_long怎么用?Java MathHelper.floor_double_long使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.math.MathHelper
的用法示例。
在下文中一共展示了MathHelper.floor_double_long方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateNoiseOctaves
import net.minecraft.util.math.MathHelper; //导入方法依赖的package包/类
/**
* pars:(par2,3,4=noiseOffset ; so that adjacent noise segments connect) (pars5,6,7=x,y,zArraySize),(pars8,10,12 =
* x,y,z noiseScale)
*/
public double[] generateNoiseOctaves(double[] noiseArray, int xOffset, int yOffset, int zOffset, int xSize, int ySize, int zSize, double xScale, double yScale, double zScale)
{
if (noiseArray == null)
{
noiseArray = new double[xSize * ySize * zSize];
}
else
{
for (int i = 0; i < noiseArray.length; ++i)
{
noiseArray[i] = 0.0D;
}
}
double d3 = 1.0D;
for (int j = 0; j < this.octaves; ++j)
{
double d0 = (double)xOffset * d3 * xScale;
double d1 = (double)yOffset * d3 * yScale;
double d2 = (double)zOffset * d3 * zScale;
long k = MathHelper.floor_double_long(d0);
long l = MathHelper.floor_double_long(d2);
d0 = d0 - (double)k;
d2 = d2 - (double)l;
k = k % 16777216L;
l = l % 16777216L;
d0 = d0 + (double)k;
d2 = d2 + (double)l;
this.generatorCollection[j].populateNoiseArray(noiseArray, d0, d1, d2, xSize, ySize, zSize, xScale * d3, yScale * d3, zScale * d3, d3);
d3 /= 2.0D;
}
return noiseArray;
}
示例2: getPositionLong
import net.minecraft.util.math.MathHelper; //导入方法依赖的package包/类
public static long getPositionLong(double value)
{
return MathHelper.floor_double_long(value * 4096.0D);
}
示例3: lfloor
import net.minecraft.util.math.MathHelper; //导入方法依赖的package包/类
public static long lfloor(double p_lfloor_0_)
{
return MathHelper.floor_double_long(p_lfloor_0_);
}