public short[] getIndexes(DirectorProjection projection) { short[] indexes = new short[6]; indexes[0] = 0; indexes[1] = 1; indexes[2] = 2; indexes[3] = 2; indexes[4] = 1; indexes[5] = 3; return(indexes); }
public VertexPositionColorTexture[] getVertices(DirectorProjection projection) { VertexPositionColorTexture[] vertices = new VertexPositionColorTexture[4]; if (projection == DirectorProjection.Projection2D) { vertices[0] = new VertexPositionColorTexture( new Vector3(this.bl.vertices.x, this.bl.vertices.y, this.bl.vertices.z), new Color(this.tl.colors.r, this.tl.colors.g, this.tl.colors.b, this.tl.colors.a), new Vector2(this.bl.texCoords.u, this.bl.texCoords.v)); vertices[1] = new VertexPositionColorTexture( new Vector3(this.br.vertices.x, this.br.vertices.y, this.br.vertices.z), new Color(this.tr.colors.r, this.tr.colors.g, this.tr.colors.b, this.tr.colors.a), new Vector2(this.br.texCoords.u, this.br.texCoords.v)); vertices[2] = new VertexPositionColorTexture( new Vector3(this.tl.vertices.x, this.tl.vertices.y, this.tl.vertices.z), new Color(this.bl.colors.r, this.bl.colors.g, this.bl.colors.b, this.bl.colors.a), new Vector2(this.tl.texCoords.u, this.tl.texCoords.v)); vertices[3] = new VertexPositionColorTexture( new Vector3(this.tr.vertices.x, this.tr.vertices.y, this.tr.vertices.z), new Color(this.br.colors.r, this.br.colors.g, this.br.colors.b, this.br.colors.a), new Vector2(this.tr.texCoords.u, this.tr.texCoords.v)); } else { vertices[0] = new VertexPositionColorTexture( new Vector3(this.tl.vertices.x, this.tl.vertices.y, this.tl.vertices.z), new Color(this.tl.colors.r, this.tl.colors.g, this.tl.colors.b, this.tl.colors.a), new Vector2(this.tl.texCoords.u, this.tl.texCoords.v)); vertices[1] = new VertexPositionColorTexture( new Vector3(this.tr.vertices.x, this.tr.vertices.y, this.tr.vertices.z), new Color(this.tr.colors.r, this.tr.colors.g, this.tr.colors.b, this.tr.colors.a), new Vector2(this.tr.texCoords.u, this.tr.texCoords.v)); vertices[2] = new VertexPositionColorTexture( new Vector3(this.bl.vertices.x, this.bl.vertices.y, this.bl.vertices.z), new Color(this.bl.colors.r, this.bl.colors.g, this.bl.colors.b, this.bl.colors.a), new Vector2(this.bl.texCoords.u, this.bl.texCoords.v)); vertices[3] = new VertexPositionColorTexture( new Vector3(this.br.vertices.x, this.br.vertices.y, this.br.vertices.z), new Color(this.br.colors.r, this.br.colors.g, this.br.colors.b, this.br.colors.a), new Vector2(this.br.texCoords.u, this.br.texCoords.v)); } return(vertices); }
public VertexPositionColorTexture[] getVertices(DirectorProjection projection) { VertexPositionColorTexture[] vertices = new VertexPositionColorTexture[4]; if (projection == DirectorProjection.Projection2D) { vertices[0] = new VertexPositionColorTexture( new Vector3(this.bl.vertices.x, this.bl.vertices.y, this.bl.vertices.z), new Color(this.tl.colors.r, this.tl.colors.g, this.tl.colors.b, this.tl.colors.a), new Vector2(this.bl.texCoords.u, this.bl.texCoords.v)); vertices[1] = new VertexPositionColorTexture( new Vector3(this.br.vertices.x, this.br.vertices.y, this.br.vertices.z), new Color(this.tr.colors.r, this.tr.colors.g, this.tr.colors.b, this.tr.colors.a), new Vector2(this.br.texCoords.u, this.br.texCoords.v)); vertices[2] = new VertexPositionColorTexture( new Vector3(this.tl.vertices.x, this.tl.vertices.y, this.tl.vertices.z), new Color(this.bl.colors.r, this.bl.colors.g, this.bl.colors.b, this.bl.colors.a), new Vector2(this.tl.texCoords.u, this.tl.texCoords.v)); vertices[3] = new VertexPositionColorTexture( new Vector3(this.tr.vertices.x, this.tr.vertices.y, this.tr.vertices.z), new Color(this.br.colors.r, this.br.colors.g, this.br.colors.b, this.br.colors.a), new Vector2(this.tr.texCoords.u, this.tr.texCoords.v)); } else { vertices[0] = new VertexPositionColorTexture( new Vector3(this.tl.vertices.x, this.tl.vertices.y, this.tl.vertices.z), new Color(this.tl.colors.r, this.tl.colors.g, this.tl.colors.b, this.tl.colors.a), new Vector2(this.tl.texCoords.u, this.tl.texCoords.v)); vertices[1] = new VertexPositionColorTexture( new Vector3(this.tr.vertices.x, this.tr.vertices.y, this.tr.vertices.z), new Color(this.tr.colors.r, this.tr.colors.g, this.tr.colors.b, this.tr.colors.a), new Vector2(this.tr.texCoords.u, this.tr.texCoords.v)); vertices[2] = new VertexPositionColorTexture( new Vector3(this.bl.vertices.x, this.bl.vertices.y, this.bl.vertices.z), new Color(this.bl.colors.r, this.bl.colors.g, this.bl.colors.b, this.bl.colors.a), new Vector2(this.bl.texCoords.u, this.bl.texCoords.v)); vertices[3] = new VertexPositionColorTexture( new Vector3(this.br.vertices.x, this.br.vertices.y, this.br.vertices.z), new Color(this.br.colors.r, this.br.colors.g, this.br.colors.b, this.br.colors.a), new Vector2(this.br.texCoords.u, this.br.texCoords.v)); } return vertices; }
public short[] getIndexes(DirectorProjection projection) { short[] indexes = new short[6]; indexes[0] = 0; indexes[1] = 1; indexes[2] = 2; indexes[3] = 2; indexes[4] = 1; indexes[5] = 3; return indexes; }
public virtual bool Init() { const double DefaultFPS = 60.0; this._animationInterval = 1.0 / DefaultFPS; this.IsPaused = false; this._isPurgeDirecotorInNextLoop = false; this._contentScaleFactor = 1.0f; // Set default projection (3D) this._projection = DirectorProjection.ProjectionDefault; this.Projection = DirectorProjection.ProjectionDefault; Application.SharedApplication.ScreenScaleFactor = this.ContentScaleFactor; Application.SharedApplication.TouchDelegate = CCTouchDispatcher.sharedDispatcher(); CCTouchDispatcher.sharedDispatcher().IsDispatchEvents = true; return true; }