Refactor shapes
This commit is contained in:
parent
eb39846b75
commit
006ab3c4e6
24 changed files with 203 additions and 256 deletions
26
frontend/src/scripts/drawing/drawables/drawable-tunnel.ts
Normal file
26
frontend/src/scripts/drawing/drawables/drawable-tunnel.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { IDrawable } from './i-drawable';
|
||||
import { TunnelShape } from '../../shapes/types/tunnel-shape';
|
||||
import { IDrawableDescriptor } from './i-drawable-descriptor';
|
||||
import { settings } from '../settings';
|
||||
|
||||
export class DrawableTunnel extends TunnelShape implements IDrawable {
|
||||
public static descriptor: IDrawableDescriptor = {
|
||||
uniformName: 'lines',
|
||||
countMacroName: 'lineCount',
|
||||
shaderCombinationSteps: settings.shaderCombinations.lineSteps,
|
||||
};
|
||||
|
||||
public serializeToUniforms(uniforms: any): void {
|
||||
const uniformName = DrawableTunnel.descriptor.uniformName;
|
||||
if (!uniforms.hasOwnProperty(uniformName)) {
|
||||
uniforms[uniformName] = [];
|
||||
}
|
||||
|
||||
uniforms[uniformName].push({
|
||||
from: this.from,
|
||||
toFromDelta: this.toFromDelta,
|
||||
fromRadius: this.fromRadius,
|
||||
toRadius: this.toRadius,
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue