public void SetVertices <T>(IPhoton photon, T[] vertexData, int vertexOffset, int numVertices, short[] indexData, int indexOffset, int primitiveCount, VertexDeclaration vertexDeclaration) where T : struct { GraphicsDevice.DrawUserIndexedPrimitives <T>(this.PrimitiveType, vertexData, vertexOffset, numVertices, indexData, indexOffset, primitiveCount, vertexDeclaration); }
private IEnumerator ThrowRoutine() { for (int i = 0; i < photonsCount; i++) { var pooledPhotonObject = offsetObjectPooler.Pull(); pooledPhotonObject.GameObject.SetActive(true); IPhoton photon = pooledPhotonObject.GameObject.GetComponent <IPhoton>(); photon.Throw(pooledPhotonObject.GameObject.transform.position, transform.forward, startEnergy); yield return(new WaitForEndOfFrame()); } }
private void Render(GameTime gameTime, IAether particle) { Matrix worldTransform; LeptonsManager.GetWorldTransform(particle, out worldTransform); IPhoton photon = particle as IPhoton; IMaterial material = (photon != null) ? photon.Material : null; if (photon != null && material != null) { ((IShaderMatrices)material).World = worldTransform; ((IShaderMatrices)material).View = this.View; ((IShaderMatrices)material).Projection = this.Projection; material.Apply(); material.ApplyTextures(photon.Textures); photon.Accept(material); return; } return; }
public IPhoton GeneratePhoton() { IPhoton photon = null; if (RadiosityHelper.ImportanceMap == null) { photon = new Photon(new Vector3(originX + ((x + 1) * distanceX), originY + ((y + 1) * distanceY), originZ - 1f), Direction, color); x++; if (x >= countX) { y++; x = 0; } } else { int tempX = x, tempY = y; int height = RadiosityHelper.ImportanceMap.GetLength(1); int width = RadiosityHelper.ImportanceMap.GetLength(0); if (pixelsLeft == 0) { // scan for an "on" pixel while (y < height) { while (x < width) { if (RadiosityHelper.ImportanceMap[x, y]) { break; } x++; } x = 0; y++; } if (y >= height) { // none found x = tempX; y = tempY; } curPixels = pixelsLeft = perMapPixel + (int)Math.Floor(accumulator); accumulator += remainderPerPixel; } if (pixelsLeft != 0) { if (pixelsLeft == 1) { photon = new Photon(new Vector3(bounds.X.Lower + (x * distanceX), bounds.Y.Lower + (y * distanceY), bounds.Z.Upper), Direction, color); } else { // TODO: do this correctly by evenly distributing within this pixel. // When doing this, be sure to do pixelWidth / (pixelsAcross + 1) etc so you don't spawn two photons in the same place. photon = new Photon(new Vector3(bounds.X.Lower + (x * distanceX), bounds.Y.Lower + (y * distanceY), bounds.Z.Upper), Direction, color); //System.Diagnostics.Debugger.Break(); } pixelsLeft--; } } return(photon); }
public bool IsEnabled(IPhoton item) { return(_visibleParticles.Contains(item)); }
public virtual void Disable(IPhoton item) { _visibleParticles.Remove(item); }
public virtual void Enable(IPhoton item) { _visibleParticles.Add(item); }
public void SetVertices(IPhoton photon, VertexBuffer vertexBuffer, int baseVertex, int minVertexIndex, int numVertices, IndexBuffer indexBuffer, int startIndex, int primitiveCount) { DeviceContext.PrimitiveType = this.PrimitiveType; DeviceContext.SetVertices(photon, vertexBuffer, baseVertex, minVertexIndex, numVertices, indexBuffer, startIndex, primitiveCount); }
public void SetVertices <T>(IPhoton photon, T[] vertexData, int vertexOffset, int numVertices, short[] indexData, int indexOffset, int primitiveCount, VertexDeclaration vertexDeclaration) where T : struct { DeviceContext.PrimitiveType = this.PrimitiveType; DeviceContext.SetVertices(photon, vertexData, vertexOffset, numVertices, indexData, indexOffset, primitiveCount, vertexDeclaration); }
public void SetVertices <T>(IPhoton photon, int offsetInBytes, T[] data, int startIndex, int elementCount, int vertexStride) where T : struct { DeviceContext.PrimitiveType = this.PrimitiveType; DeviceContext.SetVertices(photon, offsetInBytes, data, startIndex, elementCount, vertexStride); }
public void SetVertices <T>(IPhoton photon, T[] data) where T : struct { ((DeviceContextMG)DeviceContext).PrimitiveType = this.PrimitiveType; DeviceContext.SetVertices(photon, data); }
public void SetVertices(IPhoton photon, VertexBuffer vertexBuffer, int baseVertex, int minVertexIndex, int numVertices, IndexBuffer indexBuffer, int startIndex, int primitiveCount) { GraphicsDevice.SetVertexBuffer(vertexBuffer); GraphicsDevice.Indices = indexBuffer; GraphicsDevice.DrawIndexedPrimitives(this.PrimitiveType, baseVertex, 0, numVertices, startIndex, primitiveCount); }
public void SetVertices <T>(IPhoton photon, int offsetInBytes, T[] data, int startIndex, int elementCount, int vertexStride) where T : struct { throw new NotImplementedException(); }
public void SetVertices <T>(IPhoton photon, T[] vertexData) where T : struct { throw new NotImplementedException(); }