Add blob and fix some issues
This commit is contained in:
parent
5b4e67cbf0
commit
edca93fcfe
13 changed files with 237 additions and 67 deletions
26
frontend/src/scripts/drawing/drawables/drawable-blob.ts
Normal file
26
frontend/src/scripts/drawing/drawables/drawable-blob.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { IDrawable } from './i-drawable';
|
||||
import { IDrawableDescriptor } from './i-drawable-descriptor';
|
||||
import { settings } from '../settings';
|
||||
import { Blob } from '../../shapes/types/blob';
|
||||
|
||||
export class DrawableBlob extends Blob implements IDrawable {
|
||||
public static descriptor: IDrawableDescriptor = {
|
||||
uniformName: 'blobs',
|
||||
countMacroName: 'blobCount',
|
||||
shaderCombinationSteps: settings.shaderCombinations.blobSteps,
|
||||
};
|
||||
|
||||
public serializeToUniforms(uniforms: any): void {
|
||||
const uniformName = DrawableBlob.descriptor.uniformName;
|
||||
if (!uniforms.hasOwnProperty(uniformName)) {
|
||||
uniforms[uniformName] = [];
|
||||
}
|
||||
|
||||
uniforms[uniformName].push({
|
||||
headCenter: this.head.center,
|
||||
torsoCenter: this.torso.center,
|
||||
leftFootCenter: this.leftFoot.center,
|
||||
rightFootCenter: this.rightFoot.center,
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue