Ejemplo n.º 1
0
 private void TunnelSectionCreated(object sender, Tunnel.TunnelSectionCreatedEventArgs e)
 {
     if (Level != null)
     {
         Level.GenerateElements(this, e);
     }
 }
Ejemplo n.º 2
0
        public Matrix GetNewElementTranform(int section, int pos, Tunnel.TunnelSectionCreatedEventArgs e)
        {
            float angle = ((float)(2 * Math.PI) / (float)e.tunnelSection.NumSegments) * section;

            angle += (float)Math.PI / (float)e.tunnelSection.NumSegments;

            float cellSize = _tunnel.CellSize;

            return(Matrix.CreateTranslation(new Vector3(0.0f,
                                                        (float)Math.Sqrt(e.tunnelSection.Radius * e.tunnelSection.Radius - (cellSize / 2) * (cellSize / 2)) - cellSize / 2,
                                                        (float)pos * -e.tunnelSection.CellSize + e.tunnelSection.CellSize / 2))
                   * Matrix.CreateRotationZ(angle));
        }