lecodes-sdk 0.20.0 → 1.0.0
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/global.d.ts +48 -5
- package/dist/inject.js +361 -260
- package/dist/types/audio/Bus.d.ts +45 -0
- package/dist/types/audio/Sound.d.ts +28 -0
- package/dist/types/audio/Voice.d.ts +27 -0
- package/dist/types/audio/audio.d.ts +83 -0
- package/dist/types/audio/support.d.ts +1 -0
- package/dist/types/canvas/Canvas.d.ts +2 -0
- package/dist/types/gl/DecalSet.d.ts +148 -0
- package/dist/types/gl/Geometry.d.ts +17 -0
- package/dist/types/gl/Light.d.ts +7 -0
- package/dist/types/gl/Lightmap.d.ts +9 -0
- package/dist/types/gl/Material.d.ts +90 -2
- package/dist/types/gl/Mesh.d.ts +18 -1
- package/dist/types/gl/Model.d.ts +34 -0
- package/dist/types/gl/Particles.d.ts +13 -0
- package/dist/types/gl/Scene.d.ts +23 -0
- package/dist/types/gl/Texture.d.ts +29 -1
- package/dist/types/gl/animation/AnimationClip.d.ts +25 -12
- package/dist/types/gl/animation/DynamicBone.d.ts +173 -0
- package/dist/types/gl/{IK.d.ts → animation/IK.d.ts} +4 -4
- package/dist/types/gl/{Locomotion.d.ts → animation/Locomotion.d.ts} +6 -6
- package/dist/types/gl/animation/core.d.ts +15 -10
- package/dist/types/gl/audio/AudioSource.d.ts +60 -0
- package/dist/types/gl/audio/AudioZone.d.ts +32 -0
- package/dist/types/gl/audio/SceneAudio.d.ts +11 -0
- package/dist/types/gl/{NavAgent.d.ts → nav/NavAgent.d.ts} +4 -4
- package/dist/types/gl/{NavMesh.d.ts → nav/NavMesh.d.ts} +4 -4
- package/dist/types/gl/{CharacterController.d.ts → physics/CharacterController.d.ts} +5 -5
- package/dist/types/gl/{Physics.d.ts → physics/Physics.d.ts} +6 -5
- package/dist/types/gl/{Ragdoll.d.ts → physics/Ragdoll.d.ts} +4 -4
- package/dist/types/gl/{Shape.d.ts → physics/Shape.d.ts} +3 -3
- package/dist/types/gl/{Trigger.d.ts → physics/Trigger.d.ts} +2 -2
- package/dist/types/gl/state.d.ts +0 -1
- package/dist/types/gl/{Terrain.d.ts → terrain/Terrain.d.ts} +6 -6
- package/dist/types/gl/{terrainMesh.d.ts → terrain/terrainMesh.d.ts} +1 -1
- package/dist/types/gl/vehicle/Vehicle.d.ts +300 -0
- package/dist/types/gl/vehicle/Wheel.d.ts +147 -0
- package/dist/types/inject.d.ts +33 -21
- package/dist/types/runtime/files.d.ts +24 -1
- package/dist/types/runtime/input.d.ts +11 -0
- package/dist/types/scene/defineScene.d.ts +10 -3
- package/dist/types/ui/UIImage.d.ts +15 -5
- package/dist/types.json +1 -1
- package/package.json +1 -1
- package/prompts/README.md +142 -142
- package/prompts/dist/2d-game.md +408 -197
- package/prompts/dist/3d-app.md +491 -166
- package/prompts/dist/ar-app.md +373 -163
- package/prompts/dist/design.md +83 -87
- package/prompts/dist/ui-app.md +325 -136
- package/src/audio/Bus.ts +102 -0
- package/src/audio/Sound.ts +96 -0
- package/src/audio/Voice.ts +102 -0
- package/src/audio/audio.ts +161 -0
- package/src/audio/support.ts +6 -0
- package/src/bridges.d.ts +279 -32
- package/src/canvas/Canvas.ts +21 -0
- package/src/compile/__tests__/compile.test.ts +11 -0
- package/src/compile/compileProject.ts +30 -15
- package/src/compile/header.ts +6 -3
- package/src/compile/index.ts +4 -0
- package/src/compile/sceneEditor.ts +42 -1
- package/src/core/Aspect.ts +33 -8
- package/src/g2/Scene2D.ts +7 -0
- package/src/gl/CameraPlace.ts +52 -52
- package/src/gl/DecalSet.ts +360 -0
- package/src/gl/Geometry.ts +348 -279
- package/src/gl/Light.ts +16 -0
- package/src/gl/Lightmap.ts +35 -7
- package/src/gl/Material.ts +173 -4
- package/src/gl/Mesh.ts +120 -83
- package/src/gl/Model.ts +33 -1
- package/src/gl/Node.ts +1 -1
- package/src/gl/Particles.ts +21 -3
- package/src/gl/Scene.ts +41 -7
- package/src/gl/Texture.ts +43 -3
- package/src/gl/animation/AnimationClip.ts +43 -20
- package/src/gl/animation/Animator.ts +4 -3
- package/src/gl/animation/DynamicBone.ts +459 -0
- package/src/gl/{IK.ts → animation/IK.ts} +4 -4
- package/src/gl/{Locomotion.ts → animation/Locomotion.ts} +7 -7
- package/src/gl/animation/core.ts +20 -15
- package/src/gl/audio/AudioSource.ts +113 -0
- package/src/gl/audio/AudioZone.ts +75 -0
- package/src/gl/audio/SceneAudio.ts +26 -0
- package/src/gl/{NavAgent.ts → nav/NavAgent.ts} +5 -5
- package/src/gl/{NavMesh.ts → nav/NavMesh.ts} +8 -8
- package/src/gl/{CharacterController.ts → physics/CharacterController.ts} +5 -5
- package/src/gl/{Physics.ts → physics/Physics.ts} +12 -5
- package/src/gl/{Ragdoll.ts → physics/Ragdoll.ts} +272 -270
- package/src/gl/{Shape.ts → physics/Shape.ts} +3 -3
- package/src/gl/{Trigger.ts → physics/Trigger.ts} +2 -2
- package/src/gl/{physicsEvents.ts → physics/physicsEvents.ts} +1 -1
- package/src/gl/scenarios.ts +291 -291
- package/src/gl/state.ts +1 -1
- package/src/gl/{Terrain.ts → terrain/Terrain.ts} +10 -10
- package/src/gl/{terrainMesh.ts → terrain/terrainMesh.ts} +1 -1
- package/src/gl/vehicle/Vehicle.ts +666 -0
- package/src/gl/vehicle/Wheel.ts +290 -0
- package/src/inject.ts +226 -212
- package/src/runtime/files.ts +32 -2
- package/src/runtime/input.ts +6 -1
- package/src/scene/defineScene.ts +26 -10
- package/src/scene/gizmos.ts +148 -148
- package/src/scene/level.ts +2 -2
- package/src/ui/UIImage.ts +21 -7
- package/dist/types/gl/Gearbox.d.ts +0 -86
- package/dist/types/gl/Vehicle.d.ts +0 -191
- package/dist/types/gl/Wheel.d.ts +0 -95
- package/src/gl/Gearbox.ts +0 -212
- package/src/gl/Vehicle.ts +0 -473
- package/src/gl/Wheel.ts +0 -240
- /package/dist/types/gl/{physicsEvents.d.ts → physics/physicsEvents.d.ts} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type ReverbPreset = "room" | "hall" | "cave" | "arena" | "bathroom" | "outdoor";
|
|
2
|
+
export type ReverbParams = {
|
|
3
|
+
/** 0 (a closet) … 1 (a cathedral). */
|
|
4
|
+
roomSize?: number;
|
|
5
|
+
/** High-frequency loss per reflection, 0 … 1. */
|
|
6
|
+
damping?: number;
|
|
7
|
+
/** Stereo width of the tail, 0 … 1. */
|
|
8
|
+
width?: number;
|
|
9
|
+
/** Wet amount, 0 … 1. */
|
|
10
|
+
mix?: number;
|
|
11
|
+
/** Seconds before the tail starts (a big hall: 0.02 … 0.05). */
|
|
12
|
+
preDelay?: number;
|
|
13
|
+
};
|
|
14
|
+
export type EchoParams = {
|
|
15
|
+
/** Seconds between repeats (up to 2). */
|
|
16
|
+
delay?: number;
|
|
17
|
+
/** Feedback, 0 … 0.95 — how many repeats survive. */
|
|
18
|
+
decay?: number;
|
|
19
|
+
/** Wet amount, 0 … 1. */
|
|
20
|
+
mix?: number;
|
|
21
|
+
};
|
|
22
|
+
export declare const REVERB_PRESETS: Record<ReverbPreset, Required<ReverbParams>>;
|
|
23
|
+
export declare class Bus {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
private _volume;
|
|
26
|
+
private _muted;
|
|
27
|
+
private _reverb;
|
|
28
|
+
private _echo;
|
|
29
|
+
private _lowpass;
|
|
30
|
+
private get _live();
|
|
31
|
+
get volume(): number;
|
|
32
|
+
set volume(v: number);
|
|
33
|
+
get muted(): boolean;
|
|
34
|
+
set muted(v: boolean);
|
|
35
|
+
/** A preset name, explicit params, or null (off). */
|
|
36
|
+
get reverb(): ReverbPreset | ReverbParams | null;
|
|
37
|
+
set reverb(v: ReverbPreset | ReverbParams | null);
|
|
38
|
+
get echo(): EchoParams | null;
|
|
39
|
+
set echo(v: EchoParams | null);
|
|
40
|
+
/** Low-pass cutoff in Hz (20 … 20000), null = off. */
|
|
41
|
+
get lowpass(): number | null;
|
|
42
|
+
set lowpass(v: number | null);
|
|
43
|
+
/** Stop every voice on this bus (fade in seconds). */
|
|
44
|
+
stopAll(fade?: number): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type SoundOptions = {
|
|
2
|
+
/** Keep two channels (2D playback of stereo material — music beds, ambiences). Default: the clip
|
|
3
|
+
* is decoded MONO, which is what 3D spatialization needs and what SFX are anyway. */
|
|
4
|
+
stereo?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare class Sound {
|
|
7
|
+
/** The urls this clip was loaded from (one per variant). */
|
|
8
|
+
readonly urls: readonly string[];
|
|
9
|
+
private readonly _durations;
|
|
10
|
+
private _channels;
|
|
11
|
+
private _disposed;
|
|
12
|
+
private _last;
|
|
13
|
+
private constructor();
|
|
14
|
+
/** Fetch + decode. An array = variants: `play` picks a random one (never the same twice in a row
|
|
15
|
+
* when there are 3 or more). Rejects with the failing url when a file cannot be decoded. */
|
|
16
|
+
static load(src: string | string[], options?: SoundOptions): Promise<Sound>;
|
|
17
|
+
/** Seconds (the first variant's). 0 for a silent clip. */
|
|
18
|
+
get duration(): number;
|
|
19
|
+
/** Decoded channel count: 1, or 2 with `{ stereo: true }`. */
|
|
20
|
+
get channels(): number;
|
|
21
|
+
/** How many variants this clip carries. */
|
|
22
|
+
get variants(): number;
|
|
23
|
+
/** True when the engine has this clip (false on hosts without audio, or after dispose). */
|
|
24
|
+
get ready(): boolean;
|
|
25
|
+
get disposed(): boolean;
|
|
26
|
+
/** Free the engine's PCM. Voices playing it stop at once. Idempotent. */
|
|
27
|
+
dispose(): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Emitter } from "../core/events";
|
|
2
|
+
export type VoiceEvents = {
|
|
3
|
+
/** The voice is over: the clip ended, `stop` completed, or the pool reused the slot. */
|
|
4
|
+
ended: () => void;
|
|
5
|
+
};
|
|
6
|
+
export declare class Voice extends Emitter<VoiceEvents> {
|
|
7
|
+
private _volume;
|
|
8
|
+
private _pitch;
|
|
9
|
+
private _pan;
|
|
10
|
+
private _over;
|
|
11
|
+
addEventListener<K extends keyof VoiceEvents>(channel: K, callback: VoiceEvents[K]): void;
|
|
12
|
+
/** True while the engine plays this voice. */
|
|
13
|
+
get playing(): boolean;
|
|
14
|
+
/** Seconds into the clip. */
|
|
15
|
+
get time(): number;
|
|
16
|
+
get volume(): number;
|
|
17
|
+
set volume(v: number);
|
|
18
|
+
get pitch(): number;
|
|
19
|
+
set pitch(v: number);
|
|
20
|
+
/** 2D voices only: -1 left … 1 right. */
|
|
21
|
+
get pan(): number;
|
|
22
|
+
set pan(v: number);
|
|
23
|
+
/** Stop now, or fade out over `fade` seconds. `ended` fires from the engine afterwards. */
|
|
24
|
+
stop(options?: {
|
|
25
|
+
fade?: number;
|
|
26
|
+
}): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { type Vec3Like } from "../math/vec";
|
|
2
|
+
import { Bus } from "./Bus";
|
|
3
|
+
import type { Sound } from "./Sound";
|
|
4
|
+
import { Voice } from "./Voice";
|
|
5
|
+
export type PlaySoundOptions = {
|
|
6
|
+
/** 0 … 1 (and above, at your own risk). Default 1. */
|
|
7
|
+
volume?: number;
|
|
8
|
+
/** Playback rate, 1 = unchanged. Default 1. */
|
|
9
|
+
pitch?: number;
|
|
10
|
+
loop?: boolean;
|
|
11
|
+
/** Bus name; default: the source's bus, `sfx` for 2D. */
|
|
12
|
+
bus?: string;
|
|
13
|
+
/** Higher survives voice stealing when the pool is full. Default 0. */
|
|
14
|
+
priority?: number;
|
|
15
|
+
/** Fade-in seconds. Default 0. */
|
|
16
|
+
fade?: number;
|
|
17
|
+
/** Seconds into the clip to start from. */
|
|
18
|
+
startAt?: number;
|
|
19
|
+
/** 2D only: -1 left … 1 right. */
|
|
20
|
+
pan?: number;
|
|
21
|
+
};
|
|
22
|
+
export type Rolloff = "none" | "inverse" | "linear" | "exponential";
|
|
23
|
+
/** Distance model of an AudioSource / playAt. */
|
|
24
|
+
export type SpatialOptions = {
|
|
25
|
+
/** Metres of full volume around the source. Default 1. */
|
|
26
|
+
minDistance?: number;
|
|
27
|
+
/** Metres beyond which the source no longer gets quieter. Default 50. */
|
|
28
|
+
maxDistance?: number;
|
|
29
|
+
/** How volume falls between the two: `inverse` (default, physical), `linear`, `exponential`, `none`. */
|
|
30
|
+
rolloff?: Rolloff;
|
|
31
|
+
};
|
|
32
|
+
export declare const ROLLOFF: Record<Rolloff, number>;
|
|
33
|
+
export type AudioStats = {
|
|
34
|
+
voicesPlaying: number;
|
|
35
|
+
voicesMono: number;
|
|
36
|
+
voicesStereo: number;
|
|
37
|
+
/** Voices displaced (or dropped) by a fuller pool since start. */
|
|
38
|
+
stolen: number;
|
|
39
|
+
clips: number;
|
|
40
|
+
clipBytes: number;
|
|
41
|
+
/** Master peak since the previous read, linear (1 = full scale). */
|
|
42
|
+
peak: number;
|
|
43
|
+
sampleRate: number;
|
|
44
|
+
/** The reverb zone the listener is in (0 = none) and how far inside (0 … 1). */
|
|
45
|
+
listenerZone: number;
|
|
46
|
+
zoneBlend: number;
|
|
47
|
+
/** Voices rendered binaurally right now (see `audio.hrtf`). */
|
|
48
|
+
hrtfVoices: number;
|
|
49
|
+
};
|
|
50
|
+
declare class AudioSystem {
|
|
51
|
+
private readonly _buses;
|
|
52
|
+
private _hrtf;
|
|
53
|
+
private _hrtfVoices;
|
|
54
|
+
private _timeScalePitch;
|
|
55
|
+
/** True when this host mixes sound. Everything below is a silent no-op otherwise. */
|
|
56
|
+
get supported(): boolean;
|
|
57
|
+
/** HRTF binaural rendering (MIT KEMAR filters on the CPU): sounds get a real up / down / behind in
|
|
58
|
+
* HEADPHONES. Off by default — on speakers it only smears the image. Applies to the `hrtfVoices`
|
|
59
|
+
* nearest 3D voices; the rest keep plain panning. */
|
|
60
|
+
get hrtf(): boolean;
|
|
61
|
+
set hrtf(v: boolean);
|
|
62
|
+
/** `Time.scale` also pitches the sfx bus: slow motion drops every effect's tone, like a film. Default
|
|
63
|
+
* false — a pause only mutes sfx, the menu click keeps its pitch. */
|
|
64
|
+
get timeScalePitch(): boolean;
|
|
65
|
+
set timeScalePitch(v: boolean);
|
|
66
|
+
/** How many voices get the (CPU-heavier) binaural path. Default 16. */
|
|
67
|
+
get hrtfVoices(): number;
|
|
68
|
+
set hrtfVoices(n: number);
|
|
69
|
+
/** A bus by name — the five built-ins, or an app-defined one created on first use. */
|
|
70
|
+
bus(name: string): Bus;
|
|
71
|
+
get master(): Bus;
|
|
72
|
+
/** 2D playback (UI, stingers, music one-shots). */
|
|
73
|
+
play(sound: Sound, options?: PlaySoundOptions): Voice;
|
|
74
|
+
/** A one-shot at a world position with its own transient source — impacts, ricochets, debris.
|
|
75
|
+
* The source is freed when the voice ends. */
|
|
76
|
+
playAt(sound: Sound, position: Vec3Like, options?: PlaySoundOptions & SpatialOptions): Voice;
|
|
77
|
+
/** Stop every voice on every bus (fade in seconds). */
|
|
78
|
+
stopAll(fade?: number): void;
|
|
79
|
+
/** Engine counters for a debug overlay or a perf log. */
|
|
80
|
+
get stats(): AudioStats;
|
|
81
|
+
}
|
|
82
|
+
export declare const audio: AudioSystem;
|
|
83
|
+
export type { AudioSystem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const audioSupported: boolean;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { Node } from "./Node";
|
|
2
|
+
import { Material } from "./Material";
|
|
3
|
+
import type { Texture } from "./Texture";
|
|
4
|
+
import { type Vec3Like } from "../math/vec";
|
|
5
|
+
import { type QuatLike } from "../math/quat";
|
|
6
|
+
import { type ColorInput } from "../core/color";
|
|
7
|
+
/** Per-decal look and life — defaults come from the set's options. */
|
|
8
|
+
export type DecalOptions = {
|
|
9
|
+
/** Image width and height on the surface (world units); a number = square. Default 0.2. */
|
|
10
|
+
size?: number | [number, number];
|
|
11
|
+
/** Projection depth (world units): how far in front of and behind the hit point the decal still
|
|
12
|
+
* lands. Default = the smaller of width / height. */
|
|
13
|
+
depth?: number;
|
|
14
|
+
/** Atlas cell (row-major from the top-left) for a set with a `sheet`; `"random"` picks one.
|
|
15
|
+
* Default 0. */
|
|
16
|
+
frame?: number | "random";
|
|
17
|
+
/** Tint multiplied into the image. Default white. */
|
|
18
|
+
tint?: ColorInput;
|
|
19
|
+
/** 0..1 on top of the tint's alpha. Default 1. */
|
|
20
|
+
opacity?: number;
|
|
21
|
+
/** Seconds until the decal is gone; 0 = stays until recycled. Default 0. */
|
|
22
|
+
life?: number;
|
|
23
|
+
/** Seconds to fade in after spawning. Default 0. */
|
|
24
|
+
fadeIn?: number;
|
|
25
|
+
/** Seconds of fade at the end of `life` (ignored with life 0). Default 0. */
|
|
26
|
+
fadeOut?: number;
|
|
27
|
+
/** Opacity multipliers at the image's BOTTOM and TOP edge (−Y / +Y), interpolated along it — a
|
|
28
|
+
* tire mark that darkens as the slide deepens. Default `[1, 1]`. */
|
|
29
|
+
gradient?: [number, number];
|
|
30
|
+
/** Tilt of the image's bottom and top edge, as a unit-space slope (Δy per Δx across the box):
|
|
31
|
+
* the edge pivots on the corner of the side it keeps and cuts INTO the box on the other, so two
|
|
32
|
+
* boxes can meet on one shared line — what `DecalTrail` uses to mitre its joints. `0` = square.
|
|
33
|
+
* Default `[0, 0]`. */
|
|
34
|
+
caps?: [number, number];
|
|
35
|
+
};
|
|
36
|
+
export type DecalSetOptions = DecalOptions & {
|
|
37
|
+
/** The material — `Material.decal({ map })` by default (`map` below is its shortcut). A custom
|
|
38
|
+
* material must keep decal.mat's vertex contract. */
|
|
39
|
+
material?: Material;
|
|
40
|
+
/** Atlas texture for the default material. */
|
|
41
|
+
map?: Texture;
|
|
42
|
+
/** Tangent-space normal atlas (same cell grid) → a RELIEF decal that bends the surface's
|
|
43
|
+
* lighting instead of painting a colour (`Material.decal` `normalMap`). Footprints and dents
|
|
44
|
+
* need only this; a bullet hole gives `map` too and its colour multiplies in. */
|
|
45
|
+
normalMap?: Texture;
|
|
46
|
+
/** Relief strength for `normalMap`. Default 1. Default material only. */
|
|
47
|
+
bump?: number;
|
|
48
|
+
/** Atlas grid of the map: columns, or [columns, rows]. Default 1 (the whole texture). */
|
|
49
|
+
sheet?: number | [number, number];
|
|
50
|
+
/** Slot budget — the most decals alive at once. Default 256. */
|
|
51
|
+
max?: number;
|
|
52
|
+
/** Soft fraction (0..1) of the box's half depth at both ends, so an oblique surface leaves the
|
|
53
|
+
* box gently. Default 0.3. Default material only. */
|
|
54
|
+
edge?: number;
|
|
55
|
+
/** Surfaces turned more than this away from the projection axis fade out — the cosine of the
|
|
56
|
+
* angle (0.3 ≈ 72°) keeps a floor hit off the wall it meets; 0 = project onto anything.
|
|
57
|
+
* Default 0.3. Default material only. */
|
|
58
|
+
angleFade?: number;
|
|
59
|
+
/** HDR boost of the image (0 = none). Default material only. */
|
|
60
|
+
emissive?: number;
|
|
61
|
+
name?: string;
|
|
62
|
+
/** Coarse draw order, 0 (first) … 7 (last) — see `Mesh.renderPriority`. Default 3: a decal is
|
|
63
|
+
* part of the surface it sits on, so it draws before every other blended thing (meshes 4,
|
|
64
|
+
* particles 5) — the engine's depth sort compares object centres, and a set spread over the
|
|
65
|
+
* level has no useful centre. */
|
|
66
|
+
renderPriority?: number;
|
|
67
|
+
};
|
|
68
|
+
/** `spawn` placement: where the image sits on the surface. */
|
|
69
|
+
export type DecalSpawnOptions = DecalOptions & {
|
|
70
|
+
/** World direction the image's top points along the surface (projected onto it) — a footprint's
|
|
71
|
+
* travel direction. Default: a random spin. */
|
|
72
|
+
up?: Vec3Like;
|
|
73
|
+
/** Extra spin around the normal, radians. Default: random when `up` is not given, else 0. */
|
|
74
|
+
rotation?: number;
|
|
75
|
+
};
|
|
76
|
+
/** `place` / `update` placement: a full frame, like a node looking INTO the surface (its −Z is the
|
|
77
|
+
* projection direction, +Y the image's top). */
|
|
78
|
+
export type DecalPlacement = DecalOptions & {
|
|
79
|
+
position: Vec3Like;
|
|
80
|
+
/** A quaternion, or Euler degrees (YXZ) like `Node.eulerAngles`. Default identity = projecting
|
|
81
|
+
* down −Z. */
|
|
82
|
+
rotation?: QuatLike | Vec3Like;
|
|
83
|
+
};
|
|
84
|
+
export declare class DecalSet extends Node {
|
|
85
|
+
private _material;
|
|
86
|
+
private readonly _max;
|
|
87
|
+
private readonly _cols;
|
|
88
|
+
private readonly _rows;
|
|
89
|
+
private readonly _defaults;
|
|
90
|
+
private readonly _rec;
|
|
91
|
+
private readonly _slots;
|
|
92
|
+
private static _warned;
|
|
93
|
+
constructor(options?: DecalSetOptions);
|
|
94
|
+
get material(): Material;
|
|
95
|
+
/** Decals alive right now. */
|
|
96
|
+
get count(): number;
|
|
97
|
+
/** The slot budget the set was created with. */
|
|
98
|
+
get max(): number;
|
|
99
|
+
/** Coarse draw order, 0 … 7 — see `Mesh.renderPriority`. Write-only. */
|
|
100
|
+
set renderPriority(v: number);
|
|
101
|
+
/** Stamp a decal on a surface: `point` on it, `normal` out of it (a raycast hit, a foot plant
|
|
102
|
+
* with `Vec3.up`). Returns the slot for `update` / `remove` (−1 when the host draws none). */
|
|
103
|
+
spawn(point: Vec3Like, normal: Vec3Like, options?: DecalSpawnOptions): number;
|
|
104
|
+
/** Place a decal by a full frame (an editor-placed stain, a moving marker). Returns the slot. */
|
|
105
|
+
place(placement: DecalPlacement): number;
|
|
106
|
+
/** Move / restyle a placed decal; fields left out keep the values it was placed with. Its birth
|
|
107
|
+
* time (the life clock) is kept. */
|
|
108
|
+
update(slot: number, placement: Partial<DecalPlacement>): this;
|
|
109
|
+
remove(slot: number): this;
|
|
110
|
+
clear(): this;
|
|
111
|
+
private _writePlacement;
|
|
112
|
+
}
|
|
113
|
+
/** A `DecalTrail`'s look: the strip's width, and what every segment carries. */
|
|
114
|
+
export type DecalTrailOptions = Omit<DecalOptions, "size" | "caps" | "gradient"> & {
|
|
115
|
+
/** Width of the strip on the surface, world units. */
|
|
116
|
+
width: number;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* A continuous strip of decals along a path — a tire's skid mark, a dragged body, a tread track.
|
|
120
|
+
* Feed it points (`add`) as the thing moves; every new point becomes one box-decal SEGMENT from the
|
|
121
|
+
* previous point, its image's up along the travel, and the joints between segments are MITRED: each
|
|
122
|
+
* box is cut along the bisector it shares with its neighbour (`caps`), so the strip has no overlaps
|
|
123
|
+
* darkening the outside of a bend and no wedges of gap on the inside. The opacity given with each
|
|
124
|
+
* point is interpolated along the segment (`gradient`), so a mark can darken as a slide deepens and
|
|
125
|
+
* fade as it ends. Segments are the set's decals — same ring, same `max` budget: a set of 900 holds
|
|
126
|
+
* 900 segments across every trail drawn from it.
|
|
127
|
+
*
|
|
128
|
+
* The previous segment is REWRITTEN when the next point arrives (its far cap becomes the shared
|
|
129
|
+
* mitre), through `DecalSet.update`'s path — a recycled slot is simply left alone by the engine.
|
|
130
|
+
*/
|
|
131
|
+
export declare class DecalTrail {
|
|
132
|
+
private _prev;
|
|
133
|
+
private _seg;
|
|
134
|
+
readonly set: DecalSet;
|
|
135
|
+
readonly options: DecalTrailOptions;
|
|
136
|
+
constructor(set: DecalSet, options: DecalTrailOptions);
|
|
137
|
+
/** Extend the strip to `point` on a surface with `normal`, `opacity` (0..1) at that point. The
|
|
138
|
+
* first call after a start / `end()` only anchors the strip. Returns the new segment's slot, or
|
|
139
|
+
* −1 when nothing was drawn (the anchor, a point that did not move, no host support). */
|
|
140
|
+
add(point: Vec3Like, normal: Vec3Like, opacity?: number): number;
|
|
141
|
+
/** Finish the strip. With a `point`, one last segment runs out to it at opacity 0 — a mark that
|
|
142
|
+
* tapers away instead of stopping dead. The next `add` anchors a new strip. */
|
|
143
|
+
end(point?: Vec3Like, normal?: Vec3Like): this;
|
|
144
|
+
private _rewrite;
|
|
145
|
+
/** Write one segment's box: the strip between its joints, extended past each mitred joint by the
|
|
146
|
+
* mitre's reach (w/2 · |slope|) so the tilted cap still passes through the joint's centre. */
|
|
147
|
+
private _box;
|
|
148
|
+
}
|
|
@@ -10,6 +10,11 @@ export declare class Geometry {
|
|
|
10
10
|
* tiles per face, which would fold every face onto the same texels); absent = the host reuses
|
|
11
11
|
* `uv`, which is right for a plane. */
|
|
12
12
|
uv1?: Float32Array;
|
|
13
|
+
/** Per-vertex COLOURS: 4 bytes (r, g, b, a) per vertex, 0..255. A material that declares
|
|
14
|
+
* `requires: [color]` reads them through `getColor()` — one mesh, many colours, no material per
|
|
15
|
+
* shade (a debug drawer, a gradient along a curve). Absent = every vertex white, which is what
|
|
16
|
+
* the built-in materials expect. */
|
|
17
|
+
colors?: Uint8Array;
|
|
13
18
|
constructor(vertices: Float32Array, normals: Float32Array, indices: Uint16Array, uv: Float32Array);
|
|
14
19
|
translate(x: number, y: number, z: number): this;
|
|
15
20
|
scale(x: number, y: number, z: number): this;
|
|
@@ -20,6 +25,9 @@ export declare class Geometry {
|
|
|
20
25
|
static box(size?: Vec3Like | number): Geometry;
|
|
21
26
|
static sphere(options?: SphereOptions): Geometry;
|
|
22
27
|
static cylinder(options?: CylinderOptions): Geometry;
|
|
28
|
+
/** A capsule along Y, centred at the origin: a cylinder `length` long (between the two cap centres)
|
|
29
|
+
* with a hemisphere of `radius` on each end — one closed surface, smooth across the seams. */
|
|
30
|
+
static capsule(options?: CapsuleOptions): Geometry;
|
|
23
31
|
static plane(options?: PlaneOptions): Geometry;
|
|
24
32
|
}
|
|
25
33
|
export type SphereOptions = {
|
|
@@ -27,6 +35,15 @@ export type SphereOptions = {
|
|
|
27
35
|
widthSegments?: number;
|
|
28
36
|
heightSegments?: number;
|
|
29
37
|
};
|
|
38
|
+
export type CapsuleOptions = {
|
|
39
|
+
radius?: number;
|
|
40
|
+
/** Distance between the two cap centres (the straight part); 0 = a sphere. Default 1. */
|
|
41
|
+
length?: number;
|
|
42
|
+
/** Segments around the axis. */
|
|
43
|
+
widthSegments?: number;
|
|
44
|
+
/** Rings per hemisphere (pole to equator). */
|
|
45
|
+
capSegments?: number;
|
|
46
|
+
};
|
|
30
47
|
export type CylinderOptions = {
|
|
31
48
|
radius?: number;
|
|
32
49
|
radiusTop?: number;
|
package/dist/types/gl/Light.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export declare class Light extends Node {
|
|
|
53
53
|
private _intensity;
|
|
54
54
|
/** The most recently created sun — what `Lightmap.load` uses unless told otherwise. */
|
|
55
55
|
static lastSun: Light | null;
|
|
56
|
+
_shadowDistance: number;
|
|
56
57
|
/** A directional sun light. */
|
|
57
58
|
static sun(options?: SunOptions): Light;
|
|
58
59
|
/**
|
|
@@ -70,4 +71,10 @@ export declare class Light extends Node {
|
|
|
70
71
|
set intensity(value: number);
|
|
71
72
|
destroy(): void;
|
|
72
73
|
set color(value: ColorInput);
|
|
74
|
+
get color(): ColorInput;
|
|
75
|
+
/** Sun direction as created (the engine keeps it; a settings menu rebuilds a sun from it). */
|
|
76
|
+
get direction(): [number, number, number];
|
|
77
|
+
/** Sun shadow options as created — creation-time in the engine, so a change means a new sun. */
|
|
78
|
+
get shadowsQuality(): number;
|
|
79
|
+
get shadowDistance(): number;
|
|
73
80
|
}
|
|
@@ -27,6 +27,13 @@ export type LightmapLoadOptions = {
|
|
|
27
27
|
* and its underside does not — the same shading the atlas gives the statics. Before that the volume
|
|
28
28
|
* was one flat 0.5·E on every face and this knob was the workaround. Kept as a trim. */
|
|
29
29
|
volumeBoost?: number;
|
|
30
|
+
/** What an OCCLUDER-only static (a prop without lightmap UVs — traced into the receivers' atlas but
|
|
31
|
+
* carrying no rect of its own) does in real time. `"baked"` (default): its shadow is in the bake, so
|
|
32
|
+
* it stops casting and the shadow pass draws only the movers — on a level of thousands of foliage
|
|
33
|
+
* cards that is a third of the GPU frame. `"realtime"`: it keeps casting, which is the only way its
|
|
34
|
+
* shadow reaches OTHER non-receiver props (a rock under a tree); the honest fix for that is lightmap
|
|
35
|
+
* UVs on the props (`lecodes assets doctor --lightmap-uv`), which makes them receivers. */
|
|
36
|
+
occluderShadows?: "baked" | "realtime";
|
|
30
37
|
};
|
|
31
38
|
export type LightmapInfo = {
|
|
32
39
|
size: number;
|
|
@@ -45,6 +52,8 @@ export type LightmapInfo = {
|
|
|
45
52
|
applied: number;
|
|
46
53
|
total: number;
|
|
47
54
|
missing: string[];
|
|
55
|
+
/** Occluder-only statics whose real-time shadow was switched off (`occluderShadows: "baked"`). */
|
|
56
|
+
occluders: number;
|
|
48
57
|
};
|
|
49
58
|
export type LightmapFiles = {
|
|
50
59
|
data: string;
|
|
@@ -7,8 +7,47 @@ export type MaterialColorOptions = {
|
|
|
7
7
|
color?: ColorInput;
|
|
8
8
|
map?: Texture | Canvas | null;
|
|
9
9
|
};
|
|
10
|
+
/** How a stencil test / write on a material compares and what it writes. `test` runs against the
|
|
11
|
+
* scene's stencil buffer (`Scene.stencil` must be on); the ops say what the buffer gets when the
|
|
12
|
+
* fragment passes / fails the stencil test / fails the depth test (`replace` writes `ref`). */
|
|
13
|
+
export type StencilTest = "always" | "never" | "less" | "lessEqual" | "greater" | "greaterEqual" | "equal" | "notEqual";
|
|
14
|
+
export type StencilOp = "keep" | "zero" | "replace" | "increment" | "decrement" | "invert";
|
|
15
|
+
export type MaterialStencil = {
|
|
16
|
+
/** Write the stencil buffer at all. Default `false`. */
|
|
17
|
+
write?: boolean;
|
|
18
|
+
/** The reference value, 0..255. Default 0. */
|
|
19
|
+
ref?: number;
|
|
20
|
+
/** Default `"always"`. */
|
|
21
|
+
test?: StencilTest;
|
|
22
|
+
onPass?: StencilOp;
|
|
23
|
+
onFail?: StencilOp;
|
|
24
|
+
onDepthFail?: StencilOp;
|
|
25
|
+
readMask?: number;
|
|
26
|
+
writeMask?: number;
|
|
27
|
+
};
|
|
28
|
+
/** Render state a material instance can override at run time (Filament keeps the defaults in the
|
|
29
|
+
* shader package; these are per-instance overrides on top). */
|
|
30
|
+
export type MaterialStateOptions = {
|
|
31
|
+
/** Test against the scene's depth buffer. `false` draws over everything already drawn — an
|
|
32
|
+
* editor gizmo, a marker that must never hide behind a wall. Pair it with a high
|
|
33
|
+
* `Mesh.renderPriority` so nothing drawn later covers it. Default `true`. */
|
|
34
|
+
depthTest?: boolean;
|
|
35
|
+
/** Write to the depth buffer. Leave it on for something drawn over the scene whose own parts must
|
|
36
|
+
* still occlude each other (a gizmo's cone in front of its shaft). Unset = the shader's default
|
|
37
|
+
* (on for opaque, off for a blended one). */
|
|
38
|
+
depthWrite?: boolean;
|
|
39
|
+
/** Draw both faces (no back-face culling): a plane seen from behind, a ribbon, cloth, a flat
|
|
40
|
+
* marker. Default `false` = the shader's culling (back faces dropped). */
|
|
41
|
+
doubleSided?: boolean;
|
|
42
|
+
/** A stencil test / write for this material — see `MaterialStencil`. The selection-outline
|
|
43
|
+
* recipe: the object writes `{ write: true, ref: 1, onPass: "replace" }`, and a slightly larger
|
|
44
|
+
* copy of it draws with `{ test: "notEqual", ref: 1 }` + `depthTest: false` in `renderPriority` 7. */
|
|
45
|
+
stencil?: MaterialStencil;
|
|
46
|
+
};
|
|
47
|
+
/** @deprecated the name before doubleSided / stencil joined it — the same type */
|
|
48
|
+
export type MaterialDepthOptions = MaterialStateOptions;
|
|
10
49
|
/** `Material.unlit` options. */
|
|
11
|
-
export type UnlitMaterialOptions = MaterialColorOptions & {
|
|
50
|
+
export type UnlitMaterialOptions = MaterialColorOptions & MaterialStateOptions & {
|
|
12
51
|
/** Alpha-blend this material instead of drawing it opaque. Opaque is the default: a blended draw
|
|
13
52
|
* writes no depth, is sorted back-to-front and casts no shadow, which is rarely what a flat
|
|
14
53
|
* colour wants. Turn it on for anything that must show what is behind it — a glass pane, a
|
|
@@ -16,6 +55,26 @@ export type UnlitMaterialOptions = MaterialColorOptions & {
|
|
|
16
55
|
* (`"#ffffff80"`) mean anything; the opaque material has no alpha channel at all. */
|
|
17
56
|
transparent?: boolean;
|
|
18
57
|
};
|
|
58
|
+
/** `Material.decal` options — the projected-decal material a `DecalSet` draws with. */
|
|
59
|
+
export type DecalMaterialOptions = {
|
|
60
|
+
/** The atlas (a `DecalSet`'s `sheet` cuts it into cells). */
|
|
61
|
+
map?: Texture;
|
|
62
|
+
/** A tangent-space normal atlas (same cell grid; +X = the image's right, +Y = its top; LINEAR —
|
|
63
|
+
* `Texture.fromPixels(…, { srgb: false })`). Turns the decal into a RELIEF decal: instead of
|
|
64
|
+
* painting a colour it bends the surface's lighting, so a footprint or a dent shows on any
|
|
65
|
+
* surface without a colour of its own. With `map` too, the colour multiplies in (a crater
|
|
66
|
+
* darkens by the map's alpha). The sun term applies in shadow as well (no shadow read). */
|
|
67
|
+
normalMap?: Texture;
|
|
68
|
+
/** Relief strength — the normal map's xy scale. Default 1. */
|
|
69
|
+
bump?: number;
|
|
70
|
+
/** Soft fraction (0..1) of the box's half depth at both ends. Default 0.3. */
|
|
71
|
+
edge?: number;
|
|
72
|
+
/** Cosine of the surface angle past which the decal fades (0.3 ≈ 72°); 0 = project onto
|
|
73
|
+
* anything. Default 0.3. */
|
|
74
|
+
angleFade?: number;
|
|
75
|
+
/** HDR boost of the image (0 = none). */
|
|
76
|
+
emissive?: number;
|
|
77
|
+
};
|
|
19
78
|
/** `Material.particles` options — the default point-sprite material for particle systems. */
|
|
20
79
|
export type ParticlesMaterialOptions = {
|
|
21
80
|
/** Sprite texture — a single image or a flipbook sheet of frames. Unset = soft round dot. */
|
|
@@ -54,12 +113,14 @@ export type ParticlesMaterialOptions = {
|
|
|
54
113
|
stretch?: number;
|
|
55
114
|
};
|
|
56
115
|
/** `Material.lit` options — PBR scalars on top of the color/map pair. */
|
|
57
|
-
export type LitMaterialOptions = MaterialColorOptions & {
|
|
116
|
+
export type LitMaterialOptions = MaterialColorOptions & MaterialStateOptions & {
|
|
58
117
|
/** Perceptual roughness, 0 (mirror) … 1 (matte). Unset = the shader's default. */
|
|
59
118
|
roughness?: number;
|
|
60
119
|
/** Metallic factor, 0 (dielectric) … 1 (metal). Unset = the shader's default. */
|
|
61
120
|
metallic?: number;
|
|
62
121
|
};
|
|
122
|
+
/** `Material.lightmapShading` tiers — see the setter. */
|
|
123
|
+
export type LightmapShading = "full" | "baked" | "baked-lite";
|
|
63
124
|
export declare class Material {
|
|
64
125
|
readonly shader: FetchResponse | "unknown";
|
|
65
126
|
readonly uniforms: Record<string, UniformValue>;
|
|
@@ -68,6 +129,15 @@ export declare class Material {
|
|
|
68
129
|
/** Set a uniform (chainable). */
|
|
69
130
|
set(key: string, value: UniformValue): this;
|
|
70
131
|
set color(c: ColorInput);
|
|
132
|
+
/** Depth test against the scene (write-only; see `MaterialDepthOptions`). A host that predates
|
|
133
|
+
* the call leaves the material as the shader has it. */
|
|
134
|
+
set depthTest(on: boolean);
|
|
135
|
+
/** Depth write (write-only; see `MaterialStateOptions`). */
|
|
136
|
+
set depthWrite(on: boolean);
|
|
137
|
+
/** Both faces drawn (write-only; see `MaterialStateOptions`). */
|
|
138
|
+
set doubleSided(on: boolean);
|
|
139
|
+
/** The stencil test / write (write-only; `null` = back to none). See `MaterialStencil`. */
|
|
140
|
+
set stencil(s: MaterialStencil | null);
|
|
71
141
|
set map(value: Texture | Canvas | null);
|
|
72
142
|
/** PBR lit material. */
|
|
73
143
|
static lit(options?: LitMaterialOptions): Material;
|
|
@@ -77,6 +147,10 @@ export declare class Material {
|
|
|
77
147
|
* driven by the particle curves. Uniforms all default to 0 on a fresh instance, so every look
|
|
78
148
|
* knob is primed here; JS writes after construction override them. */
|
|
79
149
|
static particles(options?: ParticlesMaterialOptions): Material;
|
|
150
|
+
/** Projected-decal material (`DecalSet`): samples the atlas where the decal's box meets the opaque
|
|
151
|
+
* scene behind it. Blended, no depth write, no shadows — the engine keeps the scene depth bound
|
|
152
|
+
* while a set with live decals is on screen. */
|
|
153
|
+
static decal(options?: DecalMaterialOptions): Material;
|
|
80
154
|
/** Material that samples a VideoPlayer's texture. */
|
|
81
155
|
static video(map?: Texture): Material;
|
|
82
156
|
/** The lightmap material (docs/lightmap-plan.md): PBR base colour × a baked shadow/AO atlas on UV1.
|
|
@@ -85,6 +159,9 @@ export declare class Material {
|
|
|
85
159
|
* `metallicFactor`) plus `lightmap`, `lightmapST`, `ambientScale`, `sunStrength` (the sun / IBL terms come from
|
|
86
160
|
* filament's per-frame uniforms inside the shader). */
|
|
87
161
|
static lightmap(): Material;
|
|
162
|
+
/** `Material.lightmap()`'s masked twin (`blending: masked`, same shader and parameters): what the engine
|
|
163
|
+
* gives a lightmapped model's alpha-MASK materials. The cutoff comes from the glTF material. */
|
|
164
|
+
static lightmapMasked(): Material;
|
|
88
165
|
/** The terrain splat material (docs/terrain-plan.md §1.5): four albedo (+ normal-map) layers blended by
|
|
89
166
|
* a control map on the terrain's own grid, per-layer `tiling` (metres per repeat) / `roughness` /
|
|
90
167
|
* `normalScale` / `triplanar`, lightmap-aware (the same `lightmap` / `lightmapST` block as
|
|
@@ -92,6 +169,17 @@ export declare class Material {
|
|
|
92
169
|
* unset layer is white and an unbaked terrain is fully lit. */
|
|
93
170
|
static terrain(): Material;
|
|
94
171
|
private static _lmTemplate;
|
|
172
|
+
private static _lmMaskedTemplate;
|
|
173
|
+
static _lightmapShading: LightmapShading;
|
|
174
|
+
/** Which shader lightmapped models take — a graphics-quality tier, engine-wide. `"full"` is filament's
|
|
175
|
+
* lit path over the baked atlas (IBL specular, real-time point lights such as a muzzle flash, sun
|
|
176
|
+
* shadows on dynamic objects). `"baked"` keeps the baked light and an approximated ambient but drops
|
|
177
|
+
* the lit path: ~40 % cheaper per pixel on a fill-bound GPU. `"baked-lite"` is that minus the normal,
|
|
178
|
+
* metallic/roughness and occlusion map reads (the factors stand in, the atlas keeps the baked AO;
|
|
179
|
+
* emissive still glows): +20 % more at 1080p on the same GPU. Read when a lightmapped model LOADS, so set
|
|
180
|
+
* it before the level (a settings menu applies it on the next level load), like `Texture.maxSize`. */
|
|
181
|
+
static get lightmapShading(): LightmapShading;
|
|
182
|
+
static set lightmapShading(mode: LightmapShading);
|
|
95
183
|
/** Shadow-catcher material (transparent except where shadows fall). */
|
|
96
184
|
static shadow(color?: ColorInput): Material;
|
|
97
185
|
/** Load a custom compiled shader (.mat URL) as a material. */
|
package/dist/types/gl/Mesh.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Vec3Like } from "../math/vec";
|
|
2
|
-
import { Geometry, type CylinderOptions, type PlaneOptions, type SphereOptions } from "./Geometry";
|
|
2
|
+
import { Geometry, type CapsuleOptions, type CylinderOptions, type PlaneOptions, type SphereOptions } from "./Geometry";
|
|
3
3
|
import { Material } from "./Material";
|
|
4
4
|
import { Node } from "./Node";
|
|
5
5
|
/** Common transform/render options every primitive factory accepts. */
|
|
@@ -11,15 +11,30 @@ export type MeshOptions = {
|
|
|
11
11
|
name?: string;
|
|
12
12
|
castShadows?: boolean;
|
|
13
13
|
receiveShadows?: boolean;
|
|
14
|
+
/** Coarse draw order, 0 (first) … 7 (last); default 4. See `Mesh.renderPriority`. */
|
|
15
|
+
renderPriority?: number;
|
|
14
16
|
};
|
|
15
17
|
export declare class Mesh extends Node {
|
|
16
18
|
private _geometry?;
|
|
17
19
|
constructor(geometry?: Geometry, material?: Material);
|
|
18
20
|
get geometry(): Geometry | undefined;
|
|
21
|
+
/** Replace the geometry in place — the node, its transform and its material stay, the vertex and
|
|
22
|
+
* index buffers are rebuilt. What an editor overlay or a debug drawer redraws with. */
|
|
23
|
+
setGeometry(geometry: Geometry): this;
|
|
24
|
+
private _renderPriority?;
|
|
25
|
+
private _culling?;
|
|
26
|
+
private _castShadows?;
|
|
27
|
+
private _receiveShadows?;
|
|
19
28
|
/** A Mesh always carries a material (slot 0) — see Node.setMaterial for the slot API. */
|
|
20
29
|
get material(): Material;
|
|
21
30
|
set material(m: Material);
|
|
22
31
|
set culling(v: boolean);
|
|
32
|
+
/** Coarse draw order within the frame: 0 draws first, 7 last, 4 is the default (Filament's
|
|
33
|
+
* renderable priority; within one priority opaque draws sort front-to-back, blended back-to-front).
|
|
34
|
+
* Something drawn over the scene with `Material.depthTest = false` goes in 7, so nothing drawn
|
|
35
|
+
* after it can cover it. Write-only; a host that predates the call ignores it. */
|
|
36
|
+
set renderPriority(v: number);
|
|
37
|
+
private static _warnedPriority;
|
|
23
38
|
set castShadows(v: boolean);
|
|
24
39
|
set receiveShadows(v: boolean);
|
|
25
40
|
static box(options?: MeshOptions & {
|
|
@@ -27,6 +42,8 @@ export declare class Mesh extends Node {
|
|
|
27
42
|
}): Mesh;
|
|
28
43
|
static sphere(options?: MeshOptions & SphereOptions): Mesh;
|
|
29
44
|
static cylinder(options?: MeshOptions & CylinderOptions): Mesh;
|
|
45
|
+
/** A capsule along Y (`radius`, `length` between the cap centres) — a character's or a collider's shape in one mesh. */
|
|
46
|
+
static capsule(options?: MeshOptions & CapsuleOptions): Mesh;
|
|
30
47
|
static plane(options?: MeshOptions & PlaneOptions): Mesh;
|
|
31
48
|
/** Wrap a custom Geometry. */
|
|
32
49
|
static from(geometry: Geometry, options?: MeshOptions): Mesh;
|