Android Open Source - android-per-pixel-lighting-demo Vertex






From Project

Back to project page android-per-pixel-lighting-demo.

License

The source code is released under:

Apache License

If you think the Android project android-per-pixel-lighting-demo 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 com.pedroedrasousa.object3d;
//from w  ww . j a  va2s . co m
import com.pedroedrasousa.engine.Vec2;
import com.pedroedrasousa.engine.Vec3;

public class Vertex {
  private Vec3 mPos;
  private Vec3 mNormal;
  private Vec3 mTangent;
  private Vec3 mBinormal;
  private Vec2 mTexCoords;
  
  public Vertex(Vec3 pos, Vec2 texCoords, Vec3 normal, Vec3 tangent, Vec3 binormal) {
    mPos    = pos;
    mTexCoords  = texCoords;
    mNormal    = normal;  
    mTangent  = tangent;  
    mBinormal  = binormal;  
  }
  
  public Vec3 getPos() {
    return mPos;
  }
  
  public void setPos(Vec3 pos) {
    mPos = pos;
  }
  
  public Vec3 getNormal() {
    return mNormal;
  }
  
  public void setNormal(Vec3 normal) {
    mNormal = normal;
  }
  
  public Vec3 getTangent() {
    return mTangent;
  }

  public void setTangent(Vec3 tangent) {
    mTangent = tangent;
  }
  
  public Vec3 getBinormal() {
    return mBinormal;
  }

  public void setBinormal(Vec3 binormal) {
    mBinormal = binormal;
  }

  public Vec2 getTexCoords() {
    return mTexCoords;
  }

  public void setTexCoords(Vec2 texCoords) {
    mTexCoords = texCoords;
  }
  
  @Override
  public boolean equals(Object obj)
  {
     if (obj == null)
     {
        return false;
     }

     if (this.getClass() != obj.getClass())
     {
        return false;
     }

     if (!this.mPos.equals(((Vertex)obj).mPos))
     {
        return false;
     }
     
     if (!this.mNormal.equals(((Vertex)obj).mNormal))
     {
        return false;
     }
     
     if (!this.mTangent.equals(((Vertex)obj).mTangent))
     {
        return false;
     }

     if (!this.mBinormal.equals(((Vertex)obj).mBinormal))
     {
        return false;
     }
     
     if (!this.mTexCoords.equals(((Vertex)obj).mTexCoords))
     {
        return false;
     }   
     
     return true;
  }
}




Java Source Code List

com.pedroedrasousa.engine.EngineGLSurfaceView.java
com.pedroedrasousa.engine.Renderer.java
com.pedroedrasousa.engine.ShaderProgram.java
com.pedroedrasousa.engine.Texture.java
com.pedroedrasousa.engine.Vec2.java
com.pedroedrasousa.engine.Vec3.java
com.pedroedrasousa.object3d.Mesh.java
com.pedroedrasousa.object3d.Model.java
com.pedroedrasousa.object3d.ObjLoader.java
com.pedroedrasousa.object3d.Triangle.java
com.pedroedrasousa.object3d.Vertex.java
com.pedroedrasousa.perpixellightingdemo.MainActivity.java
com.pedroedrasousa.perpixellightingdemo.PerPixelLighting.java