@gg-web-engine/core 0.0.57 → 0.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d/components/physics/i-physics-world-2d.component.d.ts +1 -1
- package/dist/2d/components/physics/i-rigid-body-2d.component.d.ts +1 -1
- package/dist/2d/components/physics/i-trigger-2d.component.d.ts +3 -3
- package/dist/2d/components/rendering/i-display-object-2d.component.d.ts +1 -1
- package/dist/2d/components/rendering/i-renderer-2d.component.d.ts +1 -1
- package/dist/2d/components/rendering/i-visual-scene-2d.component.d.ts +2 -2
- package/dist/2d/entities/controllers/entity-2d-positioning.animator.d.ts +2 -2
- package/dist/2d/entities/entity-2d.d.ts +7 -7
- package/dist/2d/entities/i-renderable-2d.entity.d.ts +4 -4
- package/dist/2d/entities/renderer-2d.entity.d.ts +1 -1
- package/dist/2d/entities/trigger-2d.entity.d.ts +8 -4
- package/dist/2d/factories.d.ts +7 -7
- package/dist/2d/gg-2d-world.d.ts +34 -6
- package/dist/2d/gg-2d-world.js +23 -19
- package/dist/3d/components/physics/i-physics-world-3d.component.d.ts +5 -5
- package/dist/3d/components/physics/i-raycast-vehicle.component.d.ts +1 -1
- package/dist/3d/components/physics/i-rigid-body-3d.component.d.ts +1 -1
- package/dist/3d/components/physics/i-trigger-3d.component.d.ts +3 -3
- package/dist/3d/components/rendering/i-camera.component.d.ts +1 -1
- package/dist/3d/components/rendering/i-display-object-3d.component.d.ts +1 -1
- package/dist/3d/components/rendering/i-renderer-3d.component.d.ts +2 -2
- package/dist/3d/components/rendering/i-visual-scene-3d.component.d.ts +3 -3
- package/dist/3d/entities/controllers/animators/camera-3d.animator.d.ts +3 -3
- package/dist/3d/entities/controllers/animators/entity-3d-positioning.animator.d.ts +2 -2
- package/dist/3d/entities/entity-3d.d.ts +6 -6
- package/dist/3d/entities/gg-car/gg-car.entity.d.ts +5 -5
- package/dist/3d/entities/i-renderable-3d.entity.d.ts +4 -4
- package/dist/3d/entities/map-graph-3d.entity.d.ts +6 -6
- package/dist/3d/entities/raycast-vehicle-3d.entity.d.ts +3 -3
- package/dist/3d/entities/renderer-3d.entity.d.ts +2 -2
- package/dist/3d/entities/surface-following.entity.d.ts +3 -3
- package/dist/3d/entities/surface-following.entity.js +3 -0
- package/dist/3d/entities/trigger-3d.entity.d.ts +8 -4
- package/dist/3d/factories.d.ts +14 -14
- package/dist/3d/gg-3d-world.d.ts +35 -7
- package/dist/3d/gg-3d-world.js +23 -19
- package/dist/3d/loader.d.ts +12 -12
- package/dist/3d/loader.js +6 -5
- package/dist/3d/loaders.d.ts +4 -4
- package/dist/base/components/i-world-component.d.ts +5 -5
- package/dist/base/components/physics/i-body.component.d.ts +5 -5
- package/dist/base/components/physics/i-physics-world.component.d.ts +13 -5
- package/dist/base/components/physics/i-rigid-body.component.d.ts +2 -2
- package/dist/base/components/physics/i-trigger.component.d.ts +4 -4
- package/dist/base/components/rendering/i-display-object.component.d.ts +6 -6
- package/dist/base/components/rendering/i-renderer.component.d.ts +4 -4
- package/dist/base/components/rendering/i-visual-scene.component.d.ts +2 -2
- package/dist/base/entities/controllers/animation-mixer.d.ts +3 -3
- package/dist/base/entities/i-entity.d.ts +8 -8
- package/dist/base/entities/i-renderable.entity.d.ts +2 -2
- package/dist/base/entities/i-renderer.entity.d.ts +5 -5
- package/dist/base/gg-world.d.ts +29 -5
- package/dist/base/gg-world.js +22 -9
- package/dist/base/index.d.ts +1 -0
- package/dist/base/index.js +1 -0
- package/dist/base/math/numbers.d.ts +2 -1
- package/dist/base/math/numbers.js +7 -1
- package/dist/base/math/point2.d.ts +17 -1
- package/dist/base/math/point2.js +35 -0
- package/dist/base/math/point3.d.ts +2 -0
- package/dist/base/math/point3.js +15 -1
- package/dist/base/models/points.d.ts +20 -16
- package/dist/base/models/raycasting.d.ts +52 -0
- package/dist/base/models/raycasting.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IPhysicsWorldComponent, Point2 } from '../../../base';
|
|
2
2
|
import { PhysicsTypeDocRepo2D } from '../../gg-2d-world';
|
|
3
|
-
export interface IPhysicsWorld2dComponent<
|
|
3
|
+
export interface IPhysicsWorld2dComponent<PTypeDoc extends PhysicsTypeDocRepo2D = PhysicsTypeDocRepo2D> extends IPhysicsWorldComponent<Point2, number, PTypeDoc> {
|
|
4
4
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IRigidBodyComponent, Point2 } from '../../../base';
|
|
2
2
|
import { PhysicsTypeDocRepo2D } from '../../gg-2d-world';
|
|
3
3
|
import { DebugBody2DSettings } from '../../models/body-options';
|
|
4
|
-
export interface IRigidBody2dComponent<
|
|
4
|
+
export interface IRigidBody2dComponent<PTypeDoc extends PhysicsTypeDocRepo2D = PhysicsTypeDocRepo2D> extends IRigidBodyComponent<Point2, number, PTypeDoc> {
|
|
5
5
|
angularVelocity: number;
|
|
6
6
|
/** body info for physics debugger view */
|
|
7
7
|
readonly debugBodySettings: DebugBody2DSettings;
|
|
@@ -2,9 +2,9 @@ import { ITriggerComponent, Point2 } from '../../../base';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { PhysicsTypeDocRepo2D } from '../../gg-2d-world';
|
|
4
4
|
import { DebugBody2DSettings } from '../../models/body-options';
|
|
5
|
-
export interface ITrigger2dComponent<
|
|
5
|
+
export interface ITrigger2dComponent<PTypeDoc extends PhysicsTypeDocRepo2D = PhysicsTypeDocRepo2D> extends ITriggerComponent<Point2, number, PTypeDoc> {
|
|
6
6
|
/** body info for physics debugger view */
|
|
7
7
|
readonly debugBodySettings: DebugBody2DSettings;
|
|
8
|
-
get onEntityEntered(): Observable<
|
|
9
|
-
get onEntityLeft(): Observable<
|
|
8
|
+
get onEntityEntered(): Observable<PTypeDoc['rigidBody']>;
|
|
9
|
+
get onEntityLeft(): Observable<PTypeDoc['rigidBody'] | null>;
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IDisplayObjectComponent, Point2 } from '../../../base';
|
|
2
2
|
import { VisualTypeDocRepo2D } from '../../gg-2d-world';
|
|
3
|
-
export interface IDisplayObject2dComponent<
|
|
3
|
+
export interface IDisplayObject2dComponent<VTypeDoc extends VisualTypeDocRepo2D = VisualTypeDocRepo2D> extends IDisplayObjectComponent<Point2, number, VTypeDoc> {
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IRendererComponent, Point2 } from '../../../base';
|
|
2
2
|
import { VisualTypeDocRepo2D } from '../../gg-2d-world';
|
|
3
|
-
export declare abstract class IRenderer2dComponent<
|
|
3
|
+
export declare abstract class IRenderer2dComponent<VTypeDoc extends VisualTypeDocRepo2D = VisualTypeDocRepo2D> extends IRendererComponent<Point2, number, VTypeDoc> {
|
|
4
4
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IVisualSceneComponent, Point2, RendererOptions } from '../../../base';
|
|
2
2
|
import { VisualTypeDocRepo2D } from '../../gg-2d-world';
|
|
3
|
-
export interface IVisualScene2dComponent<
|
|
4
|
-
createRenderer(canvas?: HTMLCanvasElement, rendererOptions?: Partial<RendererOptions &
|
|
3
|
+
export interface IVisualScene2dComponent<VTypeDoc extends VisualTypeDocRepo2D = VisualTypeDocRepo2D> extends IVisualSceneComponent<Point2, number, VTypeDoc> {
|
|
4
|
+
createRenderer(canvas?: HTMLCanvasElement, rendererOptions?: Partial<RendererOptions & VTypeDoc['rendererExtraOpts']>): VTypeDoc['renderer'];
|
|
5
5
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AnimationFunction, AnimationMixer, Point2 } from '../../../base';
|
|
2
|
-
import { Gg2dWorld,
|
|
2
|
+
import { Gg2dWorld, Gg2dWorldTypeDocRepo } from '../../gg-2d-world';
|
|
3
3
|
import { Entity2d } from '../entity-2d';
|
|
4
4
|
type Positioning2d = {
|
|
5
5
|
position: Point2;
|
|
6
6
|
rotation: number;
|
|
7
7
|
};
|
|
8
|
-
export declare class Entity2dPositioningAnimator<T extends Entity2d = Entity2d> extends AnimationMixer<Positioning2d, Point2, number,
|
|
8
|
+
export declare class Entity2dPositioningAnimator<T extends Entity2d = Entity2d> extends AnimationMixer<Positioning2d, Point2, number, Gg2dWorldTypeDocRepo> {
|
|
9
9
|
entity: T;
|
|
10
10
|
protected _animationFunction: AnimationFunction<Positioning2d>;
|
|
11
11
|
constructor(entity: T, _animationFunction: AnimationFunction<Positioning2d>);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Point2, TickOrder } from '../../base';
|
|
2
2
|
import { IPositionable2d } from '../interfaces/i-positionable-2d';
|
|
3
3
|
import { IRenderable2dEntity } from './i-renderable-2d.entity';
|
|
4
|
-
import {
|
|
5
|
-
export declare class Entity2d<
|
|
4
|
+
import { Gg2dWorldTypeDocRepo } from '../gg-2d-world';
|
|
5
|
+
export declare class Entity2d<TypeDoc extends Gg2dWorldTypeDocRepo = Gg2dWorldTypeDocRepo> extends IRenderable2dEntity<TypeDoc> implements IPositionable2d {
|
|
6
6
|
readonly tickOrder = TickOrder.OBJECTS_BINDING;
|
|
7
7
|
private _position;
|
|
8
8
|
get position(): Point2;
|
|
@@ -10,15 +10,15 @@ export declare class Entity2d<VTypeDoc extends VisualTypeDocRepo2D = VisualTypeD
|
|
|
10
10
|
private _rotation;
|
|
11
11
|
get rotation(): number;
|
|
12
12
|
set rotation(value: number);
|
|
13
|
-
readonly object2D:
|
|
14
|
-
readonly objectBody:
|
|
13
|
+
readonly object2D: TypeDoc['vTypeDoc']['displayObject'] | null;
|
|
14
|
+
readonly objectBody: TypeDoc['pTypeDoc']['rigidBody'] | null;
|
|
15
15
|
updateVisibility(): void;
|
|
16
16
|
/**
|
|
17
17
|
* Synchronize physics body transform with entity (and object2d if defined)
|
|
18
18
|
* */
|
|
19
|
-
protected runTransformBinding(objectBody:
|
|
19
|
+
protected runTransformBinding(objectBody: TypeDoc['pTypeDoc']['rigidBody'], object2D: TypeDoc['vTypeDoc']['displayObject'] | null): void;
|
|
20
20
|
constructor(options: {
|
|
21
|
-
object2D?:
|
|
22
|
-
objectBody?:
|
|
21
|
+
object2D?: TypeDoc['vTypeDoc']['displayObject'];
|
|
22
|
+
objectBody?: TypeDoc['pTypeDoc']['rigidBody'];
|
|
23
23
|
});
|
|
24
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IRenderableEntity, Point2 } from '../../base';
|
|
2
|
-
import { Gg2dWorld,
|
|
3
|
-
export declare abstract class IRenderable2dEntity<TypeDoc extends
|
|
4
|
-
protected _world: Gg2dWorld<TypeDoc
|
|
5
|
-
get world(): Gg2dWorld<TypeDoc
|
|
2
|
+
import { Gg2dWorld, Gg2dWorldTypeDocRepo } from '../gg-2d-world';
|
|
3
|
+
export declare abstract class IRenderable2dEntity<TypeDoc extends Gg2dWorldTypeDocRepo = Gg2dWorldTypeDocRepo> extends IRenderableEntity<Point2, number, TypeDoc> {
|
|
4
|
+
protected _world: Gg2dWorld<TypeDoc> | null;
|
|
5
|
+
get world(): Gg2dWorld<TypeDoc> | null;
|
|
6
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IRendererEntity, Point2 } from '../../base';
|
|
2
2
|
import { VisualTypeDocRepo2D } from '../gg-2d-world';
|
|
3
|
-
export declare class Renderer2dEntity<
|
|
3
|
+
export declare class Renderer2dEntity<VTypeDoc extends VisualTypeDocRepo2D = VisualTypeDocRepo2D> extends IRendererEntity<Point2, number, VTypeDoc> {
|
|
4
4
|
}
|
|
@@ -2,12 +2,16 @@ import { Observable } from 'rxjs';
|
|
|
2
2
|
import { ITrigger2dComponent } from '../components/physics/i-trigger-2d.component';
|
|
3
3
|
import { IEntity, Point2, TickOrder } from '../../base';
|
|
4
4
|
import { IPositionable2d } from '../interfaces/i-positionable-2d';
|
|
5
|
-
import {
|
|
6
|
-
export declare class Trigger2dEntity<
|
|
5
|
+
import { Gg2dWorldTypeDocPPatch, Gg2dWorldTypeDocRepo, PhysicsTypeDocRepo2D } from '../gg-2d-world';
|
|
6
|
+
export declare class Trigger2dEntity<PTypeDoc extends PhysicsTypeDocRepo2D = PhysicsTypeDocRepo2D> extends IEntity<Point2, number, Gg2dWorldTypeDocPPatch<PTypeDoc>> implements IPositionable2d {
|
|
7
7
|
readonly objectBody: ITrigger2dComponent;
|
|
8
8
|
readonly tickOrder = TickOrder.OBJECTS_BINDING;
|
|
9
|
-
get onEntityEntered(): Observable<IEntity<Point2, number,
|
|
10
|
-
|
|
9
|
+
get onEntityEntered(): Observable<IEntity<Point2, number, Gg2dWorldTypeDocRepo & {
|
|
10
|
+
pTypeDoc: PTypeDoc;
|
|
11
|
+
}> & IPositionable2d>;
|
|
12
|
+
get onEntityLeft(): Observable<(IEntity<Point2, number, Gg2dWorldTypeDocRepo & {
|
|
13
|
+
pTypeDoc: PTypeDoc;
|
|
14
|
+
}> & IPositionable2d) | null>;
|
|
11
15
|
private _position;
|
|
12
16
|
get position(): Point2;
|
|
13
17
|
set position(value: Point2);
|
package/dist/2d/factories.d.ts
CHANGED
|
@@ -5,19 +5,19 @@ export type DisplayObject2dOpts<Tex> = {
|
|
|
5
5
|
color?: number;
|
|
6
6
|
texture?: Tex;
|
|
7
7
|
};
|
|
8
|
-
export declare abstract class IDisplayObject2dComponentFactory<
|
|
9
|
-
abstract createPrimitive(descriptor: Shape2DDescriptor, material?: DisplayObject2dOpts<
|
|
8
|
+
export declare abstract class IDisplayObject2dComponentFactory<VTypeDoc extends VisualTypeDocRepo2D = VisualTypeDocRepo2D> {
|
|
9
|
+
abstract createPrimitive(descriptor: Shape2DDescriptor, material?: DisplayObject2dOpts<VTypeDoc['texture']>): VTypeDoc['displayObject'];
|
|
10
10
|
randomColor(): number;
|
|
11
|
-
createSquare(dimensions: Point2, material?: DisplayObject2dOpts<
|
|
12
|
-
createCircle(radius: number, material?: DisplayObject2dOpts<
|
|
11
|
+
createSquare(dimensions: Point2, material?: DisplayObject2dOpts<VTypeDoc['texture']>): VTypeDoc['displayObject'];
|
|
12
|
+
createCircle(radius: number, material?: DisplayObject2dOpts<VTypeDoc['texture']>): VTypeDoc['displayObject'];
|
|
13
13
|
}
|
|
14
|
-
export interface IPhysicsBody2dComponentFactory<
|
|
14
|
+
export interface IPhysicsBody2dComponentFactory<PTypeDoc extends PhysicsTypeDocRepo2D = PhysicsTypeDocRepo2D> {
|
|
15
15
|
createRigidBody(descriptor: BodyShape2DDescriptor, transform?: {
|
|
16
16
|
position?: Point2;
|
|
17
17
|
rotation?: number;
|
|
18
|
-
}):
|
|
18
|
+
}): PTypeDoc['rigidBody'];
|
|
19
19
|
createTrigger(descriptor: Shape2DDescriptor, transform?: {
|
|
20
20
|
position?: Point2;
|
|
21
21
|
rotation?: number;
|
|
22
|
-
}):
|
|
22
|
+
}): PTypeDoc['trigger'];
|
|
23
23
|
}
|
package/dist/2d/gg-2d-world.d.ts
CHANGED
|
@@ -21,12 +21,40 @@ export type PhysicsTypeDocRepo2D = {
|
|
|
21
21
|
rigidBody: IRigidBody2dComponent;
|
|
22
22
|
trigger: ITrigger2dComponent;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
export type Gg2dWorldTypeDocRepo = {
|
|
25
|
+
vTypeDoc: VisualTypeDocRepo2D;
|
|
26
|
+
pTypeDoc: PhysicsTypeDocRepo2D;
|
|
27
|
+
};
|
|
28
|
+
export type Gg2dWorldTypeDocVPatch<VTypeDoc extends VisualTypeDocRepo2D> = Omit<Gg2dWorldTypeDocRepo, 'vTypeDoc'> & {
|
|
29
|
+
vTypeDoc: VTypeDoc;
|
|
30
|
+
};
|
|
31
|
+
export type Gg2dWorldTypeDocPPatch<PTypeDoc extends PhysicsTypeDocRepo2D> = Omit<Gg2dWorldTypeDocRepo, 'pTypeDoc'> & {
|
|
32
|
+
pTypeDoc: PTypeDoc;
|
|
33
|
+
};
|
|
34
|
+
export type Gg2dWorldSceneTypeRepo<TypeDoc extends Gg2dWorldTypeDocRepo = Gg2dWorldTypeDocRepo> = {
|
|
35
|
+
visualScene: IVisualScene2dComponent<TypeDoc['vTypeDoc']> | null;
|
|
36
|
+
physicsWorld: IPhysicsWorld2dComponent<TypeDoc['pTypeDoc']> | null;
|
|
37
|
+
};
|
|
38
|
+
export type Gg2dWorldSceneTypeDocVPatch<VTypeDoc extends VisualTypeDocRepo2D, VS extends IVisualScene2dComponent<VTypeDoc> | null> = Omit<Gg2dWorldSceneTypeRepo, 'visualScene'> & {
|
|
39
|
+
visualScene: VS;
|
|
40
|
+
};
|
|
41
|
+
export type Gg2dWorldSceneTypeDocPPatch<PTypeDoc extends PhysicsTypeDocRepo2D, PW extends IPhysicsWorld2dComponent<PTypeDoc> | null> = Omit<Gg2dWorldSceneTypeRepo, 'physicsWorld'> & {
|
|
42
|
+
physicsWorld: PW;
|
|
43
|
+
};
|
|
44
|
+
export type TypedGg2dWorld<VW extends Gg2dWorld<any> | null, PW extends Gg2dWorld<any> | null> = VW extends Gg2dWorld<infer VTD, infer VSTD> | null ? PW extends Gg2dWorld<infer PTD, infer PSTD> | null ? Gg2dWorld<{
|
|
45
|
+
vTypeDoc: VTD['vTypeDoc'];
|
|
46
|
+
pTypeDoc: PTD['pTypeDoc'];
|
|
47
|
+
}, {
|
|
48
|
+
visualScene: VSTD['visualScene'];
|
|
49
|
+
physicsWorld: PSTD['physicsWorld'];
|
|
50
|
+
}> : never : never;
|
|
51
|
+
export declare class Gg2dWorld<TypeDoc extends Gg2dWorldTypeDocRepo = Gg2dWorldTypeDocRepo, SceneTypeDoc extends Gg2dWorldSceneTypeRepo<TypeDoc> = Gg2dWorldSceneTypeRepo<TypeDoc>> extends GgWorld<Point2, number, TypeDoc, SceneTypeDoc> {
|
|
52
|
+
constructor(args: {
|
|
53
|
+
visualScene?: SceneTypeDoc['visualScene'];
|
|
54
|
+
physicsWorld?: SceneTypeDoc['physicsWorld'];
|
|
55
|
+
});
|
|
56
|
+
addPrimitiveRigidBody(descr: BodyShape2DDescriptor, position?: Point2, rotation?: number, material?: DisplayObject2dOpts<TypeDoc['vTypeDoc']['texture']>): Entity2d<TypeDoc>;
|
|
57
|
+
addRenderer(canvas?: HTMLCanvasElement, rendererOptions?: Partial<RendererOptions & TypeDoc['vTypeDoc']['rendererExtraOpts']>): Renderer2dEntity<TypeDoc['vTypeDoc']>;
|
|
30
58
|
protected registerConsoleCommands(ggstatic: {
|
|
31
59
|
registerConsoleCommand: (world: GgWorld<any, any> | null, command: string, handler: (...args: string[]) => Promise<string>, doc?: string) => void;
|
|
32
60
|
}): void;
|
package/dist/2d/gg-2d-world.js
CHANGED
|
@@ -11,15 +11,14 @@ import { GgWorld, Pnt2 } from '../base';
|
|
|
11
11
|
import { Entity2d } from './entities/entity-2d';
|
|
12
12
|
import { Renderer2dEntity } from './entities/renderer-2d.entity';
|
|
13
13
|
export class Gg2dWorld extends GgWorld {
|
|
14
|
-
constructor(
|
|
15
|
-
super(
|
|
16
|
-
this.visualScene = visualScene;
|
|
17
|
-
this.physicsWorld = physicsWorld;
|
|
14
|
+
constructor(args) {
|
|
15
|
+
super(args);
|
|
18
16
|
}
|
|
19
17
|
addPrimitiveRigidBody(descr, position = Pnt2.O, rotation = 0, material = {}) {
|
|
18
|
+
var _a, _b;
|
|
20
19
|
const entity = new Entity2d({
|
|
21
|
-
object2D: this.visualScene.factory.createPrimitive(descr.shape, material),
|
|
22
|
-
objectBody: this.physicsWorld.factory.createRigidBody(descr),
|
|
20
|
+
object2D: (_a = this.visualScene) === null || _a === void 0 ? void 0 : _a.factory.createPrimitive(descr.shape, material),
|
|
21
|
+
objectBody: (_b = this.physicsWorld) === null || _b === void 0 ? void 0 : _b.factory.createRigidBody(descr),
|
|
23
22
|
});
|
|
24
23
|
entity.position = position;
|
|
25
24
|
entity.rotation = rotation;
|
|
@@ -27,25 +26,30 @@ export class Gg2dWorld extends GgWorld {
|
|
|
27
26
|
return entity;
|
|
28
27
|
}
|
|
29
28
|
addRenderer(canvas, rendererOptions) {
|
|
29
|
+
if (!this.visualScene) {
|
|
30
|
+
throw new Error('Cannot add renderer to the world without visual scene');
|
|
31
|
+
}
|
|
30
32
|
const entity = new Renderer2dEntity(this.visualScene.createRenderer(canvas, rendererOptions));
|
|
31
33
|
this.addEntity(entity);
|
|
32
34
|
return entity;
|
|
33
35
|
}
|
|
34
36
|
registerConsoleCommands(ggstatic) {
|
|
35
37
|
super.registerConsoleCommands(ggstatic);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (args.length > 0) {
|
|
41
|
-
if (isNaN(+args[0]) || isNaN(+args[1])) {
|
|
42
|
-
throw new Error('Wrong arguments');
|
|
38
|
+
if (this.physicsWorld) {
|
|
39
|
+
ggstatic.registerConsoleCommand(this, 'gravity', (...args) => __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (args.length == 1) {
|
|
41
|
+
args = ['0', args[0]]; // mean Y axis
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
if (args.length > 0) {
|
|
44
|
+
if (isNaN(+args[0]) || isNaN(+args[1])) {
|
|
45
|
+
throw new Error('Wrong arguments');
|
|
46
|
+
}
|
|
47
|
+
this.physicsWorld.gravity = { x: +args[0], y: +args[1] };
|
|
48
|
+
}
|
|
49
|
+
return JSON.stringify(this.physicsWorld.gravity);
|
|
50
|
+
}), 'args: [ ?float, ?float ]; Get or set 2D world gravity vector. 1 argument sets' +
|
|
51
|
+
' vector {x: 0, y: value}, 2 arguments sets the whole vector.' +
|
|
52
|
+
' Default value is "9.82" or "0 9.82"');
|
|
53
|
+
}
|
|
50
54
|
}
|
|
51
55
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { IPhysicsWorldComponent, Point3, Point4 } from '../../../base';
|
|
2
2
|
import { PhysicsTypeDocRepo3D } from '../../gg-3d-world';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
|
-
export interface IPhysicsWorld3dComponent<
|
|
5
|
-
readonly loader:
|
|
4
|
+
export interface IPhysicsWorld3dComponent<PTypeDoc extends PhysicsTypeDocRepo3D = PhysicsTypeDocRepo3D> extends IPhysicsWorldComponent<Point3, Point4, PTypeDoc> {
|
|
5
|
+
readonly loader: PTypeDoc['loader'];
|
|
6
6
|
/** event emitter, emits newly added physics components */
|
|
7
|
-
readonly added$: Subject<
|
|
7
|
+
readonly added$: Subject<PTypeDoc['trigger'] | PTypeDoc['rigidBody'] | PTypeDoc['raycastVehicle'] | any>;
|
|
8
8
|
/** event emitter, emits just removed physics components */
|
|
9
|
-
readonly removed$: Subject<
|
|
9
|
+
readonly removed$: Subject<PTypeDoc['trigger'] | PTypeDoc['rigidBody'] | PTypeDoc['raycastVehicle'] | any>;
|
|
10
10
|
/** list of currently added to world physics components */
|
|
11
|
-
readonly children: (
|
|
11
|
+
readonly children: (PTypeDoc['trigger'] | PTypeDoc['rigidBody'] | PTypeDoc['raycastVehicle'] | any)[];
|
|
12
12
|
}
|
|
@@ -17,7 +17,7 @@ export type WheelOptions = {
|
|
|
17
17
|
rollInfluence: number;
|
|
18
18
|
maxTravel: number;
|
|
19
19
|
};
|
|
20
|
-
export interface IRaycastVehicleComponent<
|
|
20
|
+
export interface IRaycastVehicleComponent<PTypeDoc extends PhysicsTypeDocRepo3D = PhysicsTypeDocRepo3D> extends IRigidBody3dComponent<PTypeDoc> {
|
|
21
21
|
/** Return speed in m/s, calculated by car itself (which should be shown on the speedometer) */
|
|
22
22
|
get wheelSpeed(): number;
|
|
23
23
|
addWheel(options: WheelOptions, suspensionOptions: SuspensionOptions): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IRigidBodyComponent, Point3, Point4 } from '../../../base';
|
|
2
2
|
import { PhysicsTypeDocRepo3D } from '../../gg-3d-world';
|
|
3
3
|
import { DebugBody3DSettings } from '../../models/body-options';
|
|
4
|
-
export interface IRigidBody3dComponent<
|
|
4
|
+
export interface IRigidBody3dComponent<PTypeDoc extends PhysicsTypeDocRepo3D = PhysicsTypeDocRepo3D> extends IRigidBodyComponent<Point3, Point4, PTypeDoc> {
|
|
5
5
|
angularVelocity: Point3;
|
|
6
6
|
/** body info for physics debugger view */
|
|
7
7
|
readonly debugBodySettings: DebugBody3DSettings;
|
|
@@ -2,9 +2,9 @@ import { ITriggerComponent, Point3, Point4 } from '../../../base';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { PhysicsTypeDocRepo3D } from '../../gg-3d-world';
|
|
4
4
|
import { DebugBody3DSettings } from '../../models/body-options';
|
|
5
|
-
export interface ITrigger3dComponent<
|
|
5
|
+
export interface ITrigger3dComponent<PTypeDoc extends PhysicsTypeDocRepo3D = PhysicsTypeDocRepo3D> extends ITriggerComponent<Point3, Point4, PTypeDoc> {
|
|
6
6
|
/** body info for physics debugger view */
|
|
7
7
|
readonly debugBodySettings: DebugBody3DSettings;
|
|
8
|
-
get onEntityEntered(): Observable<
|
|
9
|
-
get onEntityLeft(): Observable<
|
|
8
|
+
get onEntityEntered(): Observable<PTypeDoc['rigidBody']>;
|
|
9
|
+
get onEntityLeft(): Observable<PTypeDoc['rigidBody'] | null>;
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IDisplayObject3dComponent } from './i-display-object-3d.component';
|
|
2
2
|
import { VisualTypeDocRepo3D } from '../../gg-3d-world';
|
|
3
|
-
export interface ICameraComponent<
|
|
3
|
+
export interface ICameraComponent<VTypeDoc extends VisualTypeDocRepo3D = VisualTypeDocRepo3D> extends IDisplayObject3dComponent<VTypeDoc> {
|
|
4
4
|
get supportsFov(): boolean;
|
|
5
5
|
get fov(): number;
|
|
6
6
|
set fov(f: number);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IDisplayObjectComponent, Point3, Point4 } from '../../../base';
|
|
2
2
|
import { VisualTypeDocRepo3D } from '../../gg-3d-world';
|
|
3
|
-
export interface IDisplayObject3dComponent<
|
|
3
|
+
export interface IDisplayObject3dComponent<VTypeDoc extends VisualTypeDocRepo3D = VisualTypeDocRepo3D> extends IDisplayObjectComponent<Point3, Point4, VTypeDoc> {
|
|
4
4
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IRendererComponent, Point3, Point4 } from '../../../base';
|
|
2
2
|
import { VisualTypeDocRepo3D } from '../../gg-3d-world';
|
|
3
|
-
export declare abstract class IRenderer3dComponent<
|
|
4
|
-
abstract camera:
|
|
3
|
+
export declare abstract class IRenderer3dComponent<VTypeDoc extends VisualTypeDocRepo3D = VisualTypeDocRepo3D> extends IRendererComponent<Point3, Point4, VTypeDoc> {
|
|
4
|
+
abstract camera: VTypeDoc['camera'];
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IVisualSceneComponent, Point3, Point4, RendererOptions } from '../../../base';
|
|
2
2
|
import { VisualTypeDocRepo3D } from '../../gg-3d-world';
|
|
3
|
-
export interface IVisualScene3dComponent<
|
|
4
|
-
readonly loader:
|
|
5
|
-
createRenderer(camera:
|
|
3
|
+
export interface IVisualScene3dComponent<VTypeDoc extends VisualTypeDocRepo3D = VisualTypeDocRepo3D> extends IVisualSceneComponent<Point3, Point4, VTypeDoc> {
|
|
4
|
+
readonly loader: VTypeDoc['loader'];
|
|
5
|
+
createRenderer(camera: VTypeDoc['camera'], canvas?: HTMLCanvasElement, rendererOptions?: Partial<RendererOptions & VTypeDoc['rendererExtraOpts']>): VTypeDoc['renderer'];
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnimationFunction, AnimationMixer, Point3, Point4 } from '../../../../base';
|
|
2
|
-
import { Gg3dWorld, VisualTypeDocRepo3D } from '../../../gg-3d-world';
|
|
2
|
+
import { Gg3dWorld, Gg3dWorldTypeDocVPatch, VisualTypeDocRepo3D } from '../../../gg-3d-world';
|
|
3
3
|
import { Renderer3dEntity } from '../../renderer-3d.entity';
|
|
4
4
|
export type Camera3dAnimationArgs = {
|
|
5
5
|
position: Point3;
|
|
@@ -7,10 +7,10 @@ export type Camera3dAnimationArgs = {
|
|
|
7
7
|
up?: Point3;
|
|
8
8
|
fov?: number;
|
|
9
9
|
};
|
|
10
|
-
export declare class Camera3dAnimator<VTypeDoc extends VisualTypeDocRepo3D = VisualTypeDocRepo3D> extends AnimationMixer<Camera3dAnimationArgs, Point3, Point4, VTypeDoc
|
|
10
|
+
export declare class Camera3dAnimator<VTypeDoc extends VisualTypeDocRepo3D = VisualTypeDocRepo3D> extends AnimationMixer<Camera3dAnimationArgs, Point3, Point4, Gg3dWorldTypeDocVPatch<VTypeDoc>> {
|
|
11
11
|
entity: Renderer3dEntity<VTypeDoc>;
|
|
12
12
|
protected _animationFunction: AnimationFunction<Camera3dAnimationArgs>;
|
|
13
13
|
constructor(entity: Renderer3dEntity<VTypeDoc>, _animationFunction: AnimationFunction<Camera3dAnimationArgs>);
|
|
14
|
-
onSpawned(world: Gg3dWorld<VTypeDoc
|
|
14
|
+
onSpawned(world: Gg3dWorld<Gg3dWorldTypeDocVPatch<VTypeDoc>>): void;
|
|
15
15
|
protected applyPositioning(value: Camera3dAnimationArgs): void;
|
|
16
16
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AnimationFunction, AnimationMixer, Point3, Point4 } from '../../../../base';
|
|
2
|
-
import { Gg3dWorld,
|
|
2
|
+
import { Gg3dWorld, Gg3dWorldTypeDocRepo } from '../../../gg-3d-world';
|
|
3
3
|
import { IPositionable3d } from '../../../interfaces/i-positionable-3d';
|
|
4
4
|
type Positioning3d = {
|
|
5
5
|
position: Point3;
|
|
6
6
|
rotation: Point4;
|
|
7
7
|
};
|
|
8
|
-
export declare class Entity3dPositioningAnimator<T extends IPositionable3d = IPositionable3d> extends AnimationMixer<Positioning3d, Point3, Point4,
|
|
8
|
+
export declare class Entity3dPositioningAnimator<T extends IPositionable3d = IPositionable3d> extends AnimationMixer<Positioning3d, Point3, Point4, Gg3dWorldTypeDocRepo> {
|
|
9
9
|
entity: T;
|
|
10
10
|
protected _animationFunction: AnimationFunction<Positioning3d>;
|
|
11
11
|
constructor(entity: T, _animationFunction: AnimationFunction<Positioning3d>);
|
|
@@ -3,8 +3,8 @@ import { IRigidBody3dComponent } from '../components/physics/i-rigid-body-3d.com
|
|
|
3
3
|
import { IDisplayObject3dComponent } from '../components/rendering/i-display-object-3d.component';
|
|
4
4
|
import { IPositionable3d } from '../interfaces/i-positionable-3d';
|
|
5
5
|
import { IRenderable3dEntity } from './i-renderable-3d.entity';
|
|
6
|
-
import {
|
|
7
|
-
export declare class Entity3d<
|
|
6
|
+
import { Gg3dWorldTypeDocRepo } from '../gg-3d-world';
|
|
7
|
+
export declare class Entity3d<TypeDoc extends Gg3dWorldTypeDocRepo = Gg3dWorldTypeDocRepo> extends IRenderable3dEntity<TypeDoc> implements IPositionable3d {
|
|
8
8
|
readonly tickOrder = TickOrder.OBJECTS_BINDING;
|
|
9
9
|
private _position;
|
|
10
10
|
get position(): Point3;
|
|
@@ -12,15 +12,15 @@ export declare class Entity3d<VTypeDoc extends VisualTypeDocRepo3D = VisualTypeD
|
|
|
12
12
|
private _rotation;
|
|
13
13
|
get rotation(): Point4;
|
|
14
14
|
set rotation(value: Point4);
|
|
15
|
-
readonly object3D:
|
|
16
|
-
readonly objectBody:
|
|
15
|
+
readonly object3D: TypeDoc['vTypeDoc']['displayObject'] | null;
|
|
16
|
+
readonly objectBody: TypeDoc['pTypeDoc']['rigidBody'] | null;
|
|
17
17
|
updateVisibility(): void;
|
|
18
18
|
/**
|
|
19
19
|
* Synchronize physics body transform with entity (and mesh if defined)
|
|
20
20
|
* */
|
|
21
21
|
protected runTransformBinding(objectBody: IRigidBody3dComponent, object3D: IDisplayObject3dComponent | null): void;
|
|
22
22
|
constructor(options: {
|
|
23
|
-
object3D?:
|
|
24
|
-
objectBody?:
|
|
23
|
+
object3D?: TypeDoc['vTypeDoc']['displayObject'] | null;
|
|
24
|
+
objectBody?: TypeDoc['pTypeDoc']['rigidBody'] | null;
|
|
25
25
|
});
|
|
26
26
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RaycastVehicle3dEntity, RVEntityProperties } from '../raycast-vehicle-3d.entity';
|
|
2
|
-
import { Gg3dWorld,
|
|
2
|
+
import { Gg3dWorld, Gg3dWorldTypeDocRepo } from '../../gg-3d-world';
|
|
3
3
|
import { IRenderable3dEntity } from '../i-renderable-3d.entity';
|
|
4
4
|
import { IPositionable3d } from '../../interfaces/i-positionable-3d';
|
|
5
5
|
import { Point3, Point4 } from '../../../base';
|
|
@@ -32,7 +32,7 @@ export type GgCarProperties = RVEntityProperties & {
|
|
|
32
32
|
};
|
|
33
33
|
maxSteerAngle: number;
|
|
34
34
|
};
|
|
35
|
-
export declare class GgCarEntity<
|
|
35
|
+
export declare class GgCarEntity<TypeDoc extends Gg3dWorldTypeDocRepo = Gg3dWorldTypeDocRepo, RVEntity extends RaycastVehicle3dEntity<TypeDoc> = RaycastVehicle3dEntity<TypeDoc>> extends IRenderable3dEntity<TypeDoc> implements IPositionable3d {
|
|
36
36
|
readonly carProperties: GgCarProperties;
|
|
37
37
|
readonly tickOrder: number;
|
|
38
38
|
get position(): Point3;
|
|
@@ -69,9 +69,9 @@ export declare class GgCarEntity<VTypeDoc extends VisualTypeDocRepo3D = VisualTy
|
|
|
69
69
|
set gear(value: number);
|
|
70
70
|
set isHonking(value: boolean);
|
|
71
71
|
readonly raycastVehicle: RVEntity;
|
|
72
|
-
constructor(carProperties: GgCarProperties, chassis3D:
|
|
73
|
-
protected createRaycastVehicle(carProperties: GgCarProperties, chassis3D:
|
|
74
|
-
onSpawned(world: Gg3dWorld<
|
|
72
|
+
constructor(carProperties: GgCarProperties, chassis3D: TypeDoc['vTypeDoc']['displayObject'] | null, chassisBody: TypeDoc['pTypeDoc']['raycastVehicle']);
|
|
73
|
+
protected createRaycastVehicle(carProperties: GgCarProperties, chassis3D: TypeDoc['vTypeDoc']['displayObject'] | null, chassisBody: TypeDoc['pTypeDoc']['raycastVehicle']): RVEntity;
|
|
74
|
+
onSpawned(world: Gg3dWorld<TypeDoc>): void;
|
|
75
75
|
protected updateEngine(delta: number): void;
|
|
76
76
|
resetTo(options?: {
|
|
77
77
|
position?: Point3;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IRenderableEntity, Point3, Point4 } from '../../base';
|
|
2
|
-
import { Gg3dWorld,
|
|
3
|
-
export declare abstract class IRenderable3dEntity<TypeDoc extends
|
|
4
|
-
protected _world: Gg3dWorld<TypeDoc
|
|
5
|
-
get world(): Gg3dWorld<TypeDoc
|
|
2
|
+
import { Gg3dWorld, Gg3dWorldTypeDocRepo } from '../gg-3d-world';
|
|
3
|
+
export declare abstract class IRenderable3dEntity<TypeDoc extends Gg3dWorldTypeDocRepo = Gg3dWorldTypeDocRepo> extends IRenderableEntity<Point3, Point4, TypeDoc> {
|
|
4
|
+
protected _world: Gg3dWorld<TypeDoc> | null;
|
|
5
|
+
get world(): Gg3dWorld<TypeDoc> | null;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BehaviorSubject, Observable, Subject } from 'rxjs';
|
|
2
2
|
import { Graph, IEntity, PausableClock, Point3, Point4, TickOrder } from '../../base';
|
|
3
|
-
import { Gg3dWorld,
|
|
3
|
+
import { Gg3dWorld, Gg3dWorldTypeDocRepo } from '../gg-3d-world';
|
|
4
4
|
import { Entity3d } from './entity-3d';
|
|
5
5
|
import { LoadOptions, LoadResultWithProps } from '../loader';
|
|
6
6
|
import { IPositionable3d } from '../interfaces/i-positionable-3d';
|
|
@@ -38,7 +38,7 @@ export type Gg3dMapGraphEntityOptions = {
|
|
|
38
38
|
inertia: number;
|
|
39
39
|
maxNodesLoadingPerTick: number;
|
|
40
40
|
};
|
|
41
|
-
export declare class MapGraph3dEntity<
|
|
41
|
+
export declare class MapGraph3dEntity<TypeDoc extends Gg3dWorldTypeDocRepo = Gg3dWorldTypeDocRepo> extends IRenderable3dEntity<TypeDoc> {
|
|
42
42
|
readonly mapGraph: MapGraph;
|
|
43
43
|
readonly tickOrder = TickOrder.POST_RENDERING;
|
|
44
44
|
readonly loaderCursor$: BehaviorSubject<Point3>;
|
|
@@ -48,14 +48,14 @@ export declare class MapGraph3dEntity<VTypeDoc extends VisualTypeDocRepo3D = Vis
|
|
|
48
48
|
private _nearestDummy$;
|
|
49
49
|
get nearestDummy(): Graph<MapGraphNodeType> | null;
|
|
50
50
|
protected _chunkLoaded$: Subject<[
|
|
51
|
-
LoadResultWithProps<
|
|
51
|
+
LoadResultWithProps<TypeDoc>,
|
|
52
52
|
{
|
|
53
53
|
position: Point3;
|
|
54
54
|
rotation: Point4;
|
|
55
55
|
}
|
|
56
56
|
]>;
|
|
57
57
|
get chunkLoaded$(): Observable<[
|
|
58
|
-
LoadResultWithProps<
|
|
58
|
+
LoadResultWithProps<TypeDoc>,
|
|
59
59
|
{
|
|
60
60
|
position: Point3;
|
|
61
61
|
rotation: Point4;
|
|
@@ -68,8 +68,8 @@ export declare class MapGraph3dEntity<VTypeDoc extends VisualTypeDocRepo3D = Vis
|
|
|
68
68
|
get loadRateLimit(): number;
|
|
69
69
|
set loadRateLimit(value: number);
|
|
70
70
|
constructor(mapGraph: MapGraph, options?: Partial<Gg3dMapGraphEntityOptions>);
|
|
71
|
-
onSpawned(world: Gg3dWorld<
|
|
71
|
+
onSpawned(world: Gg3dWorld<TypeDoc>): void;
|
|
72
72
|
onRemoved(): void;
|
|
73
|
-
protected loadChunk(node: MapGraphNodeType): Promise<[Entity3d<
|
|
73
|
+
protected loadChunk(node: MapGraphNodeType): Promise<[Entity3d<TypeDoc>[], LoadResultWithProps<TypeDoc>]>;
|
|
74
74
|
protected disposeChunk(node: MapGraphNodeType): void;
|
|
75
75
|
}
|
|
@@ -3,7 +3,7 @@ import { Entity3d } from './entity-3d';
|
|
|
3
3
|
import { IDisplayObject3dComponent } from '../components/rendering/i-display-object-3d.component';
|
|
4
4
|
import { IRaycastVehicleComponent, SuspensionOptions } from '../components/physics/i-raycast-vehicle.component';
|
|
5
5
|
import { IRigidBody3dComponent } from '../components/physics/i-rigid-body-3d.component';
|
|
6
|
-
import {
|
|
6
|
+
import { Gg3dWorldTypeDocRepo } from '../gg-3d-world';
|
|
7
7
|
export type WheelDisplayOptions = {
|
|
8
8
|
displayObject?: IDisplayObject3dComponent;
|
|
9
9
|
wheelObjectDirection?: AxisDirection3;
|
|
@@ -43,11 +43,11 @@ export type RVEntityProperties = {
|
|
|
43
43
|
})[];
|
|
44
44
|
sharedWheelOptions?: RVEntitySharedWheelOptions;
|
|
45
45
|
});
|
|
46
|
-
export declare class RaycastVehicle3dEntity<
|
|
46
|
+
export declare class RaycastVehicle3dEntity<TypeDoc extends Gg3dWorldTypeDocRepo = Gg3dWorldTypeDocRepo> extends Entity3d<TypeDoc> {
|
|
47
47
|
readonly carProperties: RVEntityProperties;
|
|
48
48
|
readonly chassis3D: IDisplayObject3dComponent | null;
|
|
49
49
|
readonly vehicleComponent: IRaycastVehicleComponent;
|
|
50
|
-
protected readonly wheels: (Entity3d<
|
|
50
|
+
protected readonly wheels: (Entity3d<TypeDoc> | null)[];
|
|
51
51
|
protected readonly wheelLocalRotation: (Point4 | null)[];
|
|
52
52
|
protected readonly frontWheelsIndices: number[];
|
|
53
53
|
protected readonly rearWheelsIndices: number[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IRendererEntity, Point3, Point4 } from '../../base';
|
|
2
2
|
import { IPositionable3d } from '../interfaces/i-positionable-3d';
|
|
3
3
|
import { VisualTypeDocRepo3D } from '../gg-3d-world';
|
|
4
|
-
export declare class Renderer3dEntity<
|
|
4
|
+
export declare class Renderer3dEntity<VTypeDoc extends VisualTypeDocRepo3D = VisualTypeDocRepo3D> extends IRendererEntity<Point3, Point4, VTypeDoc> implements IPositionable3d {
|
|
5
5
|
get position(): Point3;
|
|
6
6
|
set position(value: Point3);
|
|
7
7
|
get rotation(): Point4;
|
|
8
8
|
set rotation(value: Point4);
|
|
9
|
-
get camera():
|
|
9
|
+
get camera(): VTypeDoc['camera'];
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BodyOptions, IEntity, Point3, Point4 } from '../../base';
|
|
2
|
-
import { Gg3dWorld,
|
|
2
|
+
import { Gg3dWorld, Gg3dWorldTypeDocPPatch, PhysicsTypeDocRepo3D } from '../gg-3d-world';
|
|
3
3
|
import { Shape3DDescriptor } from '../models/shapes';
|
|
4
4
|
/**
|
|
5
5
|
* Represents a function that calculates the surface position and normal
|
|
@@ -15,7 +15,7 @@ export type SurfaceFollowFunc = (p: Point3) => {
|
|
|
15
15
|
*
|
|
16
16
|
* @template PTypeDoc - The physics type document repository.
|
|
17
17
|
*/
|
|
18
|
-
export declare class SurfaceFollowingEntity<PTypeDoc extends PhysicsTypeDocRepo3D = PhysicsTypeDocRepo3D> extends IEntity<Point3, Point4,
|
|
18
|
+
export declare class SurfaceFollowingEntity<PTypeDoc extends PhysicsTypeDocRepo3D = PhysicsTypeDocRepo3D> extends IEntity<Point3, Point4, Gg3dWorldTypeDocPPatch<PTypeDoc>> {
|
|
19
19
|
/** Function that determines surface position and normal. */
|
|
20
20
|
followFunc: SurfaceFollowFunc;
|
|
21
21
|
/** Optional body configuration. */
|
|
@@ -61,7 +61,7 @@ export declare class SurfaceFollowingEntity<PTypeDoc extends PhysicsTypeDocRepo3
|
|
|
61
61
|
*
|
|
62
62
|
* @param world - The game world instance.
|
|
63
63
|
*/
|
|
64
|
-
onSpawned(world: Gg3dWorld<
|
|
64
|
+
onSpawned(world: Gg3dWorld<Gg3dWorldTypeDocPPatch<PTypeDoc>>): void;
|
|
65
65
|
private customGlobalDebugDummyBody;
|
|
66
66
|
/**
|
|
67
67
|
* Updates debug visualization if active.
|