### Hierarchy

- Drawable
  - InvertedTunnel

## Index

### Constructors

- constructor

### Properties

- from
- fromRadius
- to
- toRadius

### Methods

- getObjectToSerialize
- minDistance

### Object literals

- descriptor

## Constructors

### constructor

- new InvertedTunnel(from: vec2, to: vec2, fromRadius: number, toRadius: number): InvertedTunnel

- - Defined in drawables/shapes/inverted-tunnel.ts:76

  #### Parameters

  - ##### from: vec2

  - ##### to: vec2

  - ##### fromRadius: number

  - ##### toRadius: number

  #### Returns InvertedTunnel

## Properties

### Readonly from

from: vec2

- Defined in drawables/shapes/inverted-tunnel.ts:79

### Readonly fromRadius

fromRadius: number

- Defined in drawables/shapes/inverted-tunnel.ts:81

### Readonly to

to: vec2

- Defined in drawables/shapes/inverted-tunnel.ts:80

### Readonly toRadius

toRadius: number

- Defined in drawables/shapes/inverted-tunnel.ts:82

## Methods

### Protected getObjectToSerialize

- getObjectToSerialize(transform2d: mat2d, transform1d: number): any

- Overrides Drawable.getObjectToSerialize

  - Defined in drawables/shapes/inverted-tunnel.ts:101

  #### Parameters

  - ##### transform2d: mat2d

  - ##### transform1d: number

  #### Returns any

### minDistance

- minDistance(target: vec2): number

- Overrides Drawable.minDistance

  - Defined in drawables/shapes/inverted-tunnel.ts:87

  #### Parameters

  - ##### target: vec2

  #### Returns number

## Object literals

### Static descriptor

descriptor: object

Overrides Drawable.descriptor

- Defined in drawables/shapes/inverted-tunnel.ts:13

### empty

empty: InvertedTunnel = new InvertedTunnel(vec2.create(), vec2.create(), 0, 0)

- Defined in drawables/shapes/inverted-tunnel.ts:75

### shaderCombinationSteps

shaderCombinationSteps: number[] = [0, 1, 4, 16, 32]

- Defined in drawables/shapes/inverted-tunnel.ts:74

### uniformCountMacroName

uniformCountMacroName: string = "INVERTED_TUNNEL_COUNT"

- Defined in drawables/shapes/inverted-tunnel.ts:73

### propertyUniformMapping

propertyUniformMapping: object

- Defined in drawables/shapes/inverted-tunnel.ts:67

### from

from: string = "froms"

- Defined in drawables/shapes/inverted-tunnel.ts:68

### fromRadius

fromRadius: string = "fromRadii"

- Defined in drawables/shapes/inverted-tunnel.ts:70

### toFromDelta

toFromDelta: string = "toFromDeltas"

- Defined in drawables/shapes/inverted-tunnel.ts:69

### toRadius

toRadius: string = "toRadii"

- Defined in drawables/shapes/inverted-tunnel.ts:71

### sdf

sdf: object

- Defined in drawables/shapes/inverted-tunnel.ts:14

### distanceFunctionName

distanceFunctionName: string = "invertedTunnelMinDistance"

- Defined in drawables/shapes/inverted-tunnel.ts:65

### isInverted

isInverted: true = true

- Defined in drawables/shapes/inverted-tunnel.ts:64

### shader

shader: string = `uniform vec2 froms[INVERTED_TUNNEL_COUNT];uniform vec2 toFromDeltas[INVERTED_TUNNEL_COUNT];uniform float fromRadii[INVERTED_TUNNEL_COUNT];uniform float toRadii[INVERTED_TUNNEL_COUNT];uniform sampler2D noiseTexture;#ifdef WEBGL2_IS_AVAILABLEfloat invertedTunnelTerrain(float h) {return texture(noiseTexture,vec2(h, 0.5))[0] - 0.5;}#elsefloat invertedTunnelTerrain(float h) {return texture2D(noiseTexture,vec2(h, 0.5))[0] - 0.5;}#endiffloat invertedTunnelMinDistance(vec2 target, out float colorIndex) {colorIndex = 3.0;float minDistance = -1000.0;for (int i = 0; i < INVERTED_TUNNEL_COUNT; i++) {vec2 targetFromDelta = target - froms[i];float h = dot(targetFromDelta, toFromDeltas[i])/ dot(toFromDeltas[i], toFromDeltas[i]);float clampedH = clamp(h, 0.0, 1.0);float currentDistance = -mix(fromRadii[i], toRadii[i], clampedH) + distance(targetFromDelta, toFromDeltas[i] * clampedH) - invertedTunnelTerrain(h) / 12.0;minDistance = max(minDistance, -currentDistance);}return minDistance;}`

- Defined in drawables/shapes/inverted-tunnel.ts:15