diff --git a/dist/demo/demo.bundle.js b/dist/demo/demo.bundle.js index 97d42ca6..8925074e 100644 --- a/dist/demo/demo.bundle.js +++ b/dist/demo/demo.bundle.js @@ -829,13 +829,19 @@ class System extends base_system_1.BaseSystem { result = (0, sat_1.testPolygonPolygon)(body, candidate, this.response); } if (state.collisionVector) { + this.response.overlapV = state.collisionVector; + this.response.overlapN = this.response.overlapV.clone().normalize(); + this.response.overlap = this.response.overlapV.len(); + } + if (!body.isConvex || !candidate.isConvex) { this.response.a = body; this.response.b = candidate; + } + if (!body.isConvex) { this.response.aInB = (0, utils_1.checkAInB)(body, candidate); + } + if (!candidate.isConvex) { this.response.bInA = (0, utils_1.checkAInB)(candidate, body); - this.response.overlapV = state.collisionVector; - this.response.overlapN = this.response.overlapV.clone().normalize(); - this.response.overlap = this.response.overlapV.len(); } return result; } diff --git a/dist/system.d.ts.map b/dist/system.d.ts.map index c5128190..c856125c 100644 --- a/dist/system.d.ts.map +++ b/dist/system.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../src/system.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EACL,IAAI,EAEJ,IAAI,EACJ,aAAa,EACb,QAAQ,EAGR,MAAM,EACP,MAAM,SAAS,CAAC;AASjB;;GAEG;AACH,qBAAa,MAAO,SAAQ,UAAW,YAAW,IAAI;IACpD,QAAQ,EAAE,QAAQ,CAAkB;IAEpC;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAoB5B;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,KAAK,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC;IAMvE;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,IAA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IACH,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAM/B;;OAEG;IACH,MAAM,IAAI,IAAI;IASd;;OAEG;IACH,QAAQ,IAAI,IAAI;IAchB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IAalE;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IAMtD;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE;IAKjC;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,GAAG,OAAO;IAqFpD;;OAEG;IACH,OAAO,CACL,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,aAAa,GAAE,CAAC,YAAY,EAAE,IAAI,KAAK,OAAoB,GAC1D,aAAa;IA+BhB,OAAO,CAAC,QAAQ;CAajB"} \ No newline at end of file diff --git a/dist/system.js b/dist/system.js index d19f2626..8bab0970 100644 --- a/dist/system.js +++ b/dist/system.js @@ -138,13 +138,19 @@ class System extends base_system_1.BaseSystem { result = (0, sat_1.testPolygonPolygon)(body, candidate, this.response); } if (state.collisionVector) { + this.response.overlapV = state.collisionVector; + this.response.overlapN = this.response.overlapV.clone().normalize(); + this.response.overlap = this.response.overlapV.len(); + } + if (!body.isConvex || !candidate.isConvex) { this.response.a = body; this.response.b = candidate; + } + if (!body.isConvex) { this.response.aInB = (0, utils_1.checkAInB)(body, candidate); + } + if (!candidate.isConvex) { this.response.bInA = (0, utils_1.checkAInB)(candidate, body); - this.response.overlapV = state.collisionVector; - this.response.overlapN = this.response.overlapV.clone().normalize(); - this.response.overlap = this.response.overlapV.len(); } return result; } diff --git a/dist/system.js.map b/dist/system.js.map index 56afa581..018f8ae0 100644 --- a/dist/system.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M,GACV,QAAQ,CAAC,IAAI,KAAK,aAAK,CAAC,MAAM;gBAC5B,CAAC,CAAC,IAAA,2BAAmB,EAAC,GAAG,EAAE,QAAQ,CAAC;gBACpC,CAAC,CAAC,IAAA,4BAAoB,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YAE1C,MAAM,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE;gBAC/B,MAAM,aAAa,GAAW,IAAA,gBAAQ,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBAErD,IAAI,aAAa,GAAG,WAAW,EAAE;oBAC/B,WAAW,GAAG,aAAa,CAAC;oBAC5B,MAAM,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;iBAC9B;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,QAAQ,CAAC,KAAqB;QACpC,IAAI,KAAK,CAAC,QAAQ,EAAE;YAClB,IAAI,OAAO,KAAK,CAAC,eAAe,KAAK,WAAW,EAAE;gBAChD,KAAK,CAAC,eAAe,GAAG,IAAI,iBAAS,EAAE,CAAC;aACzC;YAED,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;SACnD;QAED,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAEtB,OAAO,KAAK,CAAC,QAAQ,CAAC;IACxB,CAAC;CACF;AArPD,wBAqPC"} \ No newline at end of file diff --git a/docs/classes/Box.html b/docs/classes/Box.html index 97910cf4..3ec7989a 100644 --- a/docs/classes/Box.html +++ b/docs/classes/Box.html @@ -25,7 +25,7 @@

Hierarchy

+
  • Defined in src/bodies/box.ts:8
  • @@ -108,19 +108,19 @@
    Optional options: Returns Box
    +
  • Defined in src/bodies/box.ts:22
  • Properties

    _height: number
    +
  • Defined in src/bodies/box.ts:14
  • _width: number
    +
  • Defined in src/bodies/box.ts:13
  • angle: number
    +
  • Defined in src/bodies/polygon.ts:44
  • edges: SATVector[]
    +
  • Defined in src/bodies/box.ts:11
  • isStatic?: boolean
    @@ -160,7 +160,7 @@
    +
  • Defined in src/bodies/polygon.ts:54
  • isTrigger?: boolean
    @@ -168,19 +168,19 @@
    +
  • Defined in src/bodies/polygon.ts:59
  • maxX: number
    +
  • Defined in src/bodies/polygon.ts:32
  • maxY: number
    +
  • Defined in src/bodies/polygon.ts:34
  • minX: number
    @@ -188,13 +188,13 @@
    +
  • Defined in src/bodies/polygon.ts:31
  • minY: number
    +
  • Defined in src/bodies/polygon.ts:33
  • normals: SATVector[]
    +
  • Defined in src/bodies/polygon.ts:49
  • points: SATVector[]
    +
  • Defined in src/bodies/polygon.ts:64
  • type: Box | Point = Types.Box
    +
  • Defined in src/bodies/box.ts:9
  • Accessors

    @@ -252,7 +252,7 @@ +
  • Defined in src/bodies/box.ts:53
  • set height(height: number): void
  • set box height, update points

    @@ -264,7 +264,7 @@

    Parameters

    height: number
  • Returns void

    +
  • Defined in src/bodies/box.ts:60
  • set width(width: number): void
  • set box width, update points

    @@ -286,7 +286,7 @@

    Parameters

    width: number
  • Returns void

    +
  • Defined in src/bodies/box.ts:44
  • set x(x: number): void
  • updating this.pos.x by this.x = x updates AABB

    @@ -308,7 +308,7 @@
    x: number
  • Returns void

    +
  • Defined in src/bodies/polygon.ts:109
  • set y(y: number): void
  • updating this.pos.y by this.y = y updates AABB

    @@ -330,7 +330,7 @@
    y: number
  • Returns void

    +
  • Defined in src/bodies/polygon.ts:122
  • Methods

    @@ -343,7 +343,7 @@
    +
  • Defined in src/bodies/polygon.ts:229
  • +
  • Defined in src/bodies/polygon.ts:183
  • +
  • Defined in src/bodies/polygon.ts:161
  • +
  • Defined in src/bodies/polygon.ts:212
  • +
  • Defined in src/bodies/polygon.ts:128
  • Returns void

    +
  • Defined in src/bodies/polygon.ts:151
  • +
  • Defined in src/bodies/polygon.ts:175
  • +
  • Defined in src/bodies/polygon.ts:136
  • Returns void

    +
  • Defined in src/bodies/circle.ts:81
  • set y(y: number): void
  • updating this.pos.y by this.y = y updates AABB

    @@ -225,7 +225,7 @@

    Parameters

    y: number
  • Returns void

    +
  • Defined in src/bodies/circle.ts:94
  • Methods

    @@ -235,7 +235,7 @@
    +
  • Defined in src/bodies/circle.ts:161
  • +
  • Defined in src/bodies/circle.ts:135
  • +
  • Defined in src/bodies/circle.ts:115
  • Returns void

    +
  • Defined in src/bodies/circle.ts:157
  • Returns void

    +
  • Defined in src/bodies/circle.ts:105
  • +
  • Defined in src/bodies/circle.ts:127
  • Returns void

    +
  • Defined in src/bodies/ellipse.ts:64
  • set radiusY(radiusY: number): void
  • set ellipse radiusY, update points

    @@ -297,7 +297,7 @@

    Parameters

    radiusY: number
  • Returns void

    +
  • Defined in src/bodies/ellipse.ts:80
  • set step(step: number): void
  • set ellipse step number

    @@ -319,7 +319,7 @@

    Parameters

    step: number
  • Returns void

    +
  • Defined in src/bodies/ellipse.ts:48
  • set x(x: number): void
  • updating this.pos.x by this.x = x updates AABB

    @@ -341,7 +341,7 @@
    x: number
  • Returns void

    +
  • Defined in src/bodies/polygon.ts:109
  • set y(y: number): void
  • updating this.pos.y by this.y = y updates AABB

    @@ -363,7 +363,7 @@
    y: number
  • Returns void

    +
  • Defined in src/bodies/polygon.ts:122
  • Methods

    @@ -374,7 +374,7 @@
    +
  • Defined in src/bodies/ellipse.ts:86
  • +
  • Defined in src/bodies/polygon.ts:183
  • +
  • Defined in src/bodies/polygon.ts:161
  • +
  • Defined in src/bodies/polygon.ts:212
  • +
  • Defined in src/bodies/polygon.ts:128
  • Returns void

    +
  • Defined in src/bodies/polygon.ts:151
  • +
  • Defined in src/bodies/polygon.ts:175
  • +
  • Defined in src/bodies/polygon.ts:136
  • Returns void

    +
  • Defined in src/bodies/polygon.ts:122
  • Methods

    @@ -303,7 +303,7 @@
    +
  • Defined in src/bodies/polygon.ts:229
  • +
  • Defined in src/bodies/polygon.ts:183
  • +
  • Defined in src/bodies/polygon.ts:161
  • +
  • Defined in src/bodies/line.ts:48
  • +
  • Defined in src/bodies/polygon.ts:212
  • +
  • Defined in src/bodies/polygon.ts:128
  • Returns void

    +
  • Defined in src/bodies/polygon.ts:151
  • +
  • Defined in src/bodies/polygon.ts:175
  • +
  • Defined in src/bodies/polygon.ts:136
  • Returns void

    +
  • Defined in src/bodies/box.ts:60
  • set width(width: number): void
  • set box width, update points

    @@ -272,7 +272,7 @@
    width: number
  • Returns void

    +
  • Defined in src/bodies/box.ts:44
  • set x(x: number): void
  • updating this.pos.x by this.x = x updates AABB

    @@ -294,7 +294,7 @@
    x: number
  • Returns void

    +
  • Defined in src/bodies/polygon.ts:109
  • set y(y: number): void
  • updating this.pos.y by this.y = y updates AABB

    @@ -316,7 +316,7 @@
    y: number
  • Returns void

    +
  • Defined in src/bodies/polygon.ts:122
  • Methods

    @@ -327,7 +327,7 @@
    +
  • Defined in src/bodies/point.ts:19
  • +
  • Defined in src/bodies/polygon.ts:183
  • +
  • Defined in src/bodies/polygon.ts:161
  • +
  • Defined in src/bodies/polygon.ts:212
  • +
  • Defined in src/bodies/polygon.ts:128
  • Returns void

    +
  • Defined in src/bodies/polygon.ts:151
  • +
  • Defined in src/bodies/polygon.ts:175
  • +
  • Defined in src/bodies/polygon.ts:136
  • +
  • Defined in src/bodies/polygon.ts:39
  • isStatic?: boolean
    @@ -152,7 +152,7 @@
    +
  • Defined in src/bodies/polygon.ts:54
  • isTrigger?: boolean
    @@ -160,19 +160,19 @@
    +
  • Defined in src/bodies/polygon.ts:59
  • maxX: number
    +
  • Defined in src/bodies/polygon.ts:32
  • maxY: number
    +
  • Defined in src/bodies/polygon.ts:34
  • minX: number
    @@ -180,13 +180,13 @@
    +
  • Defined in src/bodies/polygon.ts:31
  • minY: number
    +
  • Defined in src/bodies/polygon.ts:33
  • normals: SATVector[]
    +
  • Defined in src/bodies/polygon.ts:49
  • points: SATVector[]
    +
  • Defined in src/bodies/polygon.ts:64
  • type: Ellipse | Line | Box | Point | Polygon = Types.Polygon
    +
  • Defined in src/bodies/polygon.ts:66
  • Accessors

    @@ -242,7 +242,7 @@

    Returns void

    +
  • Defined in src/bodies/polygon.ts:109
  • set y(y: number): void
  • updating this.pos.y by this.y = y updates AABB

    @@ -274,7 +274,7 @@

    Parameters

    y: number
  • Returns void

    +
  • Defined in src/bodies/polygon.ts:122
  • Methods

    @@ -286,7 +286,7 @@
    +
  • Defined in src/bodies/polygon.ts:229
  • +
  • Defined in src/bodies/polygon.ts:183
  • +
  • Defined in src/bodies/polygon.ts:161
  • +
  • Defined in src/bodies/polygon.ts:212
  • +
  • Defined in src/bodies/polygon.ts:128
  • Returns void

    +
  • Defined in src/bodies/polygon.ts:151
  • +
  • Defined in src/bodies/polygon.ts:175
  • +
  • Defined in src/bodies/polygon.ts:136
  • Returns boolean

    +
  • Defined in src/system.ts:142
  • Returns void

    +
  • Defined in src/system.ts:109
  • Returns boolean

    +
  • Defined in src/system.ts:265
  • +
  • Defined in src/base-system.ts:83
  • +
  • Defined in src/base-system.ts:68
  • +
  • Defined in src/base-system.ts:99
  • +
  • Defined in src/base-system.ts:57
  • +
  • Defined in src/base-system.ts:46
  • +
  • Defined in src/base-system.ts:116
  • +
  • Defined in src/base-system.ts:19
  • +
  • Defined in src/base-system.ts:28
  • Returns Body[]

    +
  • Defined in src/system.ts:134
  • +
  • Defined in src/system.ts:71
  • Returns RaycastResult

    +
  • Defined in src/system.ts:230
  • +
  • Defined in src/system.ts:62
  • +
  • Defined in src/system.ts:92
  • +
  • Defined in src/system.ts:80
  • Returns void

    +
  • Defined in src/system.ts:39
  • +
  • Defined in src/model.ts:23
  • +
  • Defined in src/utils.ts:105
  • +
  • Defined in src/utils.ts:70
  • +
  • Defined in src/utils.ts:29
  • +
  • Defined in src/utils.ts:9
  • +
  • Defined in src/utils.ts:115
  • +
  • Defined in src/utils.ts:63
  • +
  • Defined in src/utils.ts:245
  • +
  • Defined in src/utils.ts:50
  • +
  • Defined in src/utils.ts:41
  • +
  • Defined in src/utils.ts:86
  • +
  • Defined in src/utils.ts:258
  • +
  • Defined in src/utils.ts:148
  • +
  • Defined in src/utils.ts:180
  • +
  • Defined in src/utils.ts:212
  • +
  • Defined in src/utils.ts:238
  • +
  • Defined in src/utils.ts:231
  • +
  • Defined in src/utils.ts:98
  • Returns void

    +
  • Defined in src/model.ts:106
  • +
  • Defined in src/model.ts:116
  • +
  • Defined in src/model.ts:111
  • +
  • Defined in src/model.ts:30
  • +
  • Defined in src/model.ts:59
  • +
  • Defined in src/model.ts:72
  • +
  • Defined in src/model.ts:44