Add linting
This commit is contained in:
parent
76282a4cf7
commit
40a660b7cb
5 changed files with 232 additions and 329 deletions
|
|
@ -1,8 +1,8 @@
|
|||
import { mat2d, vec2 } from 'gl-matrix';
|
||||
import { Blob } from '../../shapes/types/blob';
|
||||
import { settings } from '../settings';
|
||||
import { IDrawable } from './i-drawable';
|
||||
import { IDrawableDescriptor } from './i-drawable-descriptor';
|
||||
import { settings } from '../settings';
|
||||
import { Blob } from '../../shapes/types/blob';
|
||||
import { vec2, mat2d } from 'gl-matrix';
|
||||
|
||||
export class DrawableBlob extends Blob implements IDrawable {
|
||||
public static descriptor: IDrawableDescriptor = {
|
||||
|
|
@ -11,32 +11,16 @@ export class DrawableBlob extends Blob implements IDrawable {
|
|||
shaderCombinationSteps: settings.shaderCombinations.blobSteps,
|
||||
};
|
||||
|
||||
public serializeToUniforms(
|
||||
uniforms: any,
|
||||
scale: number,
|
||||
transform: mat2d
|
||||
): void {
|
||||
const uniformName = DrawableBlob.descriptor.uniformName;
|
||||
if (!uniforms.hasOwnProperty(uniformName)) {
|
||||
public serializeToUniforms(uniforms: any, scale: number, transform: mat2d): void {
|
||||
const { uniformName } = DrawableBlob.descriptor;
|
||||
if (!Object.prototype.hasOwnProperty.call(uniforms, uniformName)) {
|
||||
uniforms[uniformName] = [];
|
||||
}
|
||||
|
||||
uniforms[uniformName].push({
|
||||
headCenter: vec2.transformMat2d(
|
||||
vec2.create(),
|
||||
this.head.center,
|
||||
transform
|
||||
),
|
||||
torsoCenter: vec2.transformMat2d(
|
||||
vec2.create(),
|
||||
this.torso.center,
|
||||
transform
|
||||
),
|
||||
leftFootCenter: vec2.transformMat2d(
|
||||
vec2.create(),
|
||||
this.leftFoot.center,
|
||||
transform
|
||||
),
|
||||
headCenter: vec2.transformMat2d(vec2.create(), this.head.center, transform),
|
||||
torsoCenter: vec2.transformMat2d(vec2.create(), this.torso.center, transform),
|
||||
leftFootCenter: vec2.transformMat2d(vec2.create(), this.leftFoot.center, transform),
|
||||
rightFootCenter: vec2.transformMat2d(
|
||||
vec2.create(),
|
||||
this.rightFoot.center,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { IDrawable } from './i-drawable';
|
||||
import { TunnelShape } from '../../shapes/types/tunnel-shape';
|
||||
import { IDrawableDescriptor } from './i-drawable-descriptor';
|
||||
import { settings } from '../settings';
|
||||
import { mat2d, vec2 } from 'gl-matrix';
|
||||
import TunnelShape from '../../shapes/types/tunnel-shape';
|
||||
import { settings } from '../settings';
|
||||
import { IDrawable } from './i-drawable';
|
||||
import { IDrawableDescriptor } from './i-drawable-descriptor';
|
||||
|
||||
export class DrawableTunnel extends TunnelShape implements IDrawable {
|
||||
public static descriptor: IDrawableDescriptor = {
|
||||
|
|
@ -11,23 +11,15 @@ export class DrawableTunnel extends TunnelShape implements IDrawable {
|
|||
shaderCombinationSteps: settings.shaderCombinations.lineSteps,
|
||||
};
|
||||
|
||||
public serializeToUniforms(
|
||||
uniforms: any,
|
||||
scale: number,
|
||||
transform: mat2d
|
||||
): void {
|
||||
const uniformName = DrawableTunnel.descriptor.uniformName;
|
||||
if (!uniforms.hasOwnProperty(uniformName)) {
|
||||
public serializeToUniforms(uniforms: any, scale: number, transform: mat2d): void {
|
||||
const { uniformName } = DrawableTunnel.descriptor;
|
||||
if (!Object.prototype.hasOwnProperty.call(uniforms, uniformName)) {
|
||||
uniforms[uniformName] = [];
|
||||
}
|
||||
|
||||
uniforms[uniformName].push({
|
||||
from: vec2.transformMat2d(vec2.create(), this.from, transform),
|
||||
toFromDelta: vec2.transformMat2d(
|
||||
vec2.create(),
|
||||
this.toFromDelta,
|
||||
transform
|
||||
),
|
||||
toFromDelta: vec2.transformMat2d(vec2.create(), this.toFromDelta, transform),
|
||||
fromRadius: this.fromRadius * scale,
|
||||
toRadius: this.toRadius * scale,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import { vec2, vec3, mat2d } from 'gl-matrix';
|
||||
import { GameObject } from '../../../objects/game-object';
|
||||
import { mat2d, vec2, vec3 } from 'gl-matrix';
|
||||
import { settings } from '../../settings';
|
||||
import { IDrawableDescriptor } from '../i-drawable-descriptor';
|
||||
import { ILight } from './i-light';
|
||||
|
|
@ -22,14 +21,10 @@ export class CircleLight implements ILight {
|
|||
return 0;
|
||||
}
|
||||
|
||||
public serializeToUniforms(
|
||||
uniforms: any,
|
||||
scale: number,
|
||||
transform: mat2d
|
||||
): void {
|
||||
const uniformName = CircleLight.descriptor.uniformName;
|
||||
public serializeToUniforms(uniforms: any, scale: number, transform: mat2d): void {
|
||||
const { uniformName } = CircleLight.descriptor;
|
||||
|
||||
if (!uniforms.hasOwnProperty(uniformName)) {
|
||||
if (!Object.prototype.hasOwnProperty.call(uniforms, uniformName)) {
|
||||
uniforms[uniformName] = [];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import { vec2 } from 'gl-matrix';
|
||||
import { IDrawable } from '../i-drawable';
|
||||
|
||||
export interface ILight extends IDrawable {}
|
||||
export type ILight = IDrawable;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import { ILight } from './i-light';
|
||||
import { vec2, vec3, mat2d } from 'gl-matrix';
|
||||
import { IDrawableDescriptor } from '../i-drawable-descriptor';
|
||||
import { mat2d, vec2, vec3 } from 'gl-matrix';
|
||||
import { settings } from '../../settings';
|
||||
import { GameObject } from '../../../objects/game-object';
|
||||
import { IDrawableDescriptor } from '../i-drawable-descriptor';
|
||||
import { ILight } from './i-light';
|
||||
|
||||
export class PointLight implements ILight {
|
||||
public static descriptor: IDrawableDescriptor = {
|
||||
|
|
@ -22,14 +21,10 @@ export class PointLight implements ILight {
|
|||
return vec2.distance(this.center, target) - this.radius;
|
||||
}
|
||||
|
||||
public serializeToUniforms(
|
||||
uniforms: any,
|
||||
scale: number,
|
||||
transform: mat2d
|
||||
): void {
|
||||
public serializeToUniforms(uniforms: any, scale: number, transform: mat2d): void {
|
||||
const listName = PointLight.descriptor.uniformName;
|
||||
|
||||
if (!uniforms.hasOwnProperty(listName)) {
|
||||
if (!Object.prototype.hasOwnProperty.call(uniforms, listName)) {
|
||||
uniforms[listName] = [];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue