the-world-engine
Version:
three.js based, unity like game engine for browser
136 lines (135 loc) • 5.91 kB
TypeScript
export class b2World {
static _Joint_Create(def: any): b2DistanceJoint | b2MouseJoint | b2PrismaticJoint | b2RevoluteJoint | b2PulleyJoint | b2GearJoint | b2WheelJoint | b2WeldJoint | b2FrictionJoint | b2MotorJoint | b2AreaJoint;
static _Joint_Destroy(joint: any): void;
constructor(gravity: any);
m_contactManager: b2ContactManager;
m_bodyList: any;
m_jointList: any;
m_particleSystemList: any;
m_bodyCount: number;
m_jointCount: number;
m_gravity: b2Vec2;
m_allowSleep: boolean;
m_destructionListener: any;
m_debugDraw: any;
m_inv_dt0: number;
m_newContacts: boolean;
m_locked: boolean;
m_clearForces: boolean;
m_warmStarting: boolean;
m_continuousPhysics: boolean;
m_subStepping: boolean;
m_stepComplete: boolean;
m_profile: b2Profile;
m_island: b2Island;
s_stack: any[];
m_controllerList: any;
m_controllerCount: number;
SetDestructionListener(listener: any): void;
SetContactFilter(filter: any): void;
SetContactListener(listener: any): void;
SetDebugDraw(debugDraw: any): void;
CreateBody(def?: {}): any;
DestroyBody(b: any): void;
CreateJoint(def: any): b2DistanceJoint | b2MouseJoint | b2PrismaticJoint | b2RevoluteJoint | b2PulleyJoint | b2GearJoint | b2WheelJoint | b2WeldJoint | b2FrictionJoint | b2MotorJoint | b2AreaJoint;
DestroyJoint(j: any): void;
CreateParticleSystem(def: any): any;
DestroyParticleSystem(p: any): void;
CalculateReasonableParticleIterations(timeStep: any): number;
Step(dt: any, velocityIterations: any, positionIterations: any, particleIterations?: number): void;
ClearForces(): void;
DrawParticleSystem(system: any): void;
DebugDraw(): void;
QueryAABB(...args: any[]): void;
_QueryAABB(callback: any, aabb: any, fn: any): void;
QueryAllAABB(aabb: any, out?: any[]): any[];
QueryPointAABB(...args: any[]): void;
_QueryPointAABB(callback: any, point: any, fn: any): void;
QueryAllPointAABB(point: any, out?: any[]): any[];
QueryFixtureShape(...args: any[]): void;
_QueryFixtureShape(callback: any, shape: any, index: any, transform: any, fn: any): void;
QueryAllFixtureShape(shape: any, index: any, transform: any, out?: any[]): any[];
QueryFixturePoint(...args: any[]): void;
_QueryFixturePoint(callback: any, point: any, fn: any): void;
QueryAllFixturePoint(point: any, out?: any[]): any[];
RayCast(...args: any[]): void;
_RayCast(callback: any, point1: any, point2: any, fn: any): void;
RayCastOne(point1: any, point2: any): null;
RayCastAll(point1: any, point2: any, out?: any[]): any[];
GetBodyList(): any;
GetJointList(): any;
GetParticleSystemList(): any;
GetContactList(): import("./b2_contact.js").b2Contact<import("../collision/b2_shape.js").b2Shape, import("../collision/b2_shape.js").b2Shape> | null;
SetAllowSleeping(flag: any): void;
GetAllowSleeping(): boolean;
SetWarmStarting(flag: any): void;
GetWarmStarting(): boolean;
SetContinuousPhysics(flag: any): void;
GetContinuousPhysics(): boolean;
SetSubStepping(flag: any): void;
GetSubStepping(): boolean;
GetProxyCount(): number;
GetBodyCount(): number;
GetJointCount(): number;
GetContactCount(): number;
GetTreeHeight(): number;
GetTreeBalance(): number;
GetTreeQuality(): number;
SetGravity(gravity: any, wake?: boolean): void;
GetGravity(): b2Vec2;
IsLocked(): boolean;
SetAutoClearForces(flag: any): void;
GetAutoClearForces(): boolean;
ShiftOrigin(newOrigin: any): void;
GetContactManager(): b2ContactManager;
GetProfile(): b2Profile;
Dump(log: any): void;
DrawShape(fixture: any, color: any): void;
Solve(step: any): void;
SolveTOI(step: any): void;
AddController(controller: any): any;
RemoveController(controller: any): any;
}
export namespace b2World {
const Step_s_step: b2TimeStep;
const Step_s_stepTimer: b2Timer;
const Step_s_timer: b2Timer;
const DebugDraw_s_color: b2Color;
const DebugDraw_s_vs: b2Vec2[];
const DebugDraw_s_xf: b2Transform;
const QueryFixtureShape_s_aabb: b2AABB;
const RayCast_s_input: b2RayCastInput;
const RayCast_s_output: b2RayCastOutput;
const RayCast_s_point: b2Vec2;
const SolveTOI_s_subStep: b2TimeStep;
const SolveTOI_s_backup: b2Sweep;
const SolveTOI_s_backup1: b2Sweep;
const SolveTOI_s_backup2: b2Sweep;
const SolveTOI_s_toi_input: b2TOIInput;
const SolveTOI_s_toi_output: b2TOIOutput;
}
import { b2ContactManager } from "./b2_contact_manager.js";
import { b2Vec2 } from "../common/b2_math.js";
import { b2Profile } from "./b2_time_step.js";
import { b2Island } from "./b2_island.js";
import { b2DistanceJoint } from "./b2_distance_joint.js";
import { b2MouseJoint } from "./b2_mouse_joint.js";
import { b2PrismaticJoint } from "./b2_prismatic_joint.js";
import { b2RevoluteJoint } from "./b2_revolute_joint.js";
import { b2PulleyJoint } from "./b2_pulley_joint.js";
import { b2GearJoint } from "./b2_gear_joint.js";
import { b2WheelJoint } from "./b2_wheel_joint.js";
import { b2WeldJoint } from "./b2_weld_joint.js";
import { b2FrictionJoint } from "./b2_friction_joint.js";
import { b2MotorJoint } from "./b2_motor_joint.js";
import { b2AreaJoint } from "./b2_area_joint.js";
import { b2TimeStep } from "./b2_time_step.js";
import { b2Timer } from "../common/b2_timer.js";
import { b2Color } from "../common/b2_draw.js";
import { b2Transform } from "../common/b2_math.js";
import { b2AABB } from "../collision/b2_collision.js";
import { b2RayCastInput } from "../collision/b2_collision.js";
import { b2RayCastOutput } from "../collision/b2_collision.js";
import { b2Sweep } from "../common/b2_math.js";
import { b2TOIInput } from "../collision/b2_time_of_impact.js";
import { b2TOIOutput } from "../collision/b2_time_of_impact.js";