Render in NDC
This commit is contained in:
parent
40a660b7cb
commit
05682dd2d5
1 changed files with 106 additions and 82 deletions
|
|
@ -1,33 +1,22 @@
|
|||
import { vec2 } from 'gl-matrix';
|
||||
import { IShape } from '../i-shape';
|
||||
import { BoundingBox } from '../bounding-box';
|
||||
import { Circle } from './circle';
|
||||
import { settings } from '../../drawing/settings';
|
||||
import { GameObject } from '../../objects/game-object';
|
||||
import { BoundingBox } from '../bounding-box';
|
||||
import { IShape } from '../i-shape';
|
||||
import { Circle } from './circle';
|
||||
|
||||
export class Blob implements IShape {
|
||||
private static readonly boundingCircleRadius = 19;
|
||||
|
||||
private static readonly headOffset = vec2.fromValues(0, 15);
|
||||
|
||||
private static readonly torsoOffset = vec2.fromValues(0, 0);
|
||||
|
||||
private static readonly leftFootOffset = vec2.fromValues(-5, -10);
|
||||
|
||||
private static readonly rightFootOffset = vec2.fromValues(5, -10);
|
||||
|
||||
public readonly isInverted = false;
|
||||
|
||||
protected boundingCircle = new Circle(vec2.create(), Blob.boundingCircleRadius);
|
||||
|
||||
protected head = new Circle(vec2.create(), settings.shaderMacros.headRadius);
|
||||
|
||||
protected torso = new Circle(vec2.create(), settings.shaderMacros.torsoRadius);
|
||||
|
||||
protected leftFoot = new Circle(vec2.create(), settings.shaderMacros.footRadius);
|
||||
|
||||
protected rightFoot = new Circle(vec2.create(), settings.shaderMacros.footRadius);
|
||||
|
||||
public constructor(center: vec2, public readonly gameObject: GameObject = null) {
|
||||
this.position = center;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue