Update to Cubism 4 SDK for Web beta1

translate
ito 2019-09-02 19:14:43 +09:00
parent cef7cbcb6f
commit 5300562826
74 changed files with 15682 additions and 880 deletions

12
.editorconfig Normal file
View File

@ -0,0 +1,12 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
[*.{json,lock,yml}]
indent_size = 2

24
.gitattributes vendored
View File

@ -1,5 +1,19 @@
*.ts text
*.js text
*.json text
*.html text
*.md text
# Auto detect text files and perform LF normalization
* text=auto
# Explicitly declare files as LF
*.ts text eol=lf
*.js text eol=lf
*.json text eol=lf
*.html text eol=lf
*.md text eol=lf
*.map text eol=lf
*.lock text eol=lf
.editorconfig text eol=lf
.gitattributes text eol=lf
*.gitignore text eol=lf
# Library and media files as binary
*.moc3 binary
*.jpg binary
*.png binary

19
.gitignore vendored
View File

@ -1,4 +1,17 @@
.idea/
# Cubism Core
/Core/*
!/Core/Please_copy_cubism_core_for_web
node_modules/
Sample/TypeScript/Demo/dist/
# IDE/Editor files
.idea/
.vs/
.vscode/*
!/.vscode/launch.json
!/.vscode/tasks.json
*.iml
# Package files
/node_modules/
# Build files
/Sample/TypeScript/Demo/dist/

12
.vscode/launch.json vendored
View File

@ -1,26 +1,20 @@
{
"version": "0.2.0",
"configurations": [
// Web
// Web
{
//
"name": "Launch remote website with sourcemaps",
// (chrome)
"type": "chrome",
// launchattach
"request": "launch",
// WebURL
// WebURL
"url": "http://localhost:5500/Sample/TypeScript/Demo/index.html",
//
"webRoot": "${workspaceFolder}/",
// true/false
"sourceMaps": true,
"sourceMaps": true
}
]
}

5
.vscode/tasks.json vendored
View File

@ -27,6 +27,11 @@
"type": "npm",
"script": "build-framework",
"problemMatcher": []
},
{
"type": "npm",
"script": "serve",
"problemMatcher": []
}
]
}

36
CHANGELOG.md Normal file
View File

@ -0,0 +1,36 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [4-beta.1] - 2019-09-04
### Added
- Add method for Moc file version.
- Support new Inverted Masking features.
- Add `.editorconfig` and `.gitattributes` to manage file formats.
- Add `CHANGELOG.md`.
- Add way to create a simpler local server.
- Add sample model `/Sample/TypeScript/Demo/Resources/Rice`.
### Changed
- Upgrade Core version to 04.00.0000 (67108864).
- Convert all file formats according to `.editorconfig`.
- Rename `cubismrenderer_WebGL.ts` to `cubismrenderer_webgl.ts`.
- What was `CubismSdkPackage.json` is currently being changed to`cubism-info.yml`.
- Upgrade all dependency packages and lock package version by adding `package-lock.json`.
- Update `README.md`.
- Delete guidance from `README.md` due to suspension of *Cubism Bindings*.
- Update `.gitignore`.
### Fixed
- Fix issue with reloading model images in WebKit.
[4-beta.1]: https://github.com/Live2D/CubismWebSamples/compare/e36ab2233a89de9225f64e5a02d521bc7235bd03...4-beta.1

View File

@ -1 +0,0 @@
Please copy cubism native core

View File

View File

@ -1,14 +1,14 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
/**
* @brief ID<br>
* <br>
* http://docs.live2d.com/cubism-editor-manual/standard-parametor-list/
* https://docs.live2d.com/cubism-editor-manual/standard-parametor-list/
*/
export namespace Live2DCubismFramework
{

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
//========================================================

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismframework} from "./live2dcubismframework";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as csmvector} from "../type/csmvector";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as csmvector} from "../type/csmvector";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismid} from "../id/cubismid";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
export namespace Live2DCubismFramework

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismid} from './id/cubismid';

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as csmstring} from "../type/csmstring";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as csmvector} from "../type/csmvector";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
/// <reference path="../Core/live2dcubismcore.d.ts" />
@ -81,7 +81,7 @@ export namespace Live2DCubismFramework
}
/**
* Live2D Cubism3 Original Workflow SDK
* Live2D Cubism SDK Original Workflow SDK
* CubismFramework.initialize()CubismFramework.dispose()
*/
export class CubismFramework

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismvector2} from "./cubismvector2";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
export namespace Live2DCubismFramework

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as csmmap} from "../type/csmmap";
@ -38,16 +38,8 @@ export namespace Live2DCubismFramework
? h
: 0.0;
// 原点(0, 0)を中心にして、画面に納まるような大きさで初期化
if (this._width > this._height)
{
this.setWidth(this._height / this._width);
}
else
{
this.setHeight(1.0);
}
}
/**
*

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismmath} from "./cubismmath";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
export namespace Live2DCubismFramework

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismmatrix44} from "./cubismmatrix44";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
/// <reference path="../../Core/live2dcubismcore.d.ts" />

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
/// <reference path="../../Core/live2dcubismcore.d.ts" />
@ -590,6 +590,22 @@ export namespace Live2DCubismFramework
: CubismBlendMode.CubismBlendMode_Normal;
}
/**
* Drawable使
*
* Drawable使
* 使
*
* @param drawableIndex Drawable
* @return Drawable
*/
public getDrawableInvertedMaskBit(drawableIndex: number): boolean
{
const constantFlags: Uint8Array = this._model.drawables.constantFlags;
return (Live2DCubismCore.Utils.hasIsInvertedMaskBit(constantFlags[drawableIndex]));
}
/**
* Drawable
* @return Drawable

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismmodeluserdatajson} from "./cubismmodeluserdatajson";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismjson} from "../utils/cubismjson";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismframework} from "../live2dcubismframework";
@ -22,7 +22,7 @@ import {Live2DCubismFramework as csmstring} from "../type/csmstring";
import {Live2DCubismFramework as cubismmotionqueuemanager} from "../motion/cubismmotionqueuemanager";
import {Live2DCubismFramework as cubismbreath} from "../effect/cubismbreath";
import {Live2DCubismFramework as cubismeyeblink} from "../effect/cubismeyeblink";
import {Live2DCubismFramework as cubismrenderer_webgl} from "../rendering/cubismrenderer_WebGL";
import {Live2DCubismFramework as cubismrenderer_webgl} from "../rendering/cubismrenderer_webgl";
import {CubismLogError, CubismLogInfo} from "../utils/cubismdebug";
import CubismRenderer_WebGL = cubismrenderer_webgl.CubismRenderer_WebGL;
import CubismEyeBlink = cubismeyeblink.CubismEyeBlink;

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismmath} from '../math/cubismmath';

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as acubismmotion} from './acubismmotion';

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismmotionjson} from './cubismmotionjson';

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismid} from '../id/cubismid';

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismjson} from '../utils/cubismjson';

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismmotionqueuemanager} from "./cubismmotionqueuemanager";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as acubismmotion} from './acubismmotion';

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as acubismmotion} from './acubismmotion';

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismphysicsinternal} from './cubismphysicsinternal';

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismvector2} from '../math/cubismvector2';

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismjson} from '../utils/cubismjson';

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismmatrix44} from '../math/cubismmatrix44';
@ -237,10 +237,11 @@ export namespace Live2DCubismFramework
* @param uvArray uv
* @param opacity
* @param colorBlendMode
* @param invertedMask 使使
*/
public abstract drawMesh(textureNo: number, indexCount: number, vertexCount: number,
indexArray: Uint16Array, vertexArray: Float32Array, uvArray: Float32Array,
opacity: number, colorBlendMode: CubismBlendMode): void;
opacity: number, colorBlendMode: CubismBlendMode, invertedMask: boolean): void;
/**
*

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismframework} from "../live2dcubismframework";
@ -27,7 +27,7 @@ export namespace Live2DCubismFramework
{
const ColorChannelCount: number = 4; // 実験時に1チャンネルの場合は1、RGBだけの場合は3、アルファも含める場合は4
const shaderCount: number = 7; // シェーダーの数 = マスク生成用 + (通常用 + 加算 + 乗算) * (マスク無の乗算済アルファ対応版 + マスク有の乗算済アルファ対応版)
const shaderCount: number = 10; // シェーダーの数 = マスク生成用 + (通常用 + 加算 + 乗算) * (マスク無の乗算済アルファ対応版 + マスク有の乗算済アルファ対応版 + マスク有反転の乗算済アルファ対応版)
let s_instance: CubismShader_WebGL;
let s_viewport: number[];
let s_fbo: WebGLFramebuffer;
@ -454,7 +454,8 @@ export namespace Live2DCubismFramework
model.getDrawableVertices(clipDrawIndex),
model.getDrawableVertexUvs(clipDrawIndex),
model.getDrawableOpacity(clipDrawIndex),
CubismBlendMode.CubismBlendMode_Normal // クリッピングは通常描画を強制
CubismBlendMode.CubismBlendMode_Normal, // クリッピングは通常描画を強制
false // マスク生成時はクリッピングの反転使用は全く関係がない
);
}
}
@ -849,6 +850,7 @@ export namespace Live2DCubismFramework
* @param baseColor
* @param isPremultipliedAlpha
* @param matrix4x4 Model-View-Projection
* @param invertedMask 使
*/
public setupShaderProgram(renderer: CubismRenderer_WebGL,
textureId: WebGLTexture,
@ -865,7 +867,8 @@ export namespace Live2DCubismFramework
colorBlendMode: CubismBlendMode,
baseColor: CubismTextureColor,
isPremultipliedAlpha: boolean,
matrix4x4: CubismMatrix44): void
matrix4x4: CubismMatrix44,
invertedMask: boolean): void
{
if(!isPremultipliedAlpha)
{
@ -938,7 +941,7 @@ export namespace Live2DCubismFramework
else // マスク生成以外の場合
{
const masked: boolean = renderer.getClippingContextBufferForDraw() != null; // この描画オブジェクトはマスク対象か
const offset: number = (masked ? 1 : 0);
const offset: number = (masked ? (invertedMask ? 2 : 1) : 0);
let shaderSet: CubismShaderSet = new CubismShaderSet();
@ -1059,14 +1062,17 @@ export namespace Live2DCubismFramework
this._shaderSets.at(1).shaderProgram = this.loadShaderProgram(vertexShaderSrc, fragmentShaderSrcPremultipliedAlpha);
this._shaderSets.at(2).shaderProgram = this.loadShaderProgram(vertexShaderSrcMasked, fragmentShaderSrcMaskPremultipliedAlpha);
this._shaderSets.at(3).shaderProgram = this.loadShaderProgram(vertexShaderSrcMasked, fragmentShaderSrcMaskInvertedPremultipliedAlpha);
// 加算も通常と同じシェーダーを利用する
this._shaderSets.at(3).shaderProgram = this._shaderSets.at(1).shaderProgram;
this._shaderSets.at(4).shaderProgram = this._shaderSets.at(2).shaderProgram;
this._shaderSets.at(4).shaderProgram = this._shaderSets.at(1).shaderProgram;
this._shaderSets.at(5).shaderProgram = this._shaderSets.at(2).shaderProgram;
this._shaderSets.at(6).shaderProgram = this._shaderSets.at(3).shaderProgram;
// 乗算も通常と同じシェーダーを利用する
this._shaderSets.at(5).shaderProgram = this._shaderSets.at(1).shaderProgram;
this._shaderSets.at(6).shaderProgram = this._shaderSets.at(2).shaderProgram;
this._shaderSets.at(7).shaderProgram = this._shaderSets.at(1).shaderProgram;
this._shaderSets.at(8).shaderProgram = this._shaderSets.at(2).shaderProgram;
this._shaderSets.at(9).shaderProgram = this._shaderSets.at(3).shaderProgram;
// SetupMask
this._shaderSets.at(0).attributePositionLocation = this.gl.getAttribLocation(this._shaderSets.at(0).shaderProgram, "a_position");
@ -1093,31 +1099,34 @@ export namespace Live2DCubismFramework
this._shaderSets.at(2).uniformChannelFlagLocation = this.gl.getUniformLocation(this._shaderSets.at(2).shaderProgram, "u_channelFlag");
this._shaderSets.at(2).uniformBaseColorLocation = this.gl.getUniformLocation(this._shaderSets.at(2).shaderProgram, "u_baseColor");
// 加算(PremultipliedAlpha
// 通常(クリッピング・反転, PremultipliedAlpha
this._shaderSets.at(3).attributePositionLocation = this.gl.getAttribLocation(this._shaderSets.at(3).shaderProgram, "a_position");
this._shaderSets.at(3).attributeTexCoordLocation = this.gl.getAttribLocation(this._shaderSets.at(3).shaderProgram, "a_texCoord");
this._shaderSets.at(3).samplerTexture0Location = this.gl.getUniformLocation(this._shaderSets.at(3).shaderProgram, "s_texture0");
this._shaderSets.at(3).samplerTexture1Location = this.gl.getUniformLocation(this._shaderSets.at(3).shaderProgram, "s_texture1");
this._shaderSets.at(3).uniformMatrixLocation = this.gl.getUniformLocation(this._shaderSets.at(3).shaderProgram, "u_matrix");
this._shaderSets.at(3).uniformClipMatrixLocation = this.gl.getUniformLocation(this._shaderSets.at(3).shaderProgram, "u_clipMatrix");
this._shaderSets.at(3).uniformChannelFlagLocation = this.gl.getUniformLocation(this._shaderSets.at(3).shaderProgram, "u_channelFlag");
this._shaderSets.at(3).uniformBaseColorLocation = this.gl.getUniformLocation(this._shaderSets.at(3).shaderProgram, "u_baseColor");
// 加算(クリッピング、PremultipliedAlpha
// 加算(PremultipliedAlpha
this._shaderSets.at(4).attributePositionLocation = this.gl.getAttribLocation(this._shaderSets.at(4).shaderProgram, "a_position");
this._shaderSets.at(4).attributeTexCoordLocation = this.gl.getAttribLocation(this._shaderSets.at(4).shaderProgram, "a_texCoord");
this._shaderSets.at(4).samplerTexture0Location = this.gl.getUniformLocation(this._shaderSets.at(4).shaderProgram, "s_texture0");
this._shaderSets.at(4).samplerTexture1Location = this.gl.getUniformLocation(this._shaderSets.at(4).shaderProgram, "s_texture1");
this._shaderSets.at(4).uniformMatrixLocation = this.gl.getUniformLocation(this._shaderSets.at(4).shaderProgram, "u_matrix");
this._shaderSets.at(4).uniformClipMatrixLocation = this.gl.getUniformLocation(this._shaderSets.at(4).shaderProgram, "u_clipMatrix");
this._shaderSets.at(4).uniformChannelFlagLocation = this.gl.getUniformLocation(this._shaderSets.at(4).shaderProgram, "u_channelFlag");
this._shaderSets.at(4).uniformBaseColorLocation = this.gl.getUniformLocation(this._shaderSets.at(4).shaderProgram, "u_baseColor");
// 乗算(PremultipliedAlpha
// 加算(クリッピング、PremultipliedAlpha
this._shaderSets.at(5).attributePositionLocation = this.gl.getAttribLocation(this._shaderSets.at(5).shaderProgram, "a_position");
this._shaderSets.at(5).attributeTexCoordLocation = this.gl.getAttribLocation(this._shaderSets.at(5).shaderProgram, "a_texCoord");
this._shaderSets.at(5).samplerTexture0Location = this.gl.getUniformLocation(this._shaderSets.at(5).shaderProgram, "s_texture0");
this._shaderSets.at(5).samplerTexture1Location = this.gl.getUniformLocation(this._shaderSets.at(5).shaderProgram, "s_texture1");
this._shaderSets.at(5).uniformMatrixLocation = this.gl.getUniformLocation(this._shaderSets.at(5).shaderProgram, "u_matrix");
this._shaderSets.at(5).uniformClipMatrixLocation = this.gl.getUniformLocation(this._shaderSets.at(5).shaderProgram, "u_clipMatrix");
this._shaderSets.at(5).uniformChannelFlagLocation = this.gl.getUniformLocation(this._shaderSets.at(5).shaderProgram, "u_channelFlag");
this._shaderSets.at(5).uniformBaseColorLocation = this.gl.getUniformLocation(this._shaderSets.at(5).shaderProgram, "u_baseColor");
// 乗算(クリッピング、PremultipliedAlpha
// 加算(クリッピング・反転、PremultipliedAlpha
this._shaderSets.at(6).attributePositionLocation = this.gl.getAttribLocation(this._shaderSets.at(6).shaderProgram, "a_position");
this._shaderSets.at(6).attributeTexCoordLocation = this.gl.getAttribLocation(this._shaderSets.at(6).shaderProgram, "a_texCoord");
this._shaderSets.at(6).samplerTexture0Location = this.gl.getUniformLocation(this._shaderSets.at(6).shaderProgram, "s_texture0");
@ -1126,6 +1135,33 @@ export namespace Live2DCubismFramework
this._shaderSets.at(6).uniformClipMatrixLocation = this.gl.getUniformLocation(this._shaderSets.at(6).shaderProgram, "u_clipMatrix");
this._shaderSets.at(6).uniformChannelFlagLocation = this.gl.getUniformLocation(this._shaderSets.at(6).shaderProgram, "u_channelFlag");
this._shaderSets.at(6).uniformBaseColorLocation = this.gl.getUniformLocation(this._shaderSets.at(6).shaderProgram, "u_baseColor");
// 乗算PremultipliedAlpha
this._shaderSets.at(7).attributePositionLocation = this.gl.getAttribLocation(this._shaderSets.at(7).shaderProgram, "a_position");
this._shaderSets.at(7).attributeTexCoordLocation = this.gl.getAttribLocation(this._shaderSets.at(7).shaderProgram, "a_texCoord");
this._shaderSets.at(7).samplerTexture0Location = this.gl.getUniformLocation(this._shaderSets.at(7).shaderProgram, "s_texture0");
this._shaderSets.at(7).uniformMatrixLocation = this.gl.getUniformLocation(this._shaderSets.at(7).shaderProgram, "u_matrix");
this._shaderSets.at(7).uniformBaseColorLocation = this.gl.getUniformLocation(this._shaderSets.at(7).shaderProgram, "u_baseColor");
// 乗算クリッピング、PremultipliedAlpha
this._shaderSets.at(8).attributePositionLocation = this.gl.getAttribLocation(this._shaderSets.at(8).shaderProgram, "a_position");
this._shaderSets.at(8).attributeTexCoordLocation = this.gl.getAttribLocation(this._shaderSets.at(8).shaderProgram, "a_texCoord");
this._shaderSets.at(8).samplerTexture0Location = this.gl.getUniformLocation(this._shaderSets.at(8).shaderProgram, "s_texture0");
this._shaderSets.at(8).samplerTexture1Location = this.gl.getUniformLocation(this._shaderSets.at(8).shaderProgram, "s_texture1");
this._shaderSets.at(8).uniformMatrixLocation = this.gl.getUniformLocation(this._shaderSets.at(8).shaderProgram, "u_matrix");
this._shaderSets.at(8).uniformClipMatrixLocation = this.gl.getUniformLocation(this._shaderSets.at(8).shaderProgram, "u_clipMatrix");
this._shaderSets.at(8).uniformChannelFlagLocation = this.gl.getUniformLocation(this._shaderSets.at(8).shaderProgram, "u_channelFlag");
this._shaderSets.at(8).uniformBaseColorLocation = this.gl.getUniformLocation(this._shaderSets.at(8).shaderProgram, "u_baseColor");
// 乗算クリッピング・反転、PremultipliedAlpha
this._shaderSets.at(9).attributePositionLocation = this.gl.getAttribLocation(this._shaderSets.at(9).shaderProgram, "a_position");
this._shaderSets.at(9).attributeTexCoordLocation = this.gl.getAttribLocation(this._shaderSets.at(9).shaderProgram, "a_texCoord");
this._shaderSets.at(9).samplerTexture0Location = this.gl.getUniformLocation(this._shaderSets.at(9).shaderProgram, "s_texture0");
this._shaderSets.at(9).samplerTexture1Location = this.gl.getUniformLocation(this._shaderSets.at(9).shaderProgram, "s_texture1");
this._shaderSets.at(9).uniformMatrixLocation = this.gl.getUniformLocation(this._shaderSets.at(9).shaderProgram, "u_matrix");
this._shaderSets.at(9).uniformClipMatrixLocation = this.gl.getUniformLocation(this._shaderSets.at(9).shaderProgram, "u_clipMatrix");
this._shaderSets.at(9).uniformChannelFlagLocation = this.gl.getUniformLocation(this._shaderSets.at(9).shaderProgram, "u_channelFlag");
this._shaderSets.at(9).uniformBaseColorLocation = this.gl.getUniformLocation(this._shaderSets.at(9).shaderProgram, "u_baseColor");
}
/**
@ -1255,14 +1291,17 @@ export namespace Live2DCubismFramework
// Normal
ShaderNames_NormalPremultipliedAlpha,
ShaderNames_NormalMaskedPremultipliedAlpha,
ShaderNames_NomralMaskedInvertedPremultipliedAlpha,
// Add
ShaderNames_AddPremultipliedAlpha,
ShaderNames_AddMaskedPremultipledAlpha,
ShaderNames_AddMaskedPremultipliedAlpha,
ShaderNames_AddMaskedPremultipliedAlphaInverted,
// Mult
ShaderNames_MultPremultipliedAlpha,
ShaderNames_MultMaskedPremultipliedAlpha,
ShaderNames_MultMaskedPremultipliedAlphaInverted
};
export const vertexShaderSrcSetupMask =
@ -1355,6 +1394,24 @@ export namespace Live2DCubismFramework
" gl_FragColor = col_formask;" +
"}";
// Normal & Add & Mult 共通クリッピングされて反転使用の描画用、PremultipliedAlphaの場合
export const fragmentShaderSrcMaskInvertedPremultipliedAlpha =
"precision mediump float;" +
"varying vec2 v_texCoord;" +
"varying vec4 v_clipPos;" +
"uniform sampler2D s_texture0;" +
"uniform sampler2D s_texture1;" +
"uniform vec4 u_channelFlag;" +
"uniform vec4 u_baseColor;" +
"void main()" +
"{" +
"vec4 col_formask = texture2D(s_texture0, v_texCoord) * u_baseColor;" +
"vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag;" +
"float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a;" +
"col_formask = col_formask * (1.0 - maskVal);" +
"gl_FragColor = col_formask;" +
"}";
/**
* WebGL
*/
@ -1532,7 +1589,8 @@ export namespace Live2DCubismFramework
this.getModel().getDrawableVertices(drawableIndex),
this.getModel().getDrawableVertexUvs(drawableIndex),
this.getModel().getDrawableOpacity(drawableIndex),
this.getModel().getDrawableBlendMode(drawableIndex)
this.getModel().getDrawableBlendMode(drawableIndex),
this.getModel().getDrawableInvertedMaskBit(drawableIndex)
);
}
}
@ -1549,10 +1607,11 @@ export namespace Live2DCubismFramework
* @param uvArray uv
* @param opacity
* @param colorBlendMode
* @param invertedMask 使使
*/
public drawMesh(textureNo: number, indexCount: number, vertexCount: number,
indexArray: Uint16Array, vertexArray: Float32Array, uvArray: Float32Array,
opacity: number, colorBlendMode: CubismBlendMode): void
opacity: number, colorBlendMode: CubismBlendMode, invertedMask: boolean): void
{
// 裏面描画の有効・無効
if(this.isCulling())
@ -1564,7 +1623,7 @@ export namespace Live2DCubismFramework
this.gl.disable(this.gl.CULL_FACE);
}
this.gl.frontFace(this.gl.CCW); // Cubism3 OpenGLはマスク・アートメッシュ共にCCWが表面
this.gl.frontFace(this.gl.CCW); // Cubism SDK OpenGLはマスク・アートメッシュ共にCCWが表面
let modelColorRGBA: CubismTextureColor = this.getModelColor();
@ -1596,7 +1655,7 @@ export namespace Live2DCubismFramework
this, drawtexture, vertexCount, vertexArray, indexArray, uvArray,
this._bufferData,
opacity, colorBlendMode, modelColorRGBA, this.isPremultipliedAlpha(),
this.getMvpMatrix()
this.getMvpMatrix(), invertedMask
);
// ポリゴンメッシュを描画する

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import { CubismLogDebug } from "../utils/cubismdebug";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
export namespace Live2DCubismFramework

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
export namespace Live2DCubismFramework

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
export namespace Live2DCubismFramework

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismframework, LogLevel} from "../live2dcubismframework";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as csmstring} from "../type/csmstring";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
export namespace Live2DCubismFramework

193
README.md
View File

@ -1,146 +1,155 @@
# Cubism Web Samples
Live2D Cubism 3 Editorで出力したモデルを表示するアプリケーションのサンプル実装です。
Live2D Cubism 4 Editorで出力したモデルを表示するアプリケーションのサンプル実装です。
Cubism Coreライブラリと組み合わせて使用します。
# フォルダ構成
## ディレクトリ構成
- README.md ...本ドキュメント
- Core ...Coreライブラリが含まれるフォルダ
- Framework ...レンダリングやアニメーション機能などのソースコードが含まれるフォルダ
- Samples ...サンプルプロジェクトが含まれるフォルダ
- .vscode ...Visual Studio Codeのタスクや設定が含まれるフォルダ
```
.
├─ .vscode # Visual Studio Codeのタスクや設定が含まれるディレクトリ
├─ Core # Cubism Coreが含まれるディレクトリ
├─ Framework # レンダリングやアニメーション機能などのソースコードが含まれるディレクトリ
└─ Samples
└─ TypeScript
└─ Demo # サンプルプロジェクトが含まれるディレクトリ
├─ Resources # モデルのファイルや画像などのリソースが含まれるディレクトリ
└─ src
```
# Live2D Cubism Core for Web
## Live2D Cubism Core for Web
モデルをロードするためのライブラリです。
# TypeScript環境
1. node.jsをインストールします。
- https://nodejs.org/en/
2. typescriptをインストールします。
- https://www.typescriptlang.org/
3. Visual Studio Codeをインストールします。
4. 拡張機能として下記を追加します。
- Debugger for Chrome
- Live Server
5. Visual Studio Codeを再起動します。
6. ビルドに必要な物をインストールします。
package.jsonがあるディレクトリに移動し、下記コマンドを実行します。
`npm install`
当リポジトリではCubism Coreを管理していません。
[こちら](https://www.live2d.com/download/cubism-sdk/download-web/)からCubism SDK for Webをダウンロードして、
Coreディレクトリのファイルをコピーしてください。
# TypeScript Core Binding
## 開発環境の構築方法
CoreライブラリはTypeScript用に以下プロジェクトでバインドし、出力されたファイルをCoreフォルダに入れる必要があります。
1. [Node.js](https://nodejs.org/)をインストールします。
インストール、バインドに必要な手順については下記を参考にしてください。
https://github.com/Live2D/CubismBindings
1. [Visual Studio Code](https://code.visualstudio.com/)をインストールします。
動作確認バージョン
- emscripten 1.37.40, 1.38.12, 1.38.21
- Python 2.7.15
- PyYAML 3.12
- Pystache 0.5.4
バインドに必要なemscriptenについては下記を参考にしてください。
https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#updating-the-sdk
1. Visual Studio Codeの拡張機能として下記を追加します。
- [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome)
- [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer)
# ビルド方法
## ビルド方法
上記TypeScript環境を前提とした操作になります。
1. Visual Studio Codeでプロジェクトディレクトリを開きます。
1. Visual Studio Codeでプロジェクトフォルダを開きます。
(例)E:\Workspace\CubismWebSamples
1. ビルドに必要な物をインストールします。
ctrl+shift+P(macOSでは⌘+⇧+P)で`Tasks: Run Task`から`npm: install`を選択、
または、`package.json`があるディレクトリ上にてターミナル上で`npm install`でサーバが起動します。
2. ビルドし、JavaScriptを生成します。
ctrl+shift+Bでビルドタスクを選択
または ターミナル上で npm run build-sample を実行すると、JavaScriptが生成されます。
1. ビルドを行います。
ctrl+shift+B(macOSでは⌘+⇧+B)でビルドタスクを選択、またはターミナル上でnpmコマンドを実行してJavaScriptを生成します。
各タスクの説明
`npm:build-framework` : フレームワークのみをビルドし、JavaScriptファイルを生成します。
`npm:watch-framework` : フレームワークのみをウォッチし、変更が保存された際にJavaScriptファイルを生成します。
`npm:build-sample` : サンプルをビルドします。
`npm:watch-sample` : サンプルをウォッチします。
`npm:build-all` : フレームワークとサンプルをビルドします。
`npm:watch-all` : フレームワークとサンプルをウォッチします。
### ビルドタスクの説明
3. サーバーを起動します。
Visual Studio Codeの画面下の水色のフッターからGo Liveをクリックすると、サーバーが起動します。
4. 実行
F5で実行し、remote web site with sourcemapを選択します。
| コマンド | 説明 |
| --- | --- |
| `npm: build-framework` | フレームワークのみをビルドし、JavaScriptファイルを生成します |
| `npm: watch-framework` | フレームワークのみをウォッチし、変更が保存された際にJavaScriptファイルを再生成します |
| `npm: build-sample` | サンプルをビルドします |
| `npm: watch-sample` | サンプルをウォッチします |
| `npm: build-all` | フレームワークとサンプルをビルドします |
| `npm: watch-all` | フレームワークとサンプルをウォッチします |
# SDKマニュアル
## ローカルサーバの起動方法
[Cubism SDK Manual](http://docs.live2d.com/cubism-sdk-manual/top/)
ビルドした成果物はそのままファイルを開くだけでは正常に動作しないため、ローカルサーバを起動する必要があります。
### 開発時
Visual Studio Codeの画面下の水色のフッターから「Go Live」をクリックするとサーバが起動します。
ブラウザ上で`index.html`のパスまで進むと動作を確認することが出来ます。
ファイルの更新が行われると自動でブラウザのリロードが行われます。
また、`F5`を押すとでDebugger for Chromeの拡張が起動してデバッグを行うことが出来ます。
### 検証時
ctrl+shift+P(macOSでは⌘+⇧+P)で`Tasks: Run Task`から`npm: serve`を選択、
または、`package.json`があるディレクトリ上にてターミナル上で`npm run serve`でサーバが起動します。
ブラウザ上で`index.html`のパスまで進むと動作を確認することが出来ます。
シンプルな構成のサーバのため検証時におすすめです。
# 変更履歴
## SDKマニュアル
当リポジトリの変更履歴については[コミットログ](https://github.com/Live2D/CubismWebSamples/commits/master)を参照ください。
[Cubism SDK Manual](https://docs.live2d.com/cubism-sdk-manual/top/)
# 動作確認環境
## 変更履歴
- Windows Google Chrome 70.0.3538.67
- Windows Mozilla Firefox 63.0
- Windows Microsoft Edge 17.17134
- Windows Internet Explorer11 11.407.17134.0 ※(こちらのコミット以降に限ります。: [923b2398266be6f98b9fdbbdeb0bf3fd1d27a2b5](https://github.com/Live2D/CubismWebSamples/commit/923b2398266be6f98b9fdbbdeb0bf3fd1d27a2b5)
- macOS Google Chrome 70.0.3538.77
- macOS Mozilla Firefox 63.0
- macOS Safari 12.0
- iOS Safari 12.0
- Android Google Chrome 70.0.3538.64
当リポジトリの変更履歴については[CHANGELOG.md](/CHANGELOG.md)を参照ください。
# TODO
- 無し
## 動作確認環境
| Node.js | バージョン |
| --- | --- |
| Current | 12.9.1 |
| LTS | 10.16.3 |
| プラットフォーム | ブラウザ | バージョン |
| --- | --- | --- |
| Android | Google Chrome | 76.0.3809.89 |
| Android | Microsoft Edge | 42.0.2.3819 |
| Android | Mozilla Firefox | 68.0 |
| iOS | Google Chrome | 76.0.3809.81 |
| iOS | Microsoft Edge | 44.5.3 |
| iOS | Mozilla Firefox | 18.1 |
| iOS | Safari | 604.1 |
| macOS | Google Chrome | 76.0.3809.87 |
| macOS | Mozilla Firefox | 68.0.1 |
| macOS | Safari | 12.1.2 |
| Windows | Google Chrome | 76.0.3809.100 |
| Windows | Internet Explorer 11 | 11.885.17134.0 |
| Windows | Microsoft Edge | 44.18362.1.0 |
| Windows | Mozilla Firefox | 68.0.1 |
Note: 動作確認時のサーバの起動は[検証時](/README.md#検証時)の方法で行っています。
# ライセンス
## ライセンス
Cubism Web Samples は Live2D Open Software License で提供しています。
- Live2D Open Software License
[日本語](http://www.live2d.com/eula/live2d-open-software-license-agreement_jp.html)
[English](http://www.live2d.com/eula/live2d-open-software-license-agreement_en.html)
[日本語](https://www.live2d.com/eula/live2d-open-software-license-agreement_jp.html)
[English](https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html)
Live2D Cubism Core for Web は Live2D Proprietary Software License で提供しています。
- Live2D Proprietary Software License
[日本語](http://www.live2d.com/eula/live2d-proprietary-software-license-agreement_jp.html)
[English](http://www.live2d.com/eula/live2d-proprietary-software-license-agreement_en.html)
[日本語](https://www.live2d.com/eula/live2d-proprietary-software-license-agreement_jp.html)
[English](https://www.live2d.com/eula/live2d-proprietary-software-license-agreement_en.html)
Live2D のサンプルモデルは Free Material License で提供しています。
- Free Material License
[日本語](http://www.live2d.com/eula/live2d-free-material-license-agreement_jp.html)
[English](http://www.live2d.com/eula/live2d-free-material-license-agreement_en.html)
- Samples/Resources/Haru/*
- Samples/Resources/Hiyori/*
- Samples/Resources/Mark/*
- Samples/Res/Natori/
[日本語](https://www.live2d.com/eula/live2d-free-material-license-agreement_jp.html)
[English](https://www.live2d.com/eula/live2d-free-material-license-agreement_en.html)
- `./Sample/TypeScript/Demo/Resources/Haru`
- `./Sample/TypeScript/Demo/Resources/Hiyori`
- `./Sample/TypeScript/Demo/Resources/Mark`
- `./Sample/TypeScript/Demo/Resources/Natori`
- `./Sample/TypeScript/Demo/Resources/Rice`
上記のモデルをご利用になられる場合、[こちら](https://docs.live2d.com/cubism-editor-manual/sample-model/)で各モデルに設定された利用条件に同意して頂く必要がございます。
直近会計年度の売上高が 1000 万円以上の事業者様がご利用になる場合は、SDKリリース(出版許諾)ライセンスに同意していただく必要がございます。
- [SDKリリース(出版許諾)ライセンス](http://www.live2d.com/ja/products/releaselicense)
- [SDKリリース(出版許諾)ライセンス](https://www.live2d.com/ja/products/releaselicense)
*All business* users must obtain a Publication License. "Business" means an entity with the annual gross revenue more than ten million (10,000,000) JPY for the most recent fiscal year.
- [SDK Release (Publication) License](http://www.live2d.com/en/products/releaselicense)
- [SDK Release (Publication) License](https://www.live2d.com/en/products/releaselicense)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -0,0 +1,679 @@
{
"Version": 3,
"Parameters": [
{
"Id": "ParamAngleX",
"GroupId": "ParamGroupFace",
"Name": "角度 X"
},
{
"Id": "ParamAngleZ",
"GroupId": "ParamGroupFace",
"Name": "角度 Z"
},
{
"Id": "ParamEyeLOpen",
"GroupId": "ParamGroupEyes",
"Name": "左目 開閉"
},
{
"Id": "ParamEyeROpen",
"GroupId": "ParamGroupEyes",
"Name": "右目 開閉"
},
{
"Id": "ParamEyeBallX",
"GroupId": "ParamGroupEyes",
"Name": "目玉 X"
},
{
"Id": "ParamEyeBallY",
"GroupId": "ParamGroupEyes",
"Name": "目玉 Y"
},
{
"Id": "ParamBodyAngleX",
"GroupId": "ParamGroupBody",
"Name": "体の回転 X"
},
{
"Id": "ParamBodyAngleY",
"GroupId": "ParamGroupBody",
"Name": "体の回転 Y"
},
{
"Id": "ParamBodyAngleZ",
"GroupId": "ParamGroupBody",
"Name": "体の回転 Z"
},
{
"Id": "ParamShoulderR",
"GroupId": "ParamGroupBody",
"Name": "右肩"
},
{
"Id": "ParamShoulderL",
"GroupId": "ParamGroupBody",
"Name": "左肩"
},
{
"Id": "ParamLegKnee",
"GroupId": "ParamGroupBody",
"Name": "屈伸"
},
{
"Id": "ParamLegR",
"GroupId": "ParamGroupBody",
"Name": "右足の位置"
},
{
"Id": "ParamLegRUpDw",
"GroupId": "ParamGroupBody",
"Name": "右足の上下"
},
{
"Id": "ParamAllZ",
"GroupId": "ParamGroupBody",
"Name": "全体のZ"
},
{
"Id": "ParamArmR01",
"GroupId": "ParamGroupArms",
"Name": "右上腕"
},
{
"Id": "ParamArmR01Y",
"GroupId": "ParamGroupArms",
"Name": "右上腕 Y"
},
{
"Id": "ParamArmR02",
"GroupId": "ParamGroupArms",
"Name": "右前腕"
},
{
"Id": "ParamArmR02Y",
"GroupId": "ParamGroupArms",
"Name": "右前腕 Y"
},
{
"Id": "ParamArmR03",
"GroupId": "ParamGroupArms",
"Name": "右手"
},
{
"Id": "ParamArmL01",
"GroupId": "ParamGroupArms",
"Name": "左上腕"
},
{
"Id": "ParamArmL02",
"GroupId": "ParamGroupArms",
"Name": "左前腕"
},
{
"Id": "ParamArmL03",
"GroupId": "ParamGroupArms",
"Name": "左手"
},
{
"Id": "ParamArmChange",
"GroupId": "ParamGroupArms",
"Name": "腕 切り替え"
},
{
"Id": "ParamBookPage",
"GroupId": "ParamGroupArms",
"Name": "本 ページ"
},
{
"Id": "ParamFlameOn",
"GroupId": "ParamGroupFlame",
"Name": "炎 表示"
},
{
"Id": "ParamFlame",
"GroupId": "ParamGroupFlame",
"Name": "炎"
},
{
"Id": "ParamFlameShaking",
"GroupId": "ParamGroupFlame",
"Name": "炎の揺れ"
},
{
"Id": "ParamFlameX",
"GroupId": "ParamGroupFlame",
"Name": "炎の位置 X"
},
{
"Id": "ParamFlameY",
"GroupId": "ParamGroupFlame",
"Name": "炎の位置 Y"
},
{
"Id": "ParamCharge01On",
"GroupId": "ParamGroupEffectsA",
"Name": "溜めの表示"
},
{
"Id": "ParamCharge01",
"GroupId": "ParamGroupEffectsA",
"Name": "溜め"
},
{
"Id": "ParamHandLightAOn",
"GroupId": "ParamGroupEffectsA",
"Name": "手の光Aの表示"
},
{
"Id": "ParamHandLightASize",
"GroupId": "ParamGroupEffectsA",
"Name": "手の光Aの拡縮"
},
{
"Id": "ParamMagicPowersA",
"GroupId": "ParamGroupEffectsA",
"Name": "波動A"
},
{
"Id": "ParamMagicAOn",
"GroupId": "ParamGroupEffectsA",
"Name": "魔法陣Aの表示"
},
{
"Id": "ParamMagicARotation",
"GroupId": "ParamGroupEffectsA",
"Name": "魔法陣Aの回転"
},
{
"Id": "ParamMagicALight",
"GroupId": "ParamGroupEffectsA",
"Name": "魔法陣A 光"
},
{
"Id": "ParamEffectAX",
"GroupId": "ParamGroupEffectsA",
"Name": "エフェクトAの位置 X"
},
{
"Id": "ParamEffectAY",
"GroupId": "ParamGroupEffectsA",
"Name": "エフェクトAの位置 Y"
},
{
"Id": "ParamHandLightBOn",
"GroupId": "ParamGroupEffectsB",
"Name": "手の光Bの表示"
},
{
"Id": "ParamHandLightBSize",
"GroupId": "ParamGroupEffectsB",
"Name": "手の光Bの拡張"
},
{
"Id": "ParamMagicBOn",
"GroupId": "ParamGroupEffectsB",
"Name": "魔法陣Bの表示"
},
{
"Id": "ParamMagicBRotation",
"GroupId": "ParamGroupEffectsB",
"Name": "魔法陣Bの回転"
},
{
"Id": "ParamMagicBMove",
"GroupId": "ParamGroupEffectsB",
"Name": "魔法陣Bの移動"
},
{
"Id": "ParamMagicBX",
"GroupId": "ParamGroupEffectsB",
"Name": "魔法陣Bの角度 X"
},
{
"Id": "ParamMagicPowersBOn",
"GroupId": "ParamGroupEffectsB",
"Name": "波動Bの表示"
},
{
"Id": "ParamMagicPowersBSize",
"GroupId": "ParamGroupEffectsB",
"Name": "波動Bの拡張"
},
{
"Id": "ParamMagicPowersBThicknesses",
"GroupId": "ParamGroupEffectsB",
"Name": "波動Bの太さ"
},
{
"Id": "ParamEffectBX",
"GroupId": "ParamGroupEffectsB",
"Name": "エフェクトBの位置 X"
},
{
"Id": "ParamEffectBY",
"GroupId": "ParamGroupEffectsB",
"Name": "エフェクトBの位置 Y"
},
{
"Id": "ParamHeadRibbon",
"GroupId": "ParamGroupSwing",
"Name": "頭リボンの揺れ"
},
{
"Id": "ParamBustRibbon01",
"GroupId": "ParamGroupSwing",
"Name": "胸リボンの揺れ01"
},
{
"Id": "ParamBustRibbon02",
"GroupId": "ParamGroupSwing",
"Name": "胸リボンの揺れ02"
},
{
"Id": "ParamWaistRibbon01",
"GroupId": "ParamGroupSwing",
"Name": "腰リボンの揺れ01"
},
{
"Id": "ParamWaistRibbon02",
"GroupId": "ParamGroupSwing",
"Name": "腰リボンの揺れ02"
},
{
"Id": "ParamSkirt",
"GroupId": "ParamGroupSwing",
"Name": "スカートのなびき"
},
{
"Id": "ParamSkirtX",
"GroupId": "ParamGroupSwing",
"Name": "スカートの揺れ X"
},
{
"Id": "ParamSkirtY",
"GroupId": "ParamGroupSwing",
"Name": "スカートの揺れ Y"
},
{
"Id": "ParamHairFront01",
"GroupId": "ParamGroupHairFront",
"Name": "髪揺れ 前01"
},
{
"Id": "ParamHairFront02",
"GroupId": "ParamGroupHairFront",
"Name": "髪揺れ 前02"
},
{
"Id": "Param_Angle_Rotation_1_ArtMesh67",
"GroupId": "ParamGroupHairSideR",
"Name": "[0]右横髪"
},
{
"Id": "Param_Angle_Rotation_2_ArtMesh67",
"GroupId": "ParamGroupHairSideR",
"Name": "[1]右横髪"
},
{
"Id": "Param_Angle_Rotation_3_ArtMesh67",
"GroupId": "ParamGroupHairSideR",
"Name": "[2]右横髪"
},
{
"Id": "Param_Angle_Rotation_4_ArtMesh67",
"GroupId": "ParamGroupHairSideR",
"Name": "[3]右横髪"
},
{
"Id": "Param_Angle_Rotation_5_ArtMesh67",
"GroupId": "ParamGroupHairSideR",
"Name": "[4]右横髪"
},
{
"Id": "Param_Angle_Rotation_1_ArtMesh20",
"GroupId": "ParamGroupHairSideL",
"Name": "[0]左横髪"
},
{
"Id": "Param_Angle_Rotation_2_ArtMesh20",
"GroupId": "ParamGroupHairSideL",
"Name": "[1]左横髪"
},
{
"Id": "Param_Angle_Rotation_3_ArtMesh20",
"GroupId": "ParamGroupHairSideL",
"Name": "[2]左横髪"
},
{
"Id": "Param_Angle_Rotation_4_ArtMesh20",
"GroupId": "ParamGroupHairSideL",
"Name": "[3]左横髪"
},
{
"Id": "Param_Angle_Rotation_5_ArtMesh20",
"GroupId": "ParamGroupHairSideL",
"Name": "[4]左横髪"
},
{
"Id": "Param_Angle_Rotation_1_ArtMesh82",
"GroupId": "ParamGroupHairBackA",
"Name": "[0]後髪A"
},
{
"Id": "Param_Angle_Rotation_2_ArtMesh82",
"GroupId": "ParamGroupHairBackA",
"Name": "[1]後髪A"
},
{
"Id": "Param_Angle_Rotation_3_ArtMesh82",
"GroupId": "ParamGroupHairBackA",
"Name": "[2]後髪A"
},
{
"Id": "Param_Angle_Rotation_4_ArtMesh82",
"GroupId": "ParamGroupHairBackA",
"Name": "[3]後髪A"
},
{
"Id": "Param_Angle_Rotation_5_ArtMesh82",
"GroupId": "ParamGroupHairBackA",
"Name": "[4]後髪A"
},
{
"Id": "Param_Angle_Rotation_6_ArtMesh82",
"GroupId": "ParamGroupHairBackA",
"Name": "[5]後髪A"
},
{
"Id": "Param_Angle_Rotation_7_ArtMesh82",
"GroupId": "ParamGroupHairBackA",
"Name": "[6]後髪A"
},
{
"Id": "Param_Angle_Rotation_1_ArtMesh81",
"GroupId": "ParamGroupHairBackB",
"Name": "[0]後髪B"
},
{
"Id": "Param_Angle_Rotation_2_ArtMesh81",
"GroupId": "ParamGroupHairBackB",
"Name": "[1]後髪B"
},
{
"Id": "Param_Angle_Rotation_3_ArtMesh81",
"GroupId": "ParamGroupHairBackB",
"Name": "[2]後髪B"
},
{
"Id": "Param_Angle_Rotation_4_ArtMesh81",
"GroupId": "ParamGroupHairBackB",
"Name": "[3]後髪B"
},
{
"Id": "Param_Angle_Rotation_5_ArtMesh81",
"GroupId": "ParamGroupHairBackB",
"Name": "[4]後髪B"
},
{
"Id": "Param_Angle_Rotation_6_ArtMesh81",
"GroupId": "ParamGroupHairBackB",
"Name": "[5]後髪B"
},
{
"Id": "Param_Angle_Rotation_7_ArtMesh81",
"GroupId": "ParamGroupHairBackB",
"Name": "[6]後髪B"
},
{
"Id": "Param_Angle_Rotation_8_ArtMesh81",
"GroupId": "ParamGroupHairBackB",
"Name": "[7]後髪B"
},
{
"Id": "Param_Angle_Rotation_9_ArtMesh81",
"GroupId": "ParamGroupHairBackB",
"Name": "[8]後髪B"
},
{
"Id": "Param_Angle_Rotation_1_ArtMesh80",
"GroupId": "ParamGroupHairBackC",
"Name": "[0]後髪C"
},
{
"Id": "Param_Angle_Rotation_2_ArtMesh80",
"GroupId": "ParamGroupHairBackC",
"Name": "[1]後髪C"
},
{
"Id": "Param_Angle_Rotation_3_ArtMesh80",
"GroupId": "ParamGroupHairBackC",
"Name": "[2]後髪C"
},
{
"Id": "Param_Angle_Rotation_4_ArtMesh80",
"GroupId": "ParamGroupHairBackC",
"Name": "[3]後髪C"
},
{
"Id": "Param_Angle_Rotation_5_ArtMesh80",
"GroupId": "ParamGroupHairBackC",
"Name": "[4]後髪C"
},
{
"Id": "Param_Angle_Rotation_6_ArtMesh80",
"GroupId": "ParamGroupHairBackC",
"Name": "[5]後髪C"
},
{
"Id": "Param_Angle_Rotation_7_ArtMesh80",
"GroupId": "ParamGroupHairBackC",
"Name": "[6]後髪C"
},
{
"Id": "Param_Angle_Rotation_8_ArtMesh80",
"GroupId": "ParamGroupHairBackC",
"Name": "[7]後髪C"
},
{
"Id": "Param_Angle_Rotation_9_ArtMesh80",
"GroupId": "ParamGroupHairBackC",
"Name": "[8]後髪C"
}
],
"ParameterGroups": [
{
"Id": "ParamGroupFace",
"GroupId": "",
"Name": "顔"
},
{
"Id": "ParamGroupEyes",
"GroupId": "",
"Name": "目"
},
{
"Id": "ParamGroupBody",
"GroupId": "",
"Name": "体"
},
{
"Id": "ParamGroupArms",
"GroupId": "",
"Name": "腕"
},
{
"Id": "ParamGroupFlame",
"GroupId": "",
"Name": "炎"
},
{
"Id": "ParamGroupEffectsA",
"GroupId": "",
"Name": "エフェクトA"
},
{
"Id": "ParamGroupEffectsB",
"GroupId": "",
"Name": "エフェクトB"
},
{
"Id": "ParamGroupSwing",
"GroupId": "",
"Name": "揺れもの"
},
{
"Id": "ParamGroupHairFront",
"GroupId": "",
"Name": "前髪"
},
{
"Id": "ParamGroupHairSideR",
"GroupId": "",
"Name": "右横髪"
},
{
"Id": "ParamGroupHairSideL",
"GroupId": "",
"Name": "左横髪"
},
{
"Id": "ParamGroupHairBackA",
"GroupId": "",
"Name": "後髪A"
},
{
"Id": "ParamGroupHairBackB",
"GroupId": "",
"Name": "後髪B"
},
{
"Id": "ParamGroupHairBackC",
"GroupId": "",
"Name": "後髪C"
}
],
"Parts": [
{
"Id": "PartCore",
"Name": "コア"
},
{
"Id": "PartFlame",
"Name": "炎"
},
{
"Id": "PartMagicPowersB",
"Name": "波動B"
},
{
"Id": "PartMagicB",
"Name": "魔法陣B"
},
{
"Id": "PartMagicPowersA",
"Name": "波動A"
},
{
"Id": "PartMagicA",
"Name": "魔法陣A"
},
{
"Id": "PartHat",
"Name": "帽子"
},
{
"Id": "PartHair",
"Name": "髪"
},
{
"Id": "PartBrow",
"Name": "眉"
},
{
"Id": "PartEyeL",
"Name": "左目"
},
{
"Id": "PartEyeR",
"Name": "右目"
},
{
"Id": "PartFace",
"Name": "顔"
},
{
"Id": "PartArmR02",
"Name": "右腕 差分"
},
{
"Id": "PartArmR01",
"Name": "右腕"
},
{
"Id": "PartBody",
"Name": "体"
},
{
"Id": "PartLegR",
"Name": "右足"
},
{
"Id": "PartLegL",
"Name": "左足"
},
{
"Id": "PartArmL",
"Name": "左腕"
},
{
"Id": "PartHairBack",
"Name": "後ろ髪"
},
{
"Id": "PartWaveSave",
"Name": "波動 溜め"
},
{
"Id": "ArtMesh20_Skinning",
"Name": "左横髪(スキニング)"
},
{
"Id": "Part20",
"Name": "左横髪(回転)"
},
{
"Id": "ArtMesh67_Skinning",
"Name": "右横髪(スキニング)"
},
{
"Id": "Part19",
"Name": "右横髪(回転)"
},
{
"Id": "ArtMesh80_Skinning",
"Name": "後髪C(スキニング)"
},
{
"Id": "Part17",
"Name": "後髪C(回転)"
},
{
"Id": "ArtMesh81_Skinning",
"Name": "後髪B(スキニング)"
},
{
"Id": "Part18",
"Name": "後髪B(回転)"
},
{
"Id": "ArtMesh82_Skinning",
"Name": "後髪A(スキニング)"
},
{
"Id": "Part16",
"Name": "後髪A(回転)"
}
]
}

Binary file not shown.

View File

@ -0,0 +1,51 @@
{
"Version": 3,
"FileReferences": {
"Moc": "Rice.moc3",
"Textures": [
"Rice.2048/texture_00.png",
"Rice.2048/texture_01.png"
],
"Physics": "Rice.physics3.json",
"DisplayInfo": "Rice.cdi3.json",
"Motions": {
"Idle": [
{
"File": "motions/mtn_00.motion3.json"
}
],
"TapBody": [
{
"File": "motions/mtn_01.motion3.json"
},
{
"File": "motions/mtn_02.motion3.json"
},
{
"File": "motions/mtn_03.motion3.json"
}
]
}
},
"Groups": [
{
"Target": "Parameter",
"Name": "EyeBlink",
"Ids": [
"ParamEyeLOpen",
"ParamEyeROpen"
]
},
{
"Target": "Parameter",
"Name": "LipSync",
"Ids": []
}
],
"HitAreas": [
{
"Id": "HitAreaBody",
"Name": "Body"
}
]
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,9 +2,9 @@
<html lang="ja">
<head>
<meta name="viewport" content="width=1900">
<meta charset="utf-8" />
<title>TypeScript HTML App</title>
<meta name="viewport" content="width=1900">
</head>
<body>
<!-- Canvas -->

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {LogLevel} from "../../../../Framework/live2dcubismframework";
@ -43,7 +43,8 @@ export namespace LAppDefine
"Haru",
"Hiyori",
"Mark",
"Natori"
"Natori",
"Rice"
]
export const ModelDirSize: number = ModelDir.length;

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as live2dcubismframework, Option as Csm_Option} from "../../../../Framework/live2dcubismframework";
@ -22,7 +22,7 @@ export let frameBuffer: WebGLFramebuffer = null;
/**
*
* Cubism3
* Cubism SDK
*/
export class LAppDelegate
{
@ -105,7 +105,7 @@ export class LAppDelegate
// AppViewの初期化
this._view.initialize();
// Cubism3の初期化
// Cubism SDKの初期化
this.initializeCubism();
return true;
@ -125,7 +125,7 @@ export class LAppDelegate
// リソースを解放
LAppLive2DManager.releaseInstance();
// Cubism3の解放
// Cubism SDKの解放
Csm_CubismFramework.dispose();
}
@ -267,7 +267,7 @@ export class LAppDelegate
}
/**
* Cubism3
* Cubism SDK
*/
public initializeCubism(): void
{
@ -290,7 +290,7 @@ export class LAppDelegate
this._view.initializeSprite();
}
_cubismOption: Csm_Option; // Cubism3 Option
_cubismOption: Csm_Option; // Cubism SDK Option
_view: LAppView; // View情報
_captured: boolean; // クリックしているか
_mouseX: number; // マウスX座標

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismmatrix44} from "../../../../Framework/math/cubismmatrix44";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as live2dcubismframework} from "../../../../Framework/live2dcubismframework";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
/**

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import { gl, canvas } from "./lappdelegate";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as csmvector} from "../../../../Framework/type/csmvector";
@ -51,6 +51,9 @@ export class LAppTextureManager
if(ite.ptr().fileName == fileName && ite.ptr().usePremultply == usePremultiply)
{
// 2回目以降はキャッシュが使用される(待ち時間なし)
// WebKitでは同じImageのonloadを再度呼ぶには再インスタンスが必要
// 詳細https://stackoverflow.com/a/5024181
ite.ptr().img = new Image();
ite.ptr().img.onload = () =>
{
callback(ite.ptr());

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import {Live2DCubismFramework as cubismMatrix44} from "../../../../Framework/math/cubismmatrix44";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
import { LAppDelegate } from "./lappdelegate";

View File

@ -1,8 +1,8 @@
/*
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at http://live2d.com/eula/live2d-open-software-license-agreement_en.html.
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/
export class TouchManager

5360
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,15 +5,17 @@
"build-sample": "npx webpack --config sample.webpack.config.js",
"watch-sample": "npx webpack --watch --config sample.webpack.config.js",
"build-all": "npm-run-all build-framework build-sample",
"watch-all": "npm-run-all watch-framework watch-sample"
"watch-all": "npm-run-all watch-framework watch-sample",
"serve": "serve"
},
"devDependencies": {
"npm-run-all": "^4.1.3",
"ts-loader": "^4.4.2",
"typescript": "^3.0.1",
"webpack": "^4.16.5",
"webpack-cli": "^3.1.0",
"glob": "^7.1.2"
"glob": "^7.1.4",
"npm-run-all": "^4.1.5",
"serve": "^11.1.0",
"ts-loader": "^6.0.4",
"typescript": "^3.5.3",
"webpack": "^4.39.1",
"webpack-cli": "^3.3.6"
},
"dependencies": {
"whatwg-fetch": "^3.0.0"