WIP
This commit is contained in:
parent
24cc572e47
commit
345e183e34
30 changed files with 628 additions and 187 deletions
|
|
@ -2,6 +2,8 @@ import { ILight } from './i-light';
|
|||
import { vec2, vec3 } from 'gl-matrix';
|
||||
import { IDrawableDescriptor } from '../i-drawable-descriptor';
|
||||
import { settings } from '../../settings';
|
||||
import { ImmutableBoundingBox } from '../../../physics/containers/immutable-bounding-box';
|
||||
import { GameObject } from '../../../objects/game-object';
|
||||
|
||||
export class PointLight implements ILight {
|
||||
public static descriptor: IDrawableDescriptor = {
|
||||
|
|
@ -10,13 +12,16 @@ export class PointLight implements ILight {
|
|||
shaderCombinationSteps: settings.shaderCombinations.pointLightSteps,
|
||||
};
|
||||
|
||||
constructor(
|
||||
public constructor(
|
||||
public readonly owner: GameObject,
|
||||
public center: vec2,
|
||||
public radius: number,
|
||||
public color: vec3,
|
||||
public lightness: number
|
||||
) {}
|
||||
|
||||
boundingBox: ImmutableBoundingBox;
|
||||
|
||||
public distance(target: vec2): number {
|
||||
return vec2.distance(this.center, target) - this.radius;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue