Android Open Source - BoxingGame Material






From Project

Back to project page BoxingGame.

License

The source code is released under:

Apache License

If you think the Android project BoxingGame listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package uk.co.o2.android.roboexample.opengl.models;
//from w w w  .j a  v a2  s  .c om
import org.jetbrains.annotations.NotNull;


public class Material {
    private float[] mEmissive = new float[]{0.0f, 0.0f, 0.0f};
    private float[] mAmbient = new float[] {1.0f, 1.0f, 1.0f};
    private float[] mDiffuse = new float[] {1.0f, 1.0f, 1.0f};
    private float[] mSpecular = new float[] {1.0f, 1.0f, 1.0f};

    private float mSpecularShininess = 5.0f;
    private float mAlpha = 1.0f;


    public Material() {
    }

    public Material(@NotNull float[] mEmissive,
                    @NotNull float[] mAmbient,
                    @NotNull float[] mDiffuse,
                    @NotNull float[] mSpecular, float mSpecularShininess, float mAlpha) {
        this.mEmissive = mEmissive;
        this.mAmbient = mAmbient;
        this.mDiffuse = mDiffuse;
        this.mSpecular = mSpecular;
        this.mSpecularShininess = mSpecularShininess;
        this.mAlpha = mAlpha;
    }

    public void setEmissive(float r, float g, float b) {
        mEmissive[0] = r;
        mEmissive[1] = g;
        mEmissive[2] = b;
    }

    public void setDiffuse(float r, float g, float b) {
        mDiffuse[0] = r;
        mDiffuse[1] = g;
        mDiffuse[2] = b;
    }

    public void setAmbient(float r, float g, float b) {
        mAmbient[0] = r;
        mAmbient[1] = g;
        mAmbient[2] = b;
    }


    public void setSpecular(float r, float g, float b) {
        mSpecular[0] = r;
        mSpecular[1] = g;
        mSpecular[2] = b;
    }

    public void setSpecularShininess(float specularShininess) {
        this.mSpecularShininess = specularShininess;
    }

    public void setAlpha(float alpha) {
        this.mAlpha = alpha;
    }

    public float[] getEmissive() {
        return mEmissive;
    }

    public float[] getAmbient() {
        return mAmbient;
    }

    public float[] getDiffuse() {
        return mDiffuse;
    }

    public float[] getSpecular() {
        return mSpecular;
    }

    public float getSpecularShininess() {
        return mSpecularShininess;
    }

    public float getAlpha() {
        return mAlpha;
    }
}




Java Source Code List

uk.co.o2.android.roboexample.ApplicationTest.java
uk.co.o2.android.roboexample.MyActivity.java
uk.co.o2.android.roboexample.opengl.MyGLRenderer.java
uk.co.o2.android.roboexample.opengl.MyGLSurfaceView.java
uk.co.o2.android.roboexample.opengl.models.Camera.java
uk.co.o2.android.roboexample.opengl.models.CollisionStatus.java
uk.co.o2.android.roboexample.opengl.models.Cube.java
uk.co.o2.android.roboexample.opengl.models.Material.java
uk.co.o2.android.roboexample.opengl.models.MeshEx.java
uk.co.o2.android.roboexample.opengl.models.Object3D.java
uk.co.o2.android.roboexample.opengl.models.Orientation.java
uk.co.o2.android.roboexample.opengl.models.Physics.java
uk.co.o2.android.roboexample.opengl.models.PointLight.java
uk.co.o2.android.roboexample.opengl.models.Shader.java
uk.co.o2.android.roboexample.opengl.models.Texture.java
uk.co.o2.android.roboexample.opengl.models.Vector3.java