forked from imuncle/live2d
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
159 changed files
with
128,937 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,272 @@ | ||
declare namespace Live2DCubismCore { | ||
/** Cubism version identifier. */ | ||
type csmVersion = number; | ||
/** Log handler. | ||
* | ||
* @param message Null-terminated string message to log. | ||
*/ | ||
interface csmLogFunction { | ||
(message: string): void; | ||
} | ||
/** Cubism version. */ | ||
class Version { | ||
/** | ||
* Queries Core version. | ||
* | ||
* @return Core version. | ||
*/ | ||
static csmGetVersion(): csmVersion; | ||
private constructor(); | ||
} | ||
/** Cubism logging. */ | ||
class Logging { | ||
private static logFunction; | ||
/** | ||
* Sets log handler. | ||
* | ||
* @param handler Handler to use. | ||
*/ | ||
static csmSetLogFunction(handler: csmLogFunction): void; | ||
/** | ||
* Queries log handler. | ||
* | ||
* @return Log handler. | ||
*/ | ||
static csmGetLogFunction(): csmLogFunction; | ||
/** | ||
* Wrap log function. | ||
* | ||
* @param messagePtr number | ||
* | ||
* @return string | ||
*/ | ||
private static wrapLogFunction; | ||
private constructor(); | ||
} | ||
/** Cubism moc. */ | ||
class Moc { | ||
/** Creates [[Moc]] from [[ArrayBuffer]]. | ||
* | ||
* @param buffer Array buffer | ||
* | ||
* @return [[Moc]] on success; [[null]] otherwise. | ||
*/ | ||
static fromArrayBuffer(buffer: ArrayBuffer): Moc; | ||
/** Releases instance. */ | ||
_release(): void; | ||
/** Native moc. */ | ||
_ptr: number; | ||
/** | ||
* Initializes instance. | ||
* | ||
* @param mocBytes Moc bytes. | ||
*/ | ||
private constructor(); | ||
} | ||
/** Cubism model. */ | ||
class Model { | ||
/** Parameters. */ | ||
parameters: Parameters; | ||
/** Parts. */ | ||
parts: Parts; | ||
/** Drawables. */ | ||
drawables: Drawables; | ||
/** Canvas information. */ | ||
canvasinfo: CanvasInfo; | ||
/** | ||
* Creates [[Model]] from [[Moc]]. | ||
* | ||
* @param moc Moc | ||
* | ||
* @return [[Model]] on success; [[null]] otherwise. | ||
*/ | ||
static fromMoc(moc: Moc): Model; | ||
/** Updates instance. */ | ||
update(): void; | ||
/** Releases instance. */ | ||
release(): void; | ||
/** Native model. */ | ||
_ptr: number; | ||
/** | ||
* Initializes instance. | ||
* | ||
* @param moc Moc | ||
*/ | ||
private constructor(); | ||
} | ||
/** Canvas information interface. */ | ||
class CanvasInfo { | ||
/** Width of native model canvas. */ | ||
CanvasWidth: number; | ||
/** Height of native model canvas. */ | ||
CanvasHeight: number; | ||
/** Coordinate origin of X axis. */ | ||
CanvasOriginX: number; | ||
/** Coordinate origin of Y axis. */ | ||
CanvasOriginY: number; | ||
/** Pixels per unit of native model. */ | ||
PixelsPerUnit: number; | ||
/** | ||
* Initializes instance. | ||
* | ||
* @param modelPtr Native model pointer. | ||
*/ | ||
constructor(modelPtr: number); | ||
} | ||
/** Cubism model parameters */ | ||
class Parameters { | ||
/** Parameter count. */ | ||
count: number; | ||
/** Parameter IDs. */ | ||
ids: Array<string>; | ||
/** Minimum parameter values. */ | ||
minimumValues: Float32Array; | ||
/** Maximum parameter values. */ | ||
maximumValues: Float32Array; | ||
/** Default parameter values. */ | ||
defaultValues: Float32Array; | ||
/** Parameter values. */ | ||
values: Float32Array; | ||
/** | ||
* Initializes instance. | ||
* | ||
* @param modelPtr Native model. | ||
*/ | ||
constructor(modelPtr: number); | ||
} | ||
/** Cubism model parts */ | ||
class Parts { | ||
/** Part count. */ | ||
count: number; | ||
/** Part IDs. */ | ||
ids: Array<string>; | ||
/** Opacity values. */ | ||
opacities: Float32Array; | ||
/** Part's parent part indices. */ | ||
parentIndices: Int32Array; | ||
/** | ||
* Initializes instance. | ||
* | ||
* @param modelPtr Native model. | ||
*/ | ||
constructor(modelPtr: number); | ||
} | ||
/** Cubism model drawables */ | ||
class Drawables { | ||
/** Drawable count. */ | ||
count: number; | ||
/** Drawable IDs. */ | ||
ids: Array<string>; | ||
/** Constant drawable flags. */ | ||
constantFlags: Uint8Array; | ||
/** Dynamic drawable flags. */ | ||
dynamicFlags: Uint8Array; | ||
/** Drawable texture indices. */ | ||
textureIndices: Int32Array; | ||
/** Drawable draw orders. */ | ||
drawOrders: Int32Array; | ||
/** Drawable render orders. */ | ||
renderOrders: Int32Array; | ||
/** Drawable opacities. */ | ||
opacities: Float32Array; | ||
/** Mask count for each drawable. */ | ||
maskCounts: Int32Array; | ||
/** Masks for each drawable. */ | ||
masks: Array<Int32Array>; | ||
/** Number of vertices of each drawable. */ | ||
vertexCounts: Int32Array; | ||
/** 2D vertex position data of each drawable. */ | ||
vertexPositions: Array<Float32Array>; | ||
/** 2D texture coordinate data of each drawables. */ | ||
vertexUvs: Array<Float32Array>; | ||
/** Number of triangle indices for each drawable. */ | ||
indexCounts: Int32Array; | ||
/** Triangle index data for each drawable. */ | ||
indices: Array<Uint16Array>; | ||
/** Resets all dynamic drawable flags.. */ | ||
resetDynamicFlags(): void; | ||
/** Native model. */ | ||
private _modelPtr; | ||
/** | ||
* Initializes instance. | ||
* | ||
* @param modelPtr Native model. | ||
*/ | ||
constructor(modelPtr: number); | ||
} | ||
/** Utility functions. */ | ||
class Utils { | ||
/** | ||
* Checks whether flag is set in bitfield. | ||
* | ||
* @param bitfield Bitfield to query against. | ||
* | ||
* @return [[true]] if bit set; [[false]] otherwise | ||
*/ | ||
static hasBlendAdditiveBit(bitfield: number): boolean; | ||
/** | ||
* Checks whether flag is set in bitfield. | ||
* | ||
* @param bitfield Bitfield to query against. | ||
* | ||
* @return [[true]] if bit set; [[false]] otherwise | ||
*/ | ||
static hasBlendMultiplicativeBit(bitfield: number): boolean; | ||
/** | ||
* Checks whether flag is set in bitfield. | ||
* | ||
* @param bitfield Bitfield to query against. | ||
* | ||
* @return [[true]] if bit set; [[false]] otherwise | ||
*/ | ||
static hasIsDoubleSidedBit(bitfield: number): boolean; | ||
/** | ||
* Checks whether flag is set in bitfield. | ||
* | ||
* @param bitfield Bitfield to query against. | ||
* | ||
* @return [[true]] if bit set; [[false]] otherwise | ||
*/ | ||
static hasIsVisibleBit(bitfield: number): boolean; | ||
/** | ||
* Checks whether flag is set in bitfield. | ||
* | ||
* @param bitfield Bitfield to query against. | ||
* | ||
* @return [[true]] if bit set; [[false]] otherwise | ||
*/ | ||
static hasVisibilityDidChangeBit(bitfield: number): boolean; | ||
/** | ||
* Checks whether flag is set in bitfield. | ||
* | ||
* @param bitfield Bitfield to query against. | ||
* | ||
* @return [[true]] if bit set; [[false]] otherwise | ||
*/ | ||
static hasOpacityDidChangeBit(bitfield: number): boolean; | ||
/** | ||
* Checks whether flag is set in bitfield. | ||
* | ||
* @param bitfield Bitfield to query against. | ||
* | ||
* @return [[true]] if bit set; [[false]] otherwise | ||
*/ | ||
static hasDrawOrderDidChangeBit(bitfield: number): boolean; | ||
/** | ||
* Checks whether flag is set in bitfield. | ||
* | ||
* @param bitfield Bitfield to query against. | ||
* | ||
* @return [[true]] if bit set; [[false]] otherwise | ||
*/ | ||
static hasRenderOrderDidChangeBit(bitfield: number): boolean; | ||
/** | ||
* Checks whether flag is set in bitfield. | ||
* | ||
* @param bitfield Bitfield to query against. | ||
* | ||
* @return [[true]] if bit set; [[false]] otherwise | ||
*/ | ||
static hasVertexPositionsDidChangeBit(bitfield: number): boolean; | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.