本文整理汇总了Java中com.jme3.scene.Spatial.getLocalScale方法的典型用法代码示例。如果您正苦于以下问题:Java Spatial.getLocalScale方法的具体用法?Java Spatial.getLocalScale怎么用?Java Spatial.getLocalScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.scene.Spatial
的用法示例。
在下文中一共展示了Spatial.getLocalScale方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paintTexture
import com.jme3.scene.Spatial; //导入方法依赖的package包/类
/**
* Paint texture.
*
* @param editingInput the editing input.
* @param contactPoint the contact point.
*/
private void paintTexture(@NotNull final EditingInput editingInput, @NotNull final Vector3f contactPoint) {
final Texture alphaTexture = getAlphaTexture();
if (alphaTexture == null) return;
final LocalObjects local = LocalObjects.get();
final Spatial terrainNode = notNull(getEditedModel());
final Terrain terrain = (Terrain) terrainNode;
final Image image = alphaTexture.getImage();
final Vector3f worldTranslation = terrainNode.getWorldTranslation();
final Vector3f localPoint = contactPoint.subtract(worldTranslation, local.nextVector());
final Vector3f localScale = terrainNode.getLocalScale();
final Vector2f uv = getPointPercentagePosition(terrain, localPoint, localScale, local.nextVector2f());
final Vector2f temp = local.nextVector2f();
final ColorRGBA color = local.nextColor();
final int layer = getLayer();
// get the radius of the brush in pixel-percent
float brushSize = getBrushSize() / (terrain.getTerrainSize() * localScale.getX());
float brushPower = getBrushPower();
if (editingInput == EditingInput.MOUSE_SECONDARY) {
brushPower *= -1;
}
// selectedTextureIndex/4 is an int floor, do not simplify the equation
final ObjectFloatObjectConsumer<ColorRGBA, Boolean> colorFunction = COLOR_FUNCTIONS[layer - ((layer / 4) * 4)];
doPaintAction(colorFunction, image, uv, temp, color, brushSize, false, brushPower);
image.setUpdateNeeded();
}