24 lines
728 B
TypeScript
24 lines
728 B
TypeScript
|
import { Octree } from './octree';
|
||
|
import { EventBus } from '../event-bus';
|
||
|
import { PhysicsObject } from './object';
|
||
|
import { Vec3 } from './vec3';
|
||
|
export declare class World extends EventBus {
|
||
|
objects: PhysicsObject[];
|
||
|
gravity: Vec3;
|
||
|
dimensions: Vec3;
|
||
|
octreeOptions: OctreeOptions;
|
||
|
constructor(dimensions: Vec3, octreeOptions: OctreeOptions);
|
||
|
setGravity(grav: Vec3): void;
|
||
|
addObject(obj: PhysicsObject): void;
|
||
|
removeObject(obj: PhysicsObject): void;
|
||
|
step(dt: number): void;
|
||
|
checkCollisions(obj: PhysicsObject, octree: Octree): void;
|
||
|
}
|
||
|
interface OctreeOptions {
|
||
|
position: Vec3;
|
||
|
dimensions: Vec3;
|
||
|
maxObjects: number;
|
||
|
maxLevels: number;
|
||
|
}
|
||
|
export {};
|