Merge branch '3.7-beta' into 3.7-beta-cpp

This commit is contained in:
badlogic 2018-10-26 17:44:33 +02:00
commit f825a1a0ae
27 changed files with 372 additions and 248 deletions

View File

@ -416,13 +416,23 @@ package spine {
}
private function addCurvePosition(p : Number, x1 : Number, y1 : Number, cx1 : Number, cy1 : Number, cx2 : Number, cy2 : Number, x2 : Number, y2 : Number, out : Vector.<Number>, o : int, tangents : Boolean) : void {
if (p == 0 || isNaN(p)) p = 0.0001;
if (p == 0 || isNaN(p)) {
out[o] = x1;
out[o + 1] = y1;
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
return;
}
var tt : Number = p * p, ttt : Number = tt * p, u : Number = 1 - p, uu : Number = u * u, uuu : Number = uu * u;
var ut : Number = u * p, ut3 : Number = ut * 3, uut3 : Number = u * ut3, utt3 : Number = ut3 * p;
var x : Number = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y : Number = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
out[o] = x;
out[o + 1] = y;
if (tangents) out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
if (tangents) {
if (p < 0.001)
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
else
out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
}
}
public function get bones() : Vector.<Bone> {

View File

@ -224,13 +224,24 @@ static void _addCurvePosition (float p, float x1, float y1, float cx1, float cy1
float tt, ttt, u, uu, uuu;
float ut, ut3, uut3, utt3;
float x, y;
if (p == 0 || _isNan(p, 0)) p = 0.0001f;
if (p == 0 || _isNan(p, 0)) {
out[o] = x1;
out[o + 1] = y1;
out[o + 2] = ATAN2(cy1 - y1, cx1 - x1);
return;
}
tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;
ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;
x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
out[o] = x;
out[o + 1] = y;
if (tangents) out[o + 2] = ATAN2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
if (tangents) {
if (p < 0.001) {
out[o + 2] = ATAN2(cy1 - y1, cx1 - x1);
} else {
out[o + 2] = ATAN2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
}
}
}
float* spPathConstraint_computeWorldPositions(spPathConstraint* self, spPathAttachment* path, int spacesCount, int/*bool*/ tangents, int/*bool*/percentPosition, int/**/percentSpacing) {

View File

@ -549,7 +549,10 @@ void PathConstraint::addAfterPosition(float p, Vector<float> &temp, int i, Vecto
void PathConstraint::addCurvePosition(float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2,
float y2, Vector<float> &output, int o, bool tangents) {
if (p < EPSILON || MathUtil::isNan(p)) {
p = EPSILON;
output[o] = x1;
output[o + 1] = y1;
output[o + 2] = MathUtil::atan2(cy1 - y1, cx1 - x1);
return;
}
float tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;
@ -558,7 +561,11 @@ void PathConstraint::addCurvePosition(float p, float x1, float y1, float cx1, fl
output[o] = x;
output[o + 1] = y;
if (tangents) {
output[o + 2] = MathUtil::atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt),
x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
if (p < 0.001) {
output[o + 2] = MathUtil::atan2(cy1 - y1, cx1 - x1);
} else {
output[o + 2] = MathUtil::atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt),
x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
}
}
}

View File

@ -416,14 +416,23 @@ namespace Spine {
static void AddCurvePosition (float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2,
float[] output, int o, bool tangents) {
if (p < PathConstraint.Epsilon || float.IsNaN(p)) p = PathConstraint.Epsilon;
if (p < PathConstraint.Epsilon || float.IsNaN(p)) {
out[o] = x1;
out[o + 1] = y1;
out[o + 2] = (float)Math.Atan2(cy1 - y1, cx1 - x1);
return;
}
float tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;
float ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;
float x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
output[o] = x;
output[o + 1] = y;
if (tangents)
output[o + 2] = (float)Math.Atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
if (tangents) {
if (p < 0.001f)
out[o + 2] = (float)Math.Atan2(cy1 - y1, cx1 - x1);
else
out[o + 2] = (float)Math.Atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
}
}
}
}

View File

@ -532,7 +532,12 @@ function PathConstraint:addAfterPosition(p, temp, i, out, o)
end
function PathConstraint:addCurvePosition(p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents)
if p == 0 or (p ~= p) then p = 0.0001 end
if p == 0 or (p ~= p) then
out[o + 1] = x1
out[o + 2] = y1
out[o + 3] = math_atan2(cy1 - y1, cx1 - x1)
return;
end
local tt = p * p
local ttt = tt * p
local u = 1 - p
@ -546,7 +551,13 @@ function PathConstraint:addCurvePosition(p, x1, y1, cx1, cy1, cx2, cy2, x2, y2,
local y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt
out[o + 1] = x
out[o + 2] = y
if tangents then out[o + 3] = math_atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)) end
if tangents then
if p < 0.001 then
out[o + 3] = math_atan2(cy1 - y1, cx1 - x1)
else
out[o + 3] = math_atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt))
end
end
end
return PathConstraint

View File

@ -16,11 +16,11 @@ declare module spine {
setup = 0,
first = 1,
replace = 2,
add = 3,
add = 3
}
enum MixDirection {
in = 0,
out = 1,
out = 1
}
enum TimelineType {
rotate = 0,
@ -37,7 +37,7 @@ declare module spine {
pathConstraintPosition = 11,
pathConstraintSpacing = 12,
pathConstraintMix = 13,
twoColor = 14,
twoColor = 14
}
abstract class CurveTimeline implements Timeline {
static LINEAR: number;
@ -341,7 +341,7 @@ declare module spine {
end = 2,
dispose = 3,
complete = 4,
event = 5,
event = 5
}
interface AnimationStateListener2 {
start(entry: TrackEntry): void;
@ -380,8 +380,8 @@ declare module spine {
private toLoad;
private loaded;
constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
private static downloadText(url, success, error);
private static downloadBinary(url, success, error);
private static downloadText;
private static downloadBinary;
loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
@ -414,7 +414,7 @@ declare module spine {
Normal = 0,
Additive = 1,
Multiply = 2,
Screen = 3,
Screen = 3
}
}
declare module spine {
@ -483,7 +483,7 @@ declare module spine {
OnlyTranslation = 1,
NoRotationOrReflection = 2,
NoScale = 3,
NoScaleOrReflection = 4,
NoScaleOrReflection = 4
}
}
declare module spine {
@ -593,17 +593,17 @@ declare module spine {
}
enum PositionMode {
Fixed = 0,
Percent = 1,
Percent = 1
}
enum SpacingMode {
Length = 0,
Fixed = 1,
Percent = 2,
Percent = 2
}
enum RotateMode {
Tangent = 0,
Chain = 1,
ChainScale = 2,
ChainScale = 2
}
}
declare module spine {
@ -614,12 +614,12 @@ declare module spine {
private rawAssets;
private errors;
constructor(pathPrefix?: string);
private queueAsset(clientId, textureLoader, path);
private queueAsset;
loadText(clientId: string, path: string): void;
loadJson(clientId: string, path: string): void;
loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
get(clientId: string, path: string): any;
private updateClientAssets(clientAssets);
private updateClientAssets;
isLoadingComplete(clientId: string): boolean;
dispose(): void;
hasErrors(): boolean;
@ -823,12 +823,12 @@ declare module spine {
MipMapNearestNearest = 9984,
MipMapLinearNearest = 9985,
MipMapNearestLinear = 9986,
MipMapLinearLinear = 9987,
MipMapLinearLinear = 9987
}
enum TextureWrap {
MirroredRepeat = 33648,
ClampToEdge = 33071,
Repeat = 10497,
Repeat = 10497
}
class TextureRegion {
renderObject: any;
@ -855,7 +855,7 @@ declare module spine {
pages: TextureAtlasPage[];
regions: TextureAtlasRegion[];
constructor(atlasText: string, textureLoader: (path: string) => any);
private load(atlasText, textureLoader);
private load;
findRegion(name: string): TextureAtlasRegion;
dispose(): void;
}
@ -931,9 +931,9 @@ declare module spine {
private polygonIndicesPool;
triangulate(verticesArray: ArrayLike<number>): Array<number>;
decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
private static isConcave(index, vertexCount, vertices, indices);
private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y);
private static winding(p1x, p1y, p2x, p2y, p3x, p3y);
private static isConcave;
private static positiveArea;
private static winding;
}
}
declare module spine {
@ -1105,7 +1105,7 @@ declare module spine {
Mesh = 2,
LinkedMesh = 3,
Path = 4,
Point = 5,
Point = 5
}
}
declare module spine {
@ -1271,11 +1271,11 @@ declare module spine.canvas {
private tempColor;
constructor(context: CanvasRenderingContext2D);
draw(skeleton: Skeleton): void;
private drawImages(skeleton);
private drawTriangles(skeleton);
private drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);
private computeRegionVertices(slot, region, pma);
private computeMeshVertices(slot, mesh, pma);
private drawImages;
private drawTriangles;
private drawTriangle;
private computeRegionVertices;
private computeMeshVertices;
}
}
declare module spine.webgl {
@ -1330,7 +1330,7 @@ declare module spine.webgl {
touchesPool: Pool<Touch>;
private listeners;
constructor(element: HTMLElement);
private setupCallbacks(element);
private setupCallbacks;
addListener(listener: InputListener): void;
removeListener(listener: InputListener): void;
}
@ -1439,7 +1439,7 @@ declare module spine.webgl {
drawWithOffset(shader: Shader, primitiveType: number, offset: number, count: number): void;
bind(shader: Shader): void;
unbind(shader: Shader): void;
private update();
private update;
restore(): void;
dispose(): void;
}
@ -1465,7 +1465,7 @@ declare module spine.webgl {
constructor();
}
enum VertexAttributeType {
Float = 0,
Float = 0
}
}
declare module spine.webgl {
@ -1484,7 +1484,7 @@ declare module spine.webgl {
begin(shader: Shader): void;
setBlendMode(srcBlend: number, dstBlend: number): void;
draw(texture: GLTexture, vertices: ArrayLike<number>, indices: Array<number>): void;
private flush();
private flush;
end(): void;
getDrawCalls(): number;
dispose(): void;
@ -1524,13 +1524,13 @@ declare module spine.webgl {
curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
end(): void;
resize(resizeMode: ResizeMode): void;
private enableRenderer(renderer);
private enableRenderer;
dispose(): void;
}
enum ResizeMode {
Stretch = 0,
Expand = 1,
Fit = 2,
Fit = 2
}
}
declare module spine.webgl {
@ -1558,9 +1558,9 @@ declare module spine.webgl {
getVertexShaderSource(): string;
getFragmentSource(): string;
constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string);
private compile();
private compileShader(type, source);
private compileProgram(vs, fs);
private compile;
private compileShader;
private compileProgram;
restore(): void;
bind(): void;
unbind(): void;
@ -1607,16 +1607,16 @@ declare module spine.webgl {
polygon(polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color): void;
circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void;
curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
private vertex(x, y, color);
private vertex;
end(): void;
private flush();
private check(shapeType, numVertices);
private flush;
private check;
dispose(): void;
}
enum ShapeType {
Point = 0,
Line = 1,
Filled = 4,
Filled = 4
}
}
declare module spine.webgl {
@ -1756,9 +1756,9 @@ declare module spine.threejs {
private tempColor;
constructor(skeletonData: SkeletonData);
update(deltaTime: number): void;
private clearBatches();
private nextBatch();
private updateGeometry();
private clearBatches;
private nextBatch;
private updateGeometry;
}
}
declare module spine.threejs {
@ -1793,10 +1793,10 @@ declare module spine {
private loaded;
private bounds;
constructor(element: HTMLElement | string, config: SpineWidgetConfig);
private validateConfig(config);
private load();
private render();
private resize();
private validateConfig;
private load;
private render;
private resize;
pause(): void;
play(): void;
isPlaying(): boolean;
@ -1804,7 +1804,7 @@ declare module spine {
static loadWidgets(): void;
static loadWidget(widget: HTMLElement): void;
static pageLoaded: boolean;
private static ready();
private static ready;
static setupDOMListener(): void;
}
class SpineWidgetConfig {

View File

@ -1,7 +1,10 @@
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
@ -3242,15 +3245,23 @@ var spine;
out[o + 2] = r;
};
PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {
if (p == 0 || isNaN(p))
p = 0.0001;
if (p == 0 || isNaN(p)) {
out[o] = x1;
out[o + 1] = y1;
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
return;
}
var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;
var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;
var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
out[o] = x;
out[o + 1] = y;
if (tangents)
out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
if (tangents) {
if (p < 0.001)
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
else
out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
}
};
PathConstraint.prototype.getOrder = function () {
return this.data.order;

File diff suppressed because one or more lines are too long

View File

@ -16,11 +16,11 @@ declare module spine {
setup = 0,
first = 1,
replace = 2,
add = 3,
add = 3
}
enum MixDirection {
in = 0,
out = 1,
out = 1
}
enum TimelineType {
rotate = 0,
@ -37,7 +37,7 @@ declare module spine {
pathConstraintPosition = 11,
pathConstraintSpacing = 12,
pathConstraintMix = 13,
twoColor = 14,
twoColor = 14
}
abstract class CurveTimeline implements Timeline {
static LINEAR: number;
@ -341,7 +341,7 @@ declare module spine {
end = 2,
dispose = 3,
complete = 4,
event = 5,
event = 5
}
interface AnimationStateListener2 {
start(entry: TrackEntry): void;
@ -380,8 +380,8 @@ declare module spine {
private toLoad;
private loaded;
constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
private static downloadText(url, success, error);
private static downloadBinary(url, success, error);
private static downloadText;
private static downloadBinary;
loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
@ -414,7 +414,7 @@ declare module spine {
Normal = 0,
Additive = 1,
Multiply = 2,
Screen = 3,
Screen = 3
}
}
declare module spine {
@ -483,7 +483,7 @@ declare module spine {
OnlyTranslation = 1,
NoRotationOrReflection = 2,
NoScale = 3,
NoScaleOrReflection = 4,
NoScaleOrReflection = 4
}
}
declare module spine {
@ -593,17 +593,17 @@ declare module spine {
}
enum PositionMode {
Fixed = 0,
Percent = 1,
Percent = 1
}
enum SpacingMode {
Length = 0,
Fixed = 1,
Percent = 2,
Percent = 2
}
enum RotateMode {
Tangent = 0,
Chain = 1,
ChainScale = 2,
ChainScale = 2
}
}
declare module spine {
@ -614,12 +614,12 @@ declare module spine {
private rawAssets;
private errors;
constructor(pathPrefix?: string);
private queueAsset(clientId, textureLoader, path);
private queueAsset;
loadText(clientId: string, path: string): void;
loadJson(clientId: string, path: string): void;
loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
get(clientId: string, path: string): any;
private updateClientAssets(clientAssets);
private updateClientAssets;
isLoadingComplete(clientId: string): boolean;
dispose(): void;
hasErrors(): boolean;
@ -823,12 +823,12 @@ declare module spine {
MipMapNearestNearest = 9984,
MipMapLinearNearest = 9985,
MipMapNearestLinear = 9986,
MipMapLinearLinear = 9987,
MipMapLinearLinear = 9987
}
enum TextureWrap {
MirroredRepeat = 33648,
ClampToEdge = 33071,
Repeat = 10497,
Repeat = 10497
}
class TextureRegion {
renderObject: any;
@ -855,7 +855,7 @@ declare module spine {
pages: TextureAtlasPage[];
regions: TextureAtlasRegion[];
constructor(atlasText: string, textureLoader: (path: string) => any);
private load(atlasText, textureLoader);
private load;
findRegion(name: string): TextureAtlasRegion;
dispose(): void;
}
@ -931,9 +931,9 @@ declare module spine {
private polygonIndicesPool;
triangulate(verticesArray: ArrayLike<number>): Array<number>;
decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
private static isConcave(index, vertexCount, vertices, indices);
private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y);
private static winding(p1x, p1y, p2x, p2y, p3x, p3y);
private static isConcave;
private static positiveArea;
private static winding;
}
}
declare module spine {
@ -1105,7 +1105,7 @@ declare module spine {
Mesh = 2,
LinkedMesh = 3,
Path = 4,
Point = 5,
Point = 5
}
}
declare module spine {
@ -1271,10 +1271,10 @@ declare module spine.canvas {
private tempColor;
constructor(context: CanvasRenderingContext2D);
draw(skeleton: Skeleton): void;
private drawImages(skeleton);
private drawTriangles(skeleton);
private drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);
private computeRegionVertices(slot, region, pma);
private computeMeshVertices(slot, mesh, pma);
private drawImages;
private drawTriangles;
private drawTriangle;
private computeRegionVertices;
private computeMeshVertices;
}
}

View File

@ -1,7 +1,10 @@
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
@ -3242,15 +3245,23 @@ var spine;
out[o + 2] = r;
};
PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {
if (p == 0 || isNaN(p))
p = 0.0001;
if (p == 0 || isNaN(p)) {
out[o] = x1;
out[o + 1] = y1;
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
return;
}
var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;
var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;
var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
out[o] = x;
out[o + 1] = y;
if (tangents)
out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
if (tangents) {
if (p < 0.001)
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
else
out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
}
};
PathConstraint.prototype.getOrder = function () {
return this.data.order;

File diff suppressed because one or more lines are too long

View File

@ -16,11 +16,11 @@ declare module spine {
setup = 0,
first = 1,
replace = 2,
add = 3,
add = 3
}
enum MixDirection {
in = 0,
out = 1,
out = 1
}
enum TimelineType {
rotate = 0,
@ -37,7 +37,7 @@ declare module spine {
pathConstraintPosition = 11,
pathConstraintSpacing = 12,
pathConstraintMix = 13,
twoColor = 14,
twoColor = 14
}
abstract class CurveTimeline implements Timeline {
static LINEAR: number;
@ -341,7 +341,7 @@ declare module spine {
end = 2,
dispose = 3,
complete = 4,
event = 5,
event = 5
}
interface AnimationStateListener2 {
start(entry: TrackEntry): void;
@ -380,8 +380,8 @@ declare module spine {
private toLoad;
private loaded;
constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
private static downloadText(url, success, error);
private static downloadBinary(url, success, error);
private static downloadText;
private static downloadBinary;
loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
@ -414,7 +414,7 @@ declare module spine {
Normal = 0,
Additive = 1,
Multiply = 2,
Screen = 3,
Screen = 3
}
}
declare module spine {
@ -483,7 +483,7 @@ declare module spine {
OnlyTranslation = 1,
NoRotationOrReflection = 2,
NoScale = 3,
NoScaleOrReflection = 4,
NoScaleOrReflection = 4
}
}
declare module spine {
@ -593,17 +593,17 @@ declare module spine {
}
enum PositionMode {
Fixed = 0,
Percent = 1,
Percent = 1
}
enum SpacingMode {
Length = 0,
Fixed = 1,
Percent = 2,
Percent = 2
}
enum RotateMode {
Tangent = 0,
Chain = 1,
ChainScale = 2,
ChainScale = 2
}
}
declare module spine {
@ -614,12 +614,12 @@ declare module spine {
private rawAssets;
private errors;
constructor(pathPrefix?: string);
private queueAsset(clientId, textureLoader, path);
private queueAsset;
loadText(clientId: string, path: string): void;
loadJson(clientId: string, path: string): void;
loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
get(clientId: string, path: string): any;
private updateClientAssets(clientAssets);
private updateClientAssets;
isLoadingComplete(clientId: string): boolean;
dispose(): void;
hasErrors(): boolean;
@ -823,12 +823,12 @@ declare module spine {
MipMapNearestNearest = 9984,
MipMapLinearNearest = 9985,
MipMapNearestLinear = 9986,
MipMapLinearLinear = 9987,
MipMapLinearLinear = 9987
}
enum TextureWrap {
MirroredRepeat = 33648,
ClampToEdge = 33071,
Repeat = 10497,
Repeat = 10497
}
class TextureRegion {
renderObject: any;
@ -855,7 +855,7 @@ declare module spine {
pages: TextureAtlasPage[];
regions: TextureAtlasRegion[];
constructor(atlasText: string, textureLoader: (path: string) => any);
private load(atlasText, textureLoader);
private load;
findRegion(name: string): TextureAtlasRegion;
dispose(): void;
}
@ -931,9 +931,9 @@ declare module spine {
private polygonIndicesPool;
triangulate(verticesArray: ArrayLike<number>): Array<number>;
decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
private static isConcave(index, vertexCount, vertices, indices);
private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y);
private static winding(p1x, p1y, p2x, p2y, p3x, p3y);
private static isConcave;
private static positiveArea;
private static winding;
}
}
declare module spine {
@ -1105,7 +1105,7 @@ declare module spine {
Mesh = 2,
LinkedMesh = 3,
Path = 4,
Point = 5,
Point = 5
}
}
declare module spine {

View File

@ -1,7 +1,10 @@
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
@ -3242,15 +3245,23 @@ var spine;
out[o + 2] = r;
};
PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {
if (p == 0 || isNaN(p))
p = 0.0001;
if (p == 0 || isNaN(p)) {
out[o] = x1;
out[o + 1] = y1;
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
return;
}
var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;
var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;
var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
out[o] = x;
out[o + 1] = y;
if (tangents)
out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
if (tangents) {
if (p < 0.001)
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
else
out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
}
};
PathConstraint.prototype.getOrder = function () {
return this.data.order;

File diff suppressed because one or more lines are too long

View File

@ -16,11 +16,11 @@ declare module spine {
setup = 0,
first = 1,
replace = 2,
add = 3,
add = 3
}
enum MixDirection {
in = 0,
out = 1,
out = 1
}
enum TimelineType {
rotate = 0,
@ -37,7 +37,7 @@ declare module spine {
pathConstraintPosition = 11,
pathConstraintSpacing = 12,
pathConstraintMix = 13,
twoColor = 14,
twoColor = 14
}
abstract class CurveTimeline implements Timeline {
static LINEAR: number;
@ -341,7 +341,7 @@ declare module spine {
end = 2,
dispose = 3,
complete = 4,
event = 5,
event = 5
}
interface AnimationStateListener2 {
start(entry: TrackEntry): void;
@ -380,8 +380,8 @@ declare module spine {
private toLoad;
private loaded;
constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
private static downloadText(url, success, error);
private static downloadBinary(url, success, error);
private static downloadText;
private static downloadBinary;
loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
@ -414,7 +414,7 @@ declare module spine {
Normal = 0,
Additive = 1,
Multiply = 2,
Screen = 3,
Screen = 3
}
}
declare module spine {
@ -483,7 +483,7 @@ declare module spine {
OnlyTranslation = 1,
NoRotationOrReflection = 2,
NoScale = 3,
NoScaleOrReflection = 4,
NoScaleOrReflection = 4
}
}
declare module spine {
@ -593,17 +593,17 @@ declare module spine {
}
enum PositionMode {
Fixed = 0,
Percent = 1,
Percent = 1
}
enum SpacingMode {
Length = 0,
Fixed = 1,
Percent = 2,
Percent = 2
}
enum RotateMode {
Tangent = 0,
Chain = 1,
ChainScale = 2,
ChainScale = 2
}
}
declare module spine {
@ -614,12 +614,12 @@ declare module spine {
private rawAssets;
private errors;
constructor(pathPrefix?: string);
private queueAsset(clientId, textureLoader, path);
private queueAsset;
loadText(clientId: string, path: string): void;
loadJson(clientId: string, path: string): void;
loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
get(clientId: string, path: string): any;
private updateClientAssets(clientAssets);
private updateClientAssets;
isLoadingComplete(clientId: string): boolean;
dispose(): void;
hasErrors(): boolean;
@ -823,12 +823,12 @@ declare module spine {
MipMapNearestNearest = 9984,
MipMapLinearNearest = 9985,
MipMapNearestLinear = 9986,
MipMapLinearLinear = 9987,
MipMapLinearLinear = 9987
}
enum TextureWrap {
MirroredRepeat = 33648,
ClampToEdge = 33071,
Repeat = 10497,
Repeat = 10497
}
class TextureRegion {
renderObject: any;
@ -855,7 +855,7 @@ declare module spine {
pages: TextureAtlasPage[];
regions: TextureAtlasRegion[];
constructor(atlasText: string, textureLoader: (path: string) => any);
private load(atlasText, textureLoader);
private load;
findRegion(name: string): TextureAtlasRegion;
dispose(): void;
}
@ -931,9 +931,9 @@ declare module spine {
private polygonIndicesPool;
triangulate(verticesArray: ArrayLike<number>): Array<number>;
decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
private static isConcave(index, vertexCount, vertices, indices);
private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y);
private static winding(p1x, p1y, p2x, p2y, p3x, p3y);
private static isConcave;
private static positiveArea;
private static winding;
}
}
declare module spine {
@ -1105,7 +1105,7 @@ declare module spine {
Mesh = 2,
LinkedMesh = 3,
Path = 4,
Point = 5,
Point = 5
}
}
declare module spine {
@ -1290,9 +1290,9 @@ declare module spine.threejs {
private tempColor;
constructor(skeletonData: SkeletonData);
update(deltaTime: number): void;
private clearBatches();
private nextBatch();
private updateGeometry();
private clearBatches;
private nextBatch;
private updateGeometry;
}
}
declare module spine.threejs {

View File

@ -1,7 +1,10 @@
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
@ -3242,15 +3245,23 @@ var spine;
out[o + 2] = r;
};
PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {
if (p == 0 || isNaN(p))
p = 0.0001;
if (p == 0 || isNaN(p)) {
out[o] = x1;
out[o + 1] = y1;
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
return;
}
var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;
var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;
var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
out[o] = x;
out[o + 1] = y;
if (tangents)
out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
if (tangents) {
if (p < 0.001)
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
else
out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
}
};
PathConstraint.prototype.getOrder = function () {
return this.data.order;

File diff suppressed because one or more lines are too long

View File

@ -16,11 +16,11 @@ declare module spine {
setup = 0,
first = 1,
replace = 2,
add = 3,
add = 3
}
enum MixDirection {
in = 0,
out = 1,
out = 1
}
enum TimelineType {
rotate = 0,
@ -37,7 +37,7 @@ declare module spine {
pathConstraintPosition = 11,
pathConstraintSpacing = 12,
pathConstraintMix = 13,
twoColor = 14,
twoColor = 14
}
abstract class CurveTimeline implements Timeline {
static LINEAR: number;
@ -341,7 +341,7 @@ declare module spine {
end = 2,
dispose = 3,
complete = 4,
event = 5,
event = 5
}
interface AnimationStateListener2 {
start(entry: TrackEntry): void;
@ -380,8 +380,8 @@ declare module spine {
private toLoad;
private loaded;
constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
private static downloadText(url, success, error);
private static downloadBinary(url, success, error);
private static downloadText;
private static downloadBinary;
loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
@ -414,7 +414,7 @@ declare module spine {
Normal = 0,
Additive = 1,
Multiply = 2,
Screen = 3,
Screen = 3
}
}
declare module spine {
@ -483,7 +483,7 @@ declare module spine {
OnlyTranslation = 1,
NoRotationOrReflection = 2,
NoScale = 3,
NoScaleOrReflection = 4,
NoScaleOrReflection = 4
}
}
declare module spine {
@ -593,17 +593,17 @@ declare module spine {
}
enum PositionMode {
Fixed = 0,
Percent = 1,
Percent = 1
}
enum SpacingMode {
Length = 0,
Fixed = 1,
Percent = 2,
Percent = 2
}
enum RotateMode {
Tangent = 0,
Chain = 1,
ChainScale = 2,
ChainScale = 2
}
}
declare module spine {
@ -614,12 +614,12 @@ declare module spine {
private rawAssets;
private errors;
constructor(pathPrefix?: string);
private queueAsset(clientId, textureLoader, path);
private queueAsset;
loadText(clientId: string, path: string): void;
loadJson(clientId: string, path: string): void;
loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
get(clientId: string, path: string): any;
private updateClientAssets(clientAssets);
private updateClientAssets;
isLoadingComplete(clientId: string): boolean;
dispose(): void;
hasErrors(): boolean;
@ -823,12 +823,12 @@ declare module spine {
MipMapNearestNearest = 9984,
MipMapLinearNearest = 9985,
MipMapNearestLinear = 9986,
MipMapLinearLinear = 9987,
MipMapLinearLinear = 9987
}
enum TextureWrap {
MirroredRepeat = 33648,
ClampToEdge = 33071,
Repeat = 10497,
Repeat = 10497
}
class TextureRegion {
renderObject: any;
@ -855,7 +855,7 @@ declare module spine {
pages: TextureAtlasPage[];
regions: TextureAtlasRegion[];
constructor(atlasText: string, textureLoader: (path: string) => any);
private load(atlasText, textureLoader);
private load;
findRegion(name: string): TextureAtlasRegion;
dispose(): void;
}
@ -931,9 +931,9 @@ declare module spine {
private polygonIndicesPool;
triangulate(verticesArray: ArrayLike<number>): Array<number>;
decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
private static isConcave(index, vertexCount, vertices, indices);
private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y);
private static winding(p1x, p1y, p2x, p2y, p3x, p3y);
private static isConcave;
private static positiveArea;
private static winding;
}
}
declare module spine {
@ -1105,7 +1105,7 @@ declare module spine {
Mesh = 2,
LinkedMesh = 3,
Path = 4,
Point = 5,
Point = 5
}
}
declare module spine {
@ -1299,7 +1299,7 @@ declare module spine.webgl {
touchesPool: Pool<Touch>;
private listeners;
constructor(element: HTMLElement);
private setupCallbacks(element);
private setupCallbacks;
addListener(listener: InputListener): void;
removeListener(listener: InputListener): void;
}
@ -1408,7 +1408,7 @@ declare module spine.webgl {
drawWithOffset(shader: Shader, primitiveType: number, offset: number, count: number): void;
bind(shader: Shader): void;
unbind(shader: Shader): void;
private update();
private update;
restore(): void;
dispose(): void;
}
@ -1434,7 +1434,7 @@ declare module spine.webgl {
constructor();
}
enum VertexAttributeType {
Float = 0,
Float = 0
}
}
declare module spine.webgl {
@ -1453,7 +1453,7 @@ declare module spine.webgl {
begin(shader: Shader): void;
setBlendMode(srcBlend: number, dstBlend: number): void;
draw(texture: GLTexture, vertices: ArrayLike<number>, indices: Array<number>): void;
private flush();
private flush;
end(): void;
getDrawCalls(): number;
dispose(): void;
@ -1493,13 +1493,13 @@ declare module spine.webgl {
curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
end(): void;
resize(resizeMode: ResizeMode): void;
private enableRenderer(renderer);
private enableRenderer;
dispose(): void;
}
enum ResizeMode {
Stretch = 0,
Expand = 1,
Fit = 2,
Fit = 2
}
}
declare module spine.webgl {
@ -1527,9 +1527,9 @@ declare module spine.webgl {
getVertexShaderSource(): string;
getFragmentSource(): string;
constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string);
private compile();
private compileShader(type, source);
private compileProgram(vs, fs);
private compile;
private compileShader;
private compileProgram;
restore(): void;
bind(): void;
unbind(): void;
@ -1576,16 +1576,16 @@ declare module spine.webgl {
polygon(polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color): void;
circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void;
curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
private vertex(x, y, color);
private vertex;
end(): void;
private flush();
private check(shapeType, numVertices);
private flush;
private check;
dispose(): void;
}
enum ShapeType {
Point = 0,
Line = 1,
Filled = 4,
Filled = 4
}
}
declare module spine.webgl {

View File

@ -1,7 +1,10 @@
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
@ -3242,15 +3245,23 @@ var spine;
out[o + 2] = r;
};
PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {
if (p == 0 || isNaN(p))
p = 0.0001;
if (p == 0 || isNaN(p)) {
out[o] = x1;
out[o + 1] = y1;
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
return;
}
var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;
var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;
var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
out[o] = x;
out[o + 1] = y;
if (tangents)
out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
if (tangents) {
if (p < 0.001)
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
else
out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
}
};
PathConstraint.prototype.getOrder = function () {
return this.data.order;

File diff suppressed because one or more lines are too long

View File

@ -16,11 +16,11 @@ declare module spine {
setup = 0,
first = 1,
replace = 2,
add = 3,
add = 3
}
enum MixDirection {
in = 0,
out = 1,
out = 1
}
enum TimelineType {
rotate = 0,
@ -37,7 +37,7 @@ declare module spine {
pathConstraintPosition = 11,
pathConstraintSpacing = 12,
pathConstraintMix = 13,
twoColor = 14,
twoColor = 14
}
abstract class CurveTimeline implements Timeline {
static LINEAR: number;
@ -341,7 +341,7 @@ declare module spine {
end = 2,
dispose = 3,
complete = 4,
event = 5,
event = 5
}
interface AnimationStateListener2 {
start(entry: TrackEntry): void;
@ -380,8 +380,8 @@ declare module spine {
private toLoad;
private loaded;
constructor(textureLoader: (image: HTMLImageElement) => any, pathPrefix?: string);
private static downloadText(url, success, error);
private static downloadBinary(url, success, error);
private static downloadText;
private static downloadBinary;
loadText(path: string, success?: (path: string, text: string) => void, error?: (path: string, error: string) => void): void;
loadTexture(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
loadTextureData(path: string, data: string, success?: (path: string, image: HTMLImageElement) => void, error?: (path: string, error: string) => void): void;
@ -414,7 +414,7 @@ declare module spine {
Normal = 0,
Additive = 1,
Multiply = 2,
Screen = 3,
Screen = 3
}
}
declare module spine {
@ -483,7 +483,7 @@ declare module spine {
OnlyTranslation = 1,
NoRotationOrReflection = 2,
NoScale = 3,
NoScaleOrReflection = 4,
NoScaleOrReflection = 4
}
}
declare module spine {
@ -593,17 +593,17 @@ declare module spine {
}
enum PositionMode {
Fixed = 0,
Percent = 1,
Percent = 1
}
enum SpacingMode {
Length = 0,
Fixed = 1,
Percent = 2,
Percent = 2
}
enum RotateMode {
Tangent = 0,
Chain = 1,
ChainScale = 2,
ChainScale = 2
}
}
declare module spine {
@ -614,12 +614,12 @@ declare module spine {
private rawAssets;
private errors;
constructor(pathPrefix?: string);
private queueAsset(clientId, textureLoader, path);
private queueAsset;
loadText(clientId: string, path: string): void;
loadJson(clientId: string, path: string): void;
loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void;
get(clientId: string, path: string): any;
private updateClientAssets(clientAssets);
private updateClientAssets;
isLoadingComplete(clientId: string): boolean;
dispose(): void;
hasErrors(): boolean;
@ -823,12 +823,12 @@ declare module spine {
MipMapNearestNearest = 9984,
MipMapLinearNearest = 9985,
MipMapNearestLinear = 9986,
MipMapLinearLinear = 9987,
MipMapLinearLinear = 9987
}
enum TextureWrap {
MirroredRepeat = 33648,
ClampToEdge = 33071,
Repeat = 10497,
Repeat = 10497
}
class TextureRegion {
renderObject: any;
@ -855,7 +855,7 @@ declare module spine {
pages: TextureAtlasPage[];
regions: TextureAtlasRegion[];
constructor(atlasText: string, textureLoader: (path: string) => any);
private load(atlasText, textureLoader);
private load;
findRegion(name: string): TextureAtlasRegion;
dispose(): void;
}
@ -931,9 +931,9 @@ declare module spine {
private polygonIndicesPool;
triangulate(verticesArray: ArrayLike<number>): Array<number>;
decompose(verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>>;
private static isConcave(index, vertexCount, vertices, indices);
private static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y);
private static winding(p1x, p1y, p2x, p2y, p3x, p3y);
private static isConcave;
private static positiveArea;
private static winding;
}
}
declare module spine {
@ -1105,7 +1105,7 @@ declare module spine {
Mesh = 2,
LinkedMesh = 3,
Path = 4,
Point = 5,
Point = 5
}
}
declare module spine {
@ -1299,7 +1299,7 @@ declare module spine.webgl {
touchesPool: Pool<Touch>;
private listeners;
constructor(element: HTMLElement);
private setupCallbacks(element);
private setupCallbacks;
addListener(listener: InputListener): void;
removeListener(listener: InputListener): void;
}
@ -1408,7 +1408,7 @@ declare module spine.webgl {
drawWithOffset(shader: Shader, primitiveType: number, offset: number, count: number): void;
bind(shader: Shader): void;
unbind(shader: Shader): void;
private update();
private update;
restore(): void;
dispose(): void;
}
@ -1434,7 +1434,7 @@ declare module spine.webgl {
constructor();
}
enum VertexAttributeType {
Float = 0,
Float = 0
}
}
declare module spine.webgl {
@ -1453,7 +1453,7 @@ declare module spine.webgl {
begin(shader: Shader): void;
setBlendMode(srcBlend: number, dstBlend: number): void;
draw(texture: GLTexture, vertices: ArrayLike<number>, indices: Array<number>): void;
private flush();
private flush;
end(): void;
getDrawCalls(): number;
dispose(): void;
@ -1493,13 +1493,13 @@ declare module spine.webgl {
curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
end(): void;
resize(resizeMode: ResizeMode): void;
private enableRenderer(renderer);
private enableRenderer;
dispose(): void;
}
enum ResizeMode {
Stretch = 0,
Expand = 1,
Fit = 2,
Fit = 2
}
}
declare module spine.webgl {
@ -1527,9 +1527,9 @@ declare module spine.webgl {
getVertexShaderSource(): string;
getFragmentSource(): string;
constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string);
private compile();
private compileShader(type, source);
private compileProgram(vs, fs);
private compile;
private compileShader;
private compileProgram;
restore(): void;
bind(): void;
unbind(): void;
@ -1576,16 +1576,16 @@ declare module spine.webgl {
polygon(polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color): void;
circle(filled: boolean, x: number, y: number, radius: number, color?: Color, segments?: number): void;
curve(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color): void;
private vertex(x, y, color);
private vertex;
end(): void;
private flush();
private check(shapeType, numVertices);
private flush;
private check;
dispose(): void;
}
enum ShapeType {
Point = 0,
Line = 1,
Filled = 4,
Filled = 4
}
}
declare module spine.webgl {
@ -1703,10 +1703,10 @@ declare module spine {
private loaded;
private bounds;
constructor(element: HTMLElement | string, config: SpineWidgetConfig);
private validateConfig(config);
private load();
private render();
private resize();
private validateConfig;
private load;
private render;
private resize;
pause(): void;
play(): void;
isPlaying(): boolean;
@ -1714,7 +1714,7 @@ declare module spine {
static loadWidgets(): void;
static loadWidget(widget: HTMLElement): void;
static pageLoaded: boolean;
private static ready();
private static ready;
static setupDOMListener(): void;
}
class SpineWidgetConfig {

View File

@ -1,7 +1,10 @@
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
@ -3242,15 +3245,23 @@ var spine;
out[o + 2] = r;
};
PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {
if (p == 0 || isNaN(p))
p = 0.0001;
if (p == 0 || isNaN(p)) {
out[o] = x1;
out[o + 1] = y1;
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
return;
}
var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;
var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;
var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
out[o] = x;
out[o + 1] = y;
if (tangents)
out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
if (tangents) {
if (p < 0.001)
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
else
out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
}
};
PathConstraint.prototype.getOrder = function () {
return this.data.order;

File diff suppressed because one or more lines are too long

View File

@ -400,13 +400,23 @@ module spine {
addCurvePosition (p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number,
out: Array<number>, o: number, tangents: boolean) {
if (p == 0 || isNaN(p)) p = 0.0001;
if (p == 0 || isNaN(p)) {
out[o] = x1;
out[o + 1] = y1;
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
return;
}
let tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;
let ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;
let x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;
out[o] = x;
out[o + 1] = y;
if (tangents) out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
if (tangents) {
if (p < 0.001)
out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);
else
out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));
}
}
getOrder () {