Finish documentation

This commit is contained in:
schmelczerandras 2020-09-28 16:26:55 +02:00
parent 49473bf905
commit 31fcfd3d6b
86 changed files with 1383 additions and 8485 deletions

View file

@ -1,11 +1,36 @@
import { mat2d, vec2 } from 'gl-matrix';
import { DrawableDescriptor } from './drawable-descriptor';
/**
* Base class of every drawable object.
*
* To create your own drawables, you need to subclass from this.
*
* > Although lights are also subclasses of Drawable, you cannot create your own light sources.
*/
export abstract class Drawable {
// This should be overriden by inherited classes
/**
* This should be defined in inherited classes.
*/
public static readonly descriptor: DrawableDescriptor;
/**
* The lower bound of the distance between the target and the object.
*
* It can return 0 by default, the only consequence of this, is a reduced performance.
* Because this object won't benefit from tile-based rendering.
* @param target
*/
public abstract minDistance(target: vec2): number;
/**
* Return the values that should be given to the shaders through uniform inputs.
*
* @param transform2d position-like properties should be transformed by this matrix
* before being returned.
* @param transform1d scalar properties should be transformed by this number
* before being returned.
*/
protected abstract getObjectToSerialize(transform2d: mat2d, transform1d: number): any;
public serializeToUniforms(