Skip to content

RawModel

ivanorsolic edited this page Apr 17, 2016 · 2 revisions

#This class represents a 3D model stored in memory. There are two things we need to know about a model once it is stored in memory:

  • The VAO ID
  • How many vertices there are in that model

So we use these Instance Variables:

private int vaoID;
private int vertexCount

Next up is a simple constructor:

public RawModel (int vaoID, int vertexCount){
    this.vaoID = vaoID;
    this.vertexCount = vertexCount;
   
}

Next, we have some getters because encapsulation is the shitz:

public int getVaoID() {
	return vaoID;
}

public int getVertexCount() {
	return vertexCount;
}

And that's pretty much it for the RawModel class.

##For quick reference, here is the full code:

package renderEngine;

public class RawModel {

		private int vaoID;
		private int vertexCount;
		
		public RawModel(int vaoID, int vertexCount){
			this.vaoID = vaoID;
			this.vertexCount = vertexCount;
		}

		public int getVaoID() {
			return vaoID;
		}

		public int getVertexCount() {
			return vertexCount;
		}
		
}

Clone this wiki locally