mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
@@ -43,8 +43,8 @@ function ConvexPartition(vertices) {
|
||||
var list = [];
|
||||
var d, lowerDist, upperDist;
|
||||
var p;
|
||||
var lowervar = cc.v2();
|
||||
var uppervar = cc.v2(); // intersection points
|
||||
var lowerInt = cc.v2();
|
||||
var upperInt = cc.v2(); // intersection points
|
||||
var lowerIndex = 0, upperIndex = 0;
|
||||
var lowerPoly, upperPoly;
|
||||
|
||||
@@ -64,7 +64,7 @@ function ConvexPartition(vertices) {
|
||||
if (d < lowerDist) {
|
||||
// keep only the closest intersection
|
||||
lowerDist = d;
|
||||
lowervar = p;
|
||||
lowerInt = p;
|
||||
lowerIndex = j;
|
||||
}
|
||||
}
|
||||
@@ -79,7 +79,7 @@ function ConvexPartition(vertices) {
|
||||
if (d < upperDist) {
|
||||
upperDist = d;
|
||||
upperIndex = j;
|
||||
uppervar = p;
|
||||
upperInt = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,12 +87,12 @@ function ConvexPartition(vertices) {
|
||||
|
||||
// if there are no vertices to connect to, choose a povar in the middle
|
||||
if (lowerIndex == (upperIndex + 1) % vertices.length) {
|
||||
var sp = lowervar.add(upperInt).div(2);
|
||||
var sp = lowerInt.add(upperInt).div(2);
|
||||
|
||||
lowerPoly = Copy(i, upperIndex, vertices);
|
||||
lowerPoly.Add(sp);
|
||||
lowerPoly.push(sp);
|
||||
upperPoly = Copy(lowerIndex, i, vertices);
|
||||
upperPoly.Add(sp);
|
||||
upperPoly.push(sp);
|
||||
}
|
||||
else {
|
||||
var highestScore = 0, bestIndex = lowerIndex;
|
||||
|
||||
@@ -286,7 +286,7 @@ var ccclass = checkCtorArgument(function (ctor, name) {
|
||||
* }
|
||||
* });
|
||||
* @typescript
|
||||
* property(options?: {type?: any; url?: typeof cc.RawAsset; visible?: boolean|(() => boolean); displayName?: string; tooltip?: string; multiline?: boolean; readonly?: boolean; min?: number; max?: number; step?: number; range?: number[]; slide?: boolean; serializable?: boolean; editorOnly?: boolean; override?: boolean; animatable?: boolean; default?: any}): Function
|
||||
* property(options?: {type?: any; url?: typeof cc.RawAsset; visible?: boolean|(() => boolean); displayName?: string; tooltip?: string; multiline?: boolean; readonly?: boolean; min?: number; max?: number; step?: number; range?: number[]; slide?: boolean; serializable?: boolean; editorOnly?: boolean; override?: boolean; animatable?: boolean; default?: any} | any[]|Function|cc.ValueType|number|string|boolean): Function
|
||||
* property(_target: Object, _key: any, _desc?: any): void
|
||||
*/
|
||||
function property (ctorProtoOrOptions, propName, desc) {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// tslib 1.7.1
|
||||
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]; };
|
||||
|
||||
Reference in New Issue
Block a user