本文整理匯總了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();
}