@ffxiark/character-viewer 0.0.1
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/LICENSE +21 -0
- package/README.md +155 -0
- package/dist/chunk-5GGVLVIE.js +166704 -0
- package/dist/chunk-5GGVLVIE.js.map +1 -0
- package/dist/index.d.ts +108 -0
- package/dist/index.js +65 -0
- package/dist/index.js.map +1 -0
- package/dist/items.json +1 -0
- package/dist/lighting-Bn1ftR_s.d.ts +145 -0
- package/dist/react.d.ts +118 -0
- package/dist/react.js +538 -0
- package/dist/react.js.map +1 -0
- package/package.json +72 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { C as CharacterAppearance, a as CharacterAppearanceById, b as CharacterAppearanceByName, c as CharacterItemLook, P as PickerSlot, W as WeaponPickerType, M as ModelSlotId, A as AppearanceResolution, R as RaceGenderName, S as StudioLighting } from './lighting-Bn1ftR_s.js';
|
|
2
|
+
export { d as ARMOR_SLOT_IDS, e as ArmorSlotId, f as CharacterViewerError, g as CharacterViewerErrorCode, D as DEFAULT_VIEWER_BACKGROUND, h as MAIN_WEAPON_TYPES, i as MODEL_SLOT_IDS, j as MainWeaponType, k as RANGED_TYPES, l as RangedType, m as SUB_WEAPON_TYPES, n as SubWeaponType, V as ViewerDebugInfo, o as ViewerOverlayState, p as ViewerState, q as ViewerStatus, r as WEAPON_SLOT_IDS, s as WeaponSlotId, t as isArmorSlot, u as isWeaponSlot, w as weaponTypesForSlot } from './lighting-Bn1ftR_s.js';
|
|
3
|
+
|
|
4
|
+
type AssetLoader = (relativePath: string) => Promise<Uint8Array>;
|
|
5
|
+
declare function setAssetBaseUrl(baseUrl: string): void;
|
|
6
|
+
declare function getAssetBaseUrl(): string;
|
|
7
|
+
declare function configureAssetLoader(loader: AssetLoader): void;
|
|
8
|
+
declare function resetAssetLoader(): void;
|
|
9
|
+
declare function fetchAsset(relativePath: string): Promise<Uint8Array>;
|
|
10
|
+
|
|
11
|
+
declare function isCharacterAppearanceById(appearance: CharacterAppearance): appearance is CharacterAppearanceById;
|
|
12
|
+
declare function isCharacterAppearanceByName(appearance: CharacterAppearance): appearance is CharacterAppearanceByName;
|
|
13
|
+
declare function normalizeAppearance(appearance: CharacterAppearance): CharacterItemLook;
|
|
14
|
+
declare function serializeAppearance(appearance: CharacterAppearance): string;
|
|
15
|
+
declare function validateAppearance(appearance: CharacterAppearance): {
|
|
16
|
+
ok: true;
|
|
17
|
+
} | {
|
|
18
|
+
ok: false;
|
|
19
|
+
errors: string[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
declare function hasItemModel(itemId: number): boolean;
|
|
23
|
+
declare function getItemWeaponSkill(itemId: number): WeaponPickerType | null;
|
|
24
|
+
declare function itemFitsVisualSlot(itemId: number, slot: ModelSlotId): boolean;
|
|
25
|
+
type PickerCategory = {
|
|
26
|
+
slot: PickerSlot;
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
declare function getItemPickerCategory(itemId: number): PickerCategory | null;
|
|
30
|
+
declare function isItemInCategory(itemId: number, slot: PickerSlot, type: string): boolean;
|
|
31
|
+
|
|
32
|
+
declare function resolveAppearance(look: CharacterItemLook): AppearanceResolution;
|
|
33
|
+
|
|
34
|
+
declare const WINDOWER_RACE_IDS: readonly RaceGenderName[];
|
|
35
|
+
declare function mapWindowerRaceId(raceId: number): RaceGenderName | null;
|
|
36
|
+
|
|
37
|
+
declare class Vector3 {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
z: number;
|
|
41
|
+
/** FFXI world up — Y points downward in engine space. */
|
|
42
|
+
static readonly UP: Vector3;
|
|
43
|
+
constructor(x?: number, y?: number, z?: number);
|
|
44
|
+
copyFrom(other: Vector3): this;
|
|
45
|
+
clone(): Vector3;
|
|
46
|
+
set(x: number, y: number, z: number): this;
|
|
47
|
+
addInPlace(other: Vector3): this;
|
|
48
|
+
static lerp(a: Vector3, b: Vector3, t: number): Vector3;
|
|
49
|
+
static lerpInto(a: Vector3, b: Vector3, t: number, out: Vector3): Vector3;
|
|
50
|
+
static normalize(v: Vector3): Vector3;
|
|
51
|
+
timesAssign(scale: Vector3): this;
|
|
52
|
+
static multiply(a: Vector3, b: Vector3): Vector3;
|
|
53
|
+
rotate270(): this;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare class Matrix4 {
|
|
57
|
+
readonly m: Float32Array<ArrayBuffer>;
|
|
58
|
+
constructor();
|
|
59
|
+
identity(): this;
|
|
60
|
+
copyFrom(other: Matrix4): this;
|
|
61
|
+
translateDirect(x: number, y: number, z: number): this;
|
|
62
|
+
translateInPlace(x?: number, y?: number, z?: number): this;
|
|
63
|
+
scaleInPlace(x: number, y?: number, z?: number): this;
|
|
64
|
+
rotateYInPlace(angle: number): this;
|
|
65
|
+
multiplyInPlace(other: Matrix4): this;
|
|
66
|
+
multiply(a: Matrix4, b: Matrix4): Matrix4;
|
|
67
|
+
transform(v: Vector3): Vector3;
|
|
68
|
+
static perspective(fovY: number, aspect: number, near: number, far: number): Matrix4;
|
|
69
|
+
static lookAt(eye: Vector3, target: Vector3, worldUp?: Vector3): Matrix4;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface CharacterViewState {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
radius: number;
|
|
76
|
+
}
|
|
77
|
+
interface CharacterSceneRenderScratch {
|
|
78
|
+
center: Vector3;
|
|
79
|
+
turntableMatrix: Matrix4;
|
|
80
|
+
}
|
|
81
|
+
interface CharacterSceneBootOptions {
|
|
82
|
+
transparent?: boolean;
|
|
83
|
+
backgroundColor?: [number, number, number, number];
|
|
84
|
+
idleAnimation?: boolean;
|
|
85
|
+
}
|
|
86
|
+
interface CharacterSceneBootResult {
|
|
87
|
+
controller: CharacterSceneController;
|
|
88
|
+
meshCount: number;
|
|
89
|
+
framingRadius: number;
|
|
90
|
+
}
|
|
91
|
+
declare class CharacterSceneController {
|
|
92
|
+
private readonly renderer;
|
|
93
|
+
private readonly skeleton;
|
|
94
|
+
private readonly coordinator;
|
|
95
|
+
private readonly meshes;
|
|
96
|
+
private readonly meshTextures;
|
|
97
|
+
private readonly viewMatrix;
|
|
98
|
+
private readonly projMatrix;
|
|
99
|
+
private idleAnimation;
|
|
100
|
+
private constructor();
|
|
101
|
+
static boot(canvas: HTMLCanvasElement, look: CharacterItemLook, options?: CharacterSceneBootOptions): Promise<CharacterSceneBootResult>;
|
|
102
|
+
setIdleAnimation(enabled: boolean): void;
|
|
103
|
+
resize(canvas: HTMLCanvasElement, radius: number, theta: number): void;
|
|
104
|
+
renderFrame(view: CharacterViewState, scratch: CharacterSceneRenderScratch, lighting: StudioLighting): void;
|
|
105
|
+
dispose(): void;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export { AppearanceResolution, type AssetLoader, CharacterAppearance, CharacterAppearanceById, CharacterAppearanceByName, type CharacterSceneBootOptions, type CharacterSceneBootResult, CharacterSceneController, type CharacterSceneRenderScratch, type CharacterViewState, ModelSlotId, PickerSlot, WINDOWER_RACE_IDS, WeaponPickerType, configureAssetLoader, fetchAsset, getAssetBaseUrl, getItemPickerCategory, getItemWeaponSkill, hasItemModel, isCharacterAppearanceById, isCharacterAppearanceByName, isItemInCategory, itemFitsVisualSlot, mapWindowerRaceId, normalizeAppearance, resetAssetLoader, resolveAppearance, serializeAppearance, setAssetBaseUrl, validateAppearance };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ARMOR_SLOT_IDS,
|
|
3
|
+
CharacterSceneController,
|
|
4
|
+
CharacterViewerError,
|
|
5
|
+
DEFAULT_VIEWER_BACKGROUND,
|
|
6
|
+
MAIN_WEAPON_TYPES,
|
|
7
|
+
MODEL_SLOT_IDS,
|
|
8
|
+
RANGED_TYPES,
|
|
9
|
+
SUB_WEAPON_TYPES,
|
|
10
|
+
WEAPON_SLOT_IDS,
|
|
11
|
+
WINDOWER_RACE_IDS,
|
|
12
|
+
configureAssetLoader,
|
|
13
|
+
fetchAsset,
|
|
14
|
+
getAssetBaseUrl,
|
|
15
|
+
getItemPickerCategory,
|
|
16
|
+
getItemWeaponSkill,
|
|
17
|
+
hasItemModel,
|
|
18
|
+
isArmorSlot,
|
|
19
|
+
isCharacterAppearanceById,
|
|
20
|
+
isCharacterAppearanceByName,
|
|
21
|
+
isItemInCategory,
|
|
22
|
+
isWeaponSlot,
|
|
23
|
+
itemFitsVisualSlot,
|
|
24
|
+
mapWindowerRaceId,
|
|
25
|
+
normalizeAppearance,
|
|
26
|
+
resetAssetLoader,
|
|
27
|
+
resolveAppearance,
|
|
28
|
+
serializeAppearance,
|
|
29
|
+
setAssetBaseUrl,
|
|
30
|
+
validateAppearance,
|
|
31
|
+
weaponTypesForSlot
|
|
32
|
+
} from "./chunk-5GGVLVIE.js";
|
|
33
|
+
export {
|
|
34
|
+
ARMOR_SLOT_IDS,
|
|
35
|
+
CharacterSceneController,
|
|
36
|
+
CharacterViewerError,
|
|
37
|
+
DEFAULT_VIEWER_BACKGROUND,
|
|
38
|
+
MAIN_WEAPON_TYPES,
|
|
39
|
+
MODEL_SLOT_IDS,
|
|
40
|
+
RANGED_TYPES,
|
|
41
|
+
SUB_WEAPON_TYPES,
|
|
42
|
+
WEAPON_SLOT_IDS,
|
|
43
|
+
WINDOWER_RACE_IDS,
|
|
44
|
+
configureAssetLoader,
|
|
45
|
+
fetchAsset,
|
|
46
|
+
getAssetBaseUrl,
|
|
47
|
+
getItemPickerCategory,
|
|
48
|
+
getItemWeaponSkill,
|
|
49
|
+
hasItemModel,
|
|
50
|
+
isArmorSlot,
|
|
51
|
+
isCharacterAppearanceById,
|
|
52
|
+
isCharacterAppearanceByName,
|
|
53
|
+
isItemInCategory,
|
|
54
|
+
isWeaponSlot,
|
|
55
|
+
itemFitsVisualSlot,
|
|
56
|
+
mapWindowerRaceId,
|
|
57
|
+
normalizeAppearance,
|
|
58
|
+
resetAssetLoader,
|
|
59
|
+
resolveAppearance,
|
|
60
|
+
serializeAppearance,
|
|
61
|
+
setAssetBaseUrl,
|
|
62
|
+
validateAppearance,
|
|
63
|
+
weaponTypesForSlot
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|