本文整理匯總了Java中com.jme3.material.Material.setBoolean方法的典型用法代碼示例。如果您正苦於以下問題:Java Material.setBoolean方法的具體用法?Java Material.setBoolean怎麽用?Java Material.setBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.jme3.material.Material
的用法示例。
在下文中一共展示了Material.setBoolean方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: render
import com.jme3.material.Material; //導入方法依賴的package包/類
public void render( List<Prof> ofs, Tweed tweed, ColorRGBA col, Node n ) {
// Random randy = new Random(ofs.hashCode());
Material mat = new Material( tweed.getAssetManager(), "Common/MatDefs/Light/Lighting.j3md" );
// ColorRGBA col = new ColorRGBA(
// randy.nextFloat(),
// 0.2f+ 0.5f * randy.nextFloat(),
// 0.5f+ 0.5f * randy.nextFloat(), 1);
mat.setColor( "Diffuse", col );
mat.setColor( "Ambient", col.mult( 0.1f ) );
mat.setBoolean( "UseMaterialColors", true );
for (Prof p : ofs) {
Geometry g = new Geometry();
g.setMesh( p.renderStrip( TweedSettings.settings.profileHSampleDist/2, null ) );
g.setMaterial( mat );
n.attachChild( g );
}
}
示例2: calculate
import com.jme3.material.Material; //導入方法依賴的package包/類
@Override
public void calculate() {
for (Spatial s : gNode.getChildren())
s.removeFromParent();
Mesh mesh = new Mesh();
mesh.setMode( Mode.Points );
Vector3f[] verts = new Vector3f[cubes.size()];
for (int i = 0; i < cubes.size(); i++) {
verts[ i ] = new com.jme3.math.Vector3f( (float)cubes.get( i ).x, (float)cubes.get( i ).y, (float)cubes.get( i ).z );
}
mesh.setBuffer( VertexBuffer.Type.Position, 3, BufferUtils.createFloatBuffer( verts ) );
Material mat1 = new Material( tweed.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md" );
mat1.setBoolean( "VertexColor", true );
Geometry depth = new Geometry( "depth", mesh );
depth.setMaterial( mat1 );
depth.updateModelBound();
depth.updateGeometricState();
gNode.attachChild(depth);
super.calculate();
}
示例3: applyShadedMat
import com.jme3.material.Material; //導入方法依賴的package包/類
private static void applyShadedMat(Entity entity, Spatial spatial, AssetManager assetManager){
Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
mat.setBoolean("UseMaterialColors",true);
mat.setColor("Diffuse", entity.get(ShadedColor.class).getDiffuse());
spatial.setMaterial(mat);
}