本文整理汇总了Java中com.jme3.math.ColorRGBA.randomColor方法的典型用法代码示例。如果您正苦于以下问题:Java ColorRGBA.randomColor方法的具体用法?Java ColorRGBA.randomColor怎么用?Java ColorRGBA.randomColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.math.ColorRGBA
的用法示例。
在下文中一共展示了ColorRGBA.randomColor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doCreateSpatial
import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
@Override
protected Spatial doCreateSpatial(Node parent) {
NewGeometrySettings cfg = new NewGeometrySettings();
Sphere b = new Sphere(
cfg.getSphereZSamples()
, cfg.getSpherRadialSamples()
, cfg.getSphereRadius()
, cfg.getSphereUseEvenSlices()
, cfg.getSphereInterior()
);
b.setMode(cfg.getSphereMode());
Geometry geom = new Geometry(cfg.getSphereName(), b);
Material mat = new Material(pm, "Common/MatDefs/Misc/Unshaded.j3md");
ColorRGBA c = cfg.getMatRandom() ?ColorRGBA.randomColor() : cfg.getMatColor();
mat.setColor("Color", c);
geom.setMaterial(mat);
parent.attachChild(geom);
return geom;
}
示例2: debugPath
import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
public static void debugPath(String debugId, List<Waypoint> waypoints) {
Node path = new Node();
Waypoint previous = null;
ColorRGBA lineColor = ColorRGBA.randomColor();
for (Waypoint p : waypoints) {
Spatial box = DebugUtils.createBox(0.2f, 0.2f, 0.2f, ColorRGBA.Red);
box.setLocalTranslation(p.getPosition());
path.attachChild(box);
if (previous != null) {
Spatial arrow = DebugUtils.createArrow(previous.getPosition(), p.getPosition(), lineColor);
arrow.scale(3);
Spatial line = DebugUtils.createLine(previous.getPosition(), p.getPosition(), lineColor);
path.attachChild(line);
path.attachChild(arrow);
}
previous = p;
}
addDebugObject("debugPath_" + debugId, path, false);
}
示例3: simpleInitApp
import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
Quad quadMesh = new Quad(512,512);
Geometry quad = new Geometry("Quad", quadMesh);
quad.setQueueBucket(Bucket.Gui);
mat = new Material(assetManager, "Common/MatDefs/Misc/ColoredTextured.j3md");
mat.setTexture("ColorMap", assetManager.loadTexture("Textures/ColoredTex/Monkey.png"));
quad.setMaterial(mat);
guiNode.attachChildAt(quad, 0);
nextColor = ColorRGBA.randomColor();
prevColor = ColorRGBA.Black;
}
示例4: simpleUpdate
import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
@Override
public void simpleUpdate(float tpf){
time += tpf;
if (time > 1f){
time -= 1f;
prevColor = nextColor;
nextColor = ColorRGBA.randomColor();
}
ColorRGBA currentColor = new ColorRGBA();
currentColor.interpolate(prevColor, nextColor, time);
mat.setColor("Color", currentColor);
}
示例5: doCreateSpatial
import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
@Override
protected Spatial doCreateSpatial(Node parent) {
NewGeometrySettings cfg = new NewGeometrySettings();
Box b = new Box(cfg.getBoxX(), cfg.getBoxY(), cfg.getBoxZ());
b.setMode(cfg.getBoxMode());
Geometry geom = new Geometry(cfg.getBoxName(), b);
Material mat = new Material(pm, "Common/MatDefs/Misc/Unshaded.j3md");
ColorRGBA c = cfg.getMatRandom() ?ColorRGBA.randomColor() : cfg.getMatColor();
mat.setColor("Color", c);
geom.setMaterial(mat);
parent.attachChild(geom);
return geom;
}
示例6: doCreateSpatial
import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
@Override
protected Spatial doCreateSpatial(Node parent) {
NewGeometrySettings cfg = new NewGeometrySettings();
Line b = new Line(cfg.getLineStart(), cfg.getLineEnd());
b.setMode(cfg.getLineMode());
Geometry geom = new Geometry(cfg.getLineName(), b);
Material mat = new Material(pm, "Common/MatDefs/Misc/Unshaded.j3md");
ColorRGBA c = cfg.getMatRandom() ?ColorRGBA.randomColor() : cfg.getMatColor();
mat.setColor("Color", c);
geom.setMaterial(mat);
parent.attachChild(geom);
return geom;
}