Add Object 3d
This commit is contained in:
parent
48983d7196
commit
28e0f60445
11
source/GLRender/BaseCube.ts
Normal file
11
source/GLRender/BaseCube.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { GLContextObject } from "./GLContext";
|
||||
|
||||
class BaseCube extends GLContextObject {
|
||||
|
||||
onLoad() {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
}
|
||||
|
||||
export default GLContextObject;
|
||||
export { GLContextObject };
|
@ -1,5 +1,6 @@
|
||||
import { Emitter, EventType } from "@Model/Emitter";
|
||||
import BasicRenderer from "./BasicRenderer";
|
||||
import Camera from "./Camera";
|
||||
|
||||
export type GLContext = WebGL2RenderingContext | WebGLRenderingContext;
|
||||
|
||||
@ -13,7 +14,16 @@ export abstract class GLContextObject<
|
||||
/**
|
||||
* GL 上下文
|
||||
*/
|
||||
protected gl: GLContext = undefined as any;
|
||||
protected get gl(): GLContext {
|
||||
return this.renderer.gl;
|
||||
};
|
||||
|
||||
/**
|
||||
* 相机
|
||||
*/
|
||||
protected get camera(): Camera {
|
||||
return this.renderer.camera;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用的渲染器
|
||||
@ -32,7 +42,6 @@ export abstract class GLContextObject<
|
||||
*/
|
||||
public bindRenderer(renderer: BasicRenderer): this {
|
||||
this.renderer = renderer;
|
||||
this.gl = this.renderer.gl;
|
||||
this.onLoad();
|
||||
return this;
|
||||
}
|
||||
|
@ -1,8 +0,0 @@
|
||||
import { GLContextObject } from "./GLContext";
|
||||
import { EventType } from "@Model/Emitter";
|
||||
|
||||
export abstract class GLObject3D<
|
||||
E extends Record<EventType, any> = {}
|
||||
> extends GLContextObject<E> {
|
||||
|
||||
};
|
Loading…
Reference in New Issue
Block a user