本文整理汇总了Java中org.rajawali3d.materials.Material.addPlugin方法的典型用法代码示例。如果您正苦于以下问题:Java Material.addPlugin方法的具体用法?Java Material.addPlugin怎么用?Java Material.addPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.rajawali3d.materials.Material
的用法示例。
在下文中一共展示了Material.addPlugin方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setMaterial
import org.rajawali3d.materials.Material; //导入方法依赖的package包/类
@Override
public void setMaterial(Material material) {
super.setMaterial(material);
IMaterialPlugin plugin = material.getPlugin(VertexAnimationMaterialPlugin.class);
if(plugin == null)
{
mMaterialPlugin = new VertexAnimationMaterialPlugin();
material.addPlugin(mMaterialPlugin);
}
else
{
mMaterialPlugin = (VertexAnimationMaterialPlugin)plugin;
}
}
示例2: DepthPass
import org.rajawali3d.materials.Material; //导入方法依赖的package包/类
public DepthPass(RajawaliScene scene, Camera camera) {
mPassType = PassType.DEPTH;
mScene = scene;
mCamera = camera;
mEnabled = true;
mClear = true;
mNeedsSwap = true;
Material mat = new Material();
mDepthPlugin = new DepthMaterialPlugin();
mat.addPlugin(mDepthPlugin);
setMaterial(mat);
}
示例3: updateChildMaterialWithLights
import org.rajawali3d.materials.Material; //导入方法依赖的package包/类
/**
* Update the lights on this child's material. This method should only
* be called when the lights collection is dirty. It will
* trigger compilation of all light-enabled shaders.
*
* @param child
*/
private void updateChildMaterialWithLights(Object3D child) {
Material material = child.getMaterial();
if(material != null && material.lightingEnabled())
material.setLights(mLights);
if(material!= null && mFogParams != null)
material.addPlugin(new FogMaterialPlugin(mFogParams));
int numChildren = child.getNumChildren();
for(int i=0; i<numChildren; i++) {
Object3D grandChild = child.getChildAt(i);
updateChildMaterialWithLights(grandChild);
}
}
示例4: addShadowMapMaterialPlugin
import org.rajawali3d.materials.Material; //导入方法依赖的package包/类
private void addShadowMapMaterialPlugin(Object3D o, ShadowMapMaterialPlugin materialPlugin) {
Material m = o.getMaterial();
if(m != null && m.lightingEnabled()) {
if(materialPlugin != null) {
m.addPlugin(materialPlugin);
} else if(mShadowMapMaterial != null) {
m.removePlugin(mShadowMapMaterial.getMaterialPlugin());
}
}
for(int i=0; i<o.getNumChildren(); i++)
addShadowMapMaterialPlugin(o.getChildAt(i), materialPlugin);
}
示例5: DepthPass
import org.rajawali3d.materials.Material; //导入方法依赖的package包/类
public DepthPass(Scene scene, Camera camera) {
mPassType = PassType.DEPTH;
mScene = scene;
mCamera = camera;
mEnabled = true;
mClear = true;
mNeedsSwap = true;
Material mat = new Material();
mDepthPlugin = new DepthMaterialPlugin();
mat.addPlugin(mDepthPlugin);
setMaterial(mat);
}
示例6: updateChildMaterialWithLights
import org.rajawali3d.materials.Material; //导入方法依赖的package包/类
/**
* Update the lights on this child's material. This method should only
* be called when the lights collection is dirty. It will
* trigger compilation of all light-enabled shaders.
*
* @param child
*/
private void updateChildMaterialWithLights(Object3D child) {
Material material = child.getMaterial();
if(material != null && material.lightingEnabled())
material.setLights(mLights);
if(material!= null && mFogParams != null)
material.addPlugin(new FogMaterialPlugin(mFogParams));
int numChildren = child.getNumChildren();
for(int i=0; i<numChildren; i++) {
Object3D grandChild = child.getChildAt(i);
updateChildMaterialWithLights(grandChild);
}
}
示例7: addShadowMapMaterialPlugin
import org.rajawali3d.materials.Material; //导入方法依赖的package包/类
private void addShadowMapMaterialPlugin(Object3D o, ShadowMapMaterialPlugin materialPlugin) {
Material m = o.getMaterial();
if(m != null && m.lightingEnabled()) {
if(materialPlugin != null) {
m.addPlugin(materialPlugin);
} else if(mShadowMapMaterial != null) {
m.removePlugin(mShadowMapMaterial.getMaterialPlugin());
}
}
for(int i=0; i<o.getNumChildren(); i++)
addShadowMapMaterialPlugin(o.getChildAt(i), materialPlugin);
}
示例8: createObjects
import org.rajawali3d.materials.Material; //导入方法依赖的package包/类
private void createObjects() throws TextureException, ParsingException, SkeletalAnimationException {
SkeletalAnimationObject3D root = new SkeletalAnimationObject3D();
root.uBoneMatrix = mBindPoseMatrix;
root.mInverseBindPoseMatrix = mInverseBindPoseMatrix;
root.setJoints(mJoints);
mRootObject = root;
for (int i = 0; i < mNumMeshes; ++i) {
SkeletonMeshData mesh = mMeshes[i];
SkeletalAnimationChildObject3D o = new SkeletalAnimationChildObject3D();
o.setData(
mesh.vertices, GLES20.GL_STREAM_DRAW,
mesh.normals, GLES20.GL_STREAM_DRAW,
mesh.textureCoordinates, GLES20.GL_STATIC_DRAW,
null, GLES20.GL_STATIC_DRAW,
mesh.indices, GLES20.GL_STATIC_DRAW,
false);
o.setMaxBoneWeightsPerVertex(mesh.maxBoneWeightsPerVertex);
o.setSkeletonMeshData(mesh.numVertices, mesh.boneVertices, mesh.numWeights, mesh.boneWeights);
o.setName("MD5Mesh_" + i);
o.setSkeleton(mRootObject);
o.setInverseZScale(true);
boolean hasTexture = mesh.textureName != null && mesh.textureName.length() > 0;
Material mat = new Material();
mat.addPlugin(new SkeletalAnimationMaterialPlugin(mNumJoints, mesh.maxBoneWeightsPerVertex));
mat.enableLighting(true);
mat.setDiffuseMethod(new DiffuseMethod.Lambert());
o.setMaterial(mat);
if (!hasTexture) {
o.setColor(0xff000000 + (int) (Math.random() * 0xffffff));
} else {
int identifier = mResources.getIdentifier(mesh.textureName, "drawable",
mResources.getResourcePackageName(mResourceId));
if (identifier == 0) {
throw new ParsingException("Couldn't find texture " + mesh.textureName);
}
mat.setColorInfluence(0);
mat.addTexture(new Texture("md5tex" + i, identifier));
}
mRootObject.addChild(o);
mesh.destroy();
mesh = null;
}
}
示例9: createObjects
import org.rajawali3d.materials.Material; //导入方法依赖的package包/类
private void createObjects() throws TextureException, ParsingException, SkeletalAnimationException {
SkeletalAnimationObject3D root = new SkeletalAnimationObject3D();
root.uBoneMatrix = mBindPoseMatrix;
root.mInverseBindPoseMatrix = mInverseBindPoseMatrix;
root.setJoints(mJoints);
mRootObject = root;
for (int i = 0; i < mNumMeshes; ++i) {
SkeletonMeshData mesh = mMeshes[i];
SkeletalAnimationChildObject3D o = new SkeletalAnimationChildObject3D();
o.setData(
mesh.vertices, GLES20.GL_STREAM_DRAW,
mesh.normals, GLES20.GL_STREAM_DRAW,
mesh.textureCoordinates, GLES20.GL_STATIC_DRAW,
null, GLES20.GL_STATIC_DRAW,
mesh.indices, GLES20.GL_STATIC_DRAW,
false);
o.setMaxBoneWeightsPerVertex(mesh.maxBoneWeightsPerVertex);
o.setSkeletonMeshData(mesh.numVertices, mesh.boneVertices, mesh.numWeights, mesh.boneWeights);
o.setName("MD5Mesh_" + i);
o.setSkeleton(mRootObject);
o.setInverseZScale(true);
boolean hasTexture = mesh.textureName != null && mesh.textureName.length() > 0;
Material mat = new Material();
mat.addPlugin(new SkeletalAnimationMaterialPlugin(mNumJoints, mesh.maxBoneWeightsPerVertex));
mat.enableLighting(true);
mat.setDiffuseMethod(new DiffuseMethod.Lambert());
o.setMaterial(mat);
if (!hasTexture) {
o.setColor(0xff000000 + (int) (Math.random() * 0xffffff));
} else {
int identifier = mResources.getIdentifier(mesh.textureName, "drawable",
mResources.getResourcePackageName(mResourceId));
if (identifier == 0) {
throw new ParsingException("Couldn't find texture " + mesh.textureName);
}
mat.setColorInfluence(0);
mat.addTexture(new Texture("md5tex" + i, identifier));
}
mRootObject.addChild(o);
mesh.destroy();
mesh = null;
}
}