payload: {"action":"created","comment":{"url":"https://api.github.com/repos/cocos-creator/engine/pulls/comments/279140799","pull_request_review_id":231405956,"id":279140799,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI3OTE0MDc5OQ==","diff_hunk":"@@ -0,0 +1,87 @@\n+import { Vec3 } from '../../../core';\n+import { AfterStepCallback, BeforeStepCallback, IRaycastOptions, PhysicsWorldBase, RigidBodyBase } from '../api';\n+import { RaycastResult } from '../raycast-result';\n+import { BuiltInBody } from './built-in-body';\n+\n+/**\n+ * Built-in collision system, intended for use as a\n+ * efficient discrete collision detector,\n+ * not a full physical simulator\n+ */\n+export class BuiltInWorld implements PhysicsWorldBase {\n+  private _bodies: RigidBodyBase[] = [];\n+  private _customBeforeStepListener: BeforeStepCallback[] = [];\n+  private _customAfterStepListener: AfterStepCallback[] = [];\n+  constructor () {\n+  }\n+  public step (deltaTime: number): void {\n+    /** 执行 before step */\n+    this._customBeforeStepListener.forEach((fx) => fx());\n+\n+    /** 进行物理检测 */\n+    // tslint:disable-next-line: prefer-for-of\n+    for (let i = 0; i < this._bodies.length; i++) {\n+      const bodyA = this._bodies[i] as BuiltInBody;\n+      // tslint:disable-next-line:prefer-for-of\n+      for (let j = i + 1; j < this._bodies.length; j++) {\n+        const bodyB = this._bodies[j] as BuiltInBody;\n+\n+        // TODO: 判断是否碰撞\n+        if ((bodyA.collisionFilterGroup & bodyB.collisionFilterMask) === 0 ||\n+          (bodyB.collisionFilterGroup & bodyA.collisionFilterMask) === 0) {\n+          continue;\n+        }\n+\n+        bodyA.intersects(bodyB);\n+      }\n+\n+      this._customAfterStepListener.forEach((fx) => fx());\n+    }\n+\n+    /** 执行 after step */\n+    this._customAfterStepListener.forEach((fx) => fx());\n+  }\n+  public addBody (body: RigidBodyBase) {\n+    this._bodies.push(body);\n+  }\n+  public removeBody (body: RigidBodyBase) {\n+    const i = this._bodies.indexOf(body);\n+    if (i >= 0) {\n+      this._bodies.splice(i, 1);\n+    }\n+  }\n+\n+  public addBeforeStep (cb: BeforeStepCallback) {\n+    this._customBeforeStepListener.push(cb);\n+  }\n+\n+  public removeBeforeStep (cb: BeforeStepCallback) {\n+    const i = this._customBeforeStepListener.indexOf(cb);\n+    if (i < 0) {\n+      return;\n+    }\n+    this._customBeforeStepListener.splice(i, 1);\n+  }\n+\n+  public addAfterStep (cb: AfterStepCallback) {\n+    this._customAfterStepListener.push(cb);\n+  }\n+\n+  public removeAfterStep (cb: AfterStepCallback) {\n+    const i = this._customAfterStepListener.indexOf(cb);\n+    if (i < 0) {\n+      return;\n+    }\n+    this._customAfterStepListener.splice(i, 1);\n+  }\n+  public raycastClosest (from: Vec3, to: Vec3, options: IRaycastOptions, result: RaycastResult): boolean {\n+    return false;\n+  }\n+  public raycastAny (from: Vec3, to: Vec3, options: IRaycastOptions, result: RaycastResult): boolean {\n+    return false;\n+  }\n+  public raycastAll (from: Vec3, to: Vec3, options: IRaycastOptions, callback: (result: RaycastResult) => void): boolean {\n+    return false;","path":"cocos/3d/physics/cocos/built-in-world.ts","position":84,"original_position":84,"commit_id":"23aceb25ec3efdac75a0eda69108fc6f45434623","original_commit_id":"23aceb25ec3efdac75a0eda69108fc6f45434623","user":{"login":"YunHsiao","id":9102404,"node_id":"MDQ6VXNlcjkxMDI0MDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/9102404?v=4","gravatar_id":"","url":"https://api.github.com/users/YunHsiao","html_url":"https://github.com/YunHsiao","followers_url":"https://api.github.com/users/YunHsiao/followers","following_url":"https://api.github.com/users/YunHsiao/following{/other_user}","gists_url":"https://api.github.com/users/YunHsiao/gists{/gist_id}","starred_url":"https://api.github.com/users/YunHsiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YunHsiao/subscriptions","organizations_url":"https://api.github.com/users/YunHsiao/orgs","repos_url":"https://api.github.com/users/YunHsiao/repos","events_url":"https://api.github.com/users/YunHsiao/events{/privacy}","received_events_url":"https://api.github.com/users/YunHsiao/received_events","type":"User","site_admin":false},"body":"记一下 TODO?","created_at":"2019-04-27T02:49:45Z","updated_at":"2019-04-27T02:49:51Z","html_url":"https://github.com/cocos-creator/engine/pull/4320#discussion_r279140799","pull_request_url":"https://api.github.com/repos/cocos-creator/engine/pulls/4320","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/comments/279140799"},"html":{"href":"https://github.com/cocos-creator/engine/pull/4320#discussion_r279140799"},"pull_request":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/4320"}}},"pull_request":{"url":"https://api.github.com/repos/cocos-creator/engine/pulls/4320","id":273819705,"node_id":"MDExOlB1bGxSZXF1ZXN0MjczODE5NzA1","html_url":"https://github.com/cocos-creator/engine/pull/4320","diff_url":"https://github.com/cocos-creator/engine/pull/4320.diff","patch_url":"https://github.com/cocos-creator/engine/pull/4320.patch","issue_url":"https://api.github.com/repos/cocos-creator/engine/issues/4320","number":4320,"state":"closed","locked":false,"title":"Add built-in phyiscs system","user":{"login":"JayceLai","id":23555101,"node_id":"MDQ6VXNlcjIzNTU1MTAx","avatar_url":"https://avatars1.githubusercontent.com/u/23555101?v=4","gravatar_id":"","url":"https://api.github.com/users/JayceLai","html_url":"https://github.com/JayceLai","followers_url":"https://api.github.com/users/JayceLai/followers","following_url":"https://api.github.com/users/JayceLai/following{/other_user}","gists_url":"https://api.github.com/users/JayceLai/gists{/gist_id}","starred_url":"https://api.github.com/users/JayceLai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JayceLai/subscriptions","organizations_url":"https://api.github.com/users/JayceLai/orgs","repos_url":"https://api.github.com/users/JayceLai/repos","events_url":"https://api.github.com/users/JayceLai/events{/privacy}","received_events_url":"https://api.github.com/users/JayceLai/received_events","type":"User","site_admin":false},"body":"Re: cocos-creator/3d-tasks#536\r\n\r\n根据geom-util实现内置的物理检测系统，目前只有box和sphere形状\r\n\r\nChanges:\r\n * 增加内置物理系统，目前只有检测环节，提供给Demo使用\r\n\r\n<!-- Note: Makes sure these boxes are checked before submitting your PR - thank you!\r\n\r\n- [ ] If your pull request has gone \"stale\", you should **rebase** your work on top of the latest version of the upstream branch.\r\n- [ ] If your commit history is full of small, unimportant commits (such as \"fix pep8\" or \"update tests\"), **squash** your commits down to a few, or one, discreet changesets before submitting a pull request.\r\n\r\n- For official teams:\r\n  - [ ] Check that your javascript is following our [style guide](https://docs.cocos.com/creator/manual/zh/scripting/reference/coding-standards.html) and end files with a newline\r\n  - [ ] Document new code with comments in source code based on [API Docs](https://github.com/cocos-creator/fireball#api-docs)\r\n  - [ ] Make sure any **runtime** log information in `cc.log`, `cc.error` or `new Error()` has been moved into `EngineErrorMap.md` with an ID, and use `cc.logID(id)` or `new Error(cc.debug.getError(id))` instead.\r\n\r\n-->\r\n","created_at":"2019-04-26T09:10:25Z","updated_at":"2019-04-27T02:49:51Z","closed_at":"2019-04-26T10:38:26Z","merged_at":"2019-04-26T10:38:26Z","merge_commit_sha":"a136c949ad81ce92d4be93018e962b794d941a4b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cocos-creator/engine/pulls/4320/commits","review_comments_url":"https://api.github.com/repos/cocos-creator/engine/pulls/4320/comments","review_comment_url":"https://api.github.com/repos/cocos-creator/engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cocos-creator/engine/issues/4320/comments","statuses_url":"https://api.github.com/repos/cocos-creator/engine/statuses/23aceb25ec3efdac75a0eda69108fc6f45434623","head":{"label":"JayceLai:add_built_in_phyiscs_system","ref":"add_built_in_phyiscs_system","sha":"23aceb25ec3efdac75a0eda69108fc6f45434623","user":{"login":"JayceLai","id":23555101,"node_id":"MDQ6VXNlcjIzNTU1MTAx","avatar_url":"https://avatars1.githubusercontent.com/u/23555101?v=4","gravatar_id":"","url":"https://api.github.com/users/JayceLai","html_url":"https://github.com/JayceLai","followers_url":"https://api.github.com/users/JayceLai/followers","following_url":"https://api.github.com/users/JayceLai/following{/other_user}","gists_url":"https://api.github.com/users/JayceLai/gists{/gist_id}","starred_url":"https://api.github.com/users/JayceLai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JayceLai/subscriptions","organizations_url":"https://api.github.com/users/JayceLai/orgs","repos_url":"https://api.github.com/users/JayceLai/repos","events_url":"https://api.github.com/users/JayceLai/events{/privacy}","received_events_url":"https://api.github.com/users/JayceLai/received_events","type":"User","site_admin":false},"repo":{"id":177565580,"node_id":"MDEwOlJlcG9zaXRvcnkxNzc1NjU1ODA=","name":"engine","full_name":"JayceLai/engine","private":false,"owner":{"login":"JayceLai","id":23555101,"node_id":"MDQ6VXNlcjIzNTU1MTAx","avatar_url":"https://avatars1.githubusercontent.com/u/23555101?v=4","gravatar_id":"","url":"https://api.github.com/users/JayceLai","html_url":"https://github.com/JayceLai","followers_url":"https://api.github.com/users/JayceLai/followers","following_url":"https://api.github.com/users/JayceLai/following{/other_user}","gists_url":"https://api.github.com/users/JayceLai/gists{/gist_id}","starred_url":"https://api.github.com/users/JayceLai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JayceLai/subscriptions","organizations_url":"https://api.github.com/users/JayceLai/orgs","repos_url":"https://api.github.com/users/JayceLai/repos","events_url":"https://api.github.com/users/JayceLai/events{/privacy}","received_events_url":"https://api.github.com/users/JayceLai/received_events","type":"User","site_admin":false},"html_url":"https://github.com/JayceLai/engine","description":"Cocos Creator is a complete package of game development tools and workflow, including a game engine, resource management, scene editing, game preview, debug and publish one project to multiple platforms.","fork":true,"url":"https://api.github.com/repos/JayceLai/engine","forks_url":"https://api.github.com/repos/JayceLai/engine/forks","keys_url":"https://api.github.com/repos/JayceLai/engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JayceLai/engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JayceLai/engine/teams","hooks_url":"https://api.github.com/repos/JayceLai/engine/hooks","issue_events_url":"https://api.github.com/repos/JayceLai/engine/issues/events{/number}","events_url":"https://api.github.com/repos/JayceLai/engine/events","assignees_url":"https://api.github.com/repos/JayceLai/engine/assignees{/user}","branches_url":"https://api.github.com/repos/JayceLai/engine/branches{/branch}","tags_url":"https://api.github.com/repos/JayceLai/engine/tags","blobs_url":"https://api.github.com/repos/JayceLai/engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JayceLai/engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JayceLai/engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/JayceLai/engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JayceLai/engine/statuses/{sha}","languages_url":"https://api.github.com/repos/JayceLai/engine/languages","stargazers_url":"https://api.github.com/repos/JayceLai/engine/stargazers","contributors_url":"https://api.github.com/repos/JayceLai/engine/contributors","subscribers_url":"https://api.github.com/repos/JayceLai/engine/subscribers","subscription_url":"https://api.github.com/repos/JayceLai/engine/subscription","commits_url":"https://api.github.com/repos/JayceLai/engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/JayceLai/engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/JayceLai/engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/JayceLai/engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/JayceLai/engine/contents/{+path}","compare_url":"https://api.github.com/repos/JayceLai/engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JayceLai/engine/merges","archive_url":"https://api.github.com/repos/JayceLai/engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JayceLai/engine/downloads","issues_url":"https://api.github.com/repos/JayceLai/engine/issues{/number}","pulls_url":"https://api.github.com/repos/JayceLai/engine/pulls{/number}","milestones_url":"https://api.github.com/repos/JayceLai/engine/milestones{/number}","notifications_url":"https://api.github.com/repos/JayceLai/engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JayceLai/engine/labels{/name}","releases_url":"https://api.github.com/repos/JayceLai/engine/releases{/id}","deployments_url":"https://api.github.com/repos/JayceLai/engine/deployments","created_at":"2019-03-25T10:37:18Z","updated_at":"2019-03-25T10:37:22Z","pushed_at":"2019-04-26T10:58:26Z","git_url":"git://github.com/JayceLai/engine.git","ssh_url":"git@github.com:JayceLai/engine.git","clone_url":"https://github.com/JayceLai/engine.git","svn_url":"https://github.com/JayceLai/engine","homepage":"http://www.cocos2d-x.org/creator","size":45546,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cocos-creator:3d","ref":"3d","sha":"ce456e3d37001b5c8697ee81226b03f5cd78e4e0","user":{"login":"cocos-creator","id":6937061,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5MzcwNjE=","avatar_url":"https://avatars3.githubusercontent.com/u/6937061?v=4","gravatar_id":"","url":"https://api.github.com/users/cocos-creator","html_url":"https://github.com/cocos-creator","followers_url":"https://api.github.com/users/cocos-creator/followers","following_url":"https://api.github.com/users/cocos-creator/following{/other_user}","gists_url":"https://api.github.com/users/cocos-creator/gists{/gist_id}","starred_url":"https://api.github.com/users/cocos-creator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocos-creator/subscriptions","organizations_url":"https://api.github.com/users/cocos-creator/orgs","repos_url":"https://api.github.com/users/cocos-creator/repos","events_url":"https://api.github.com/users/cocos-creator/events{/privacy}","received_events_url":"https://api.github.com/users/cocos-creator/received_events","type":"Organization","site_admin":false},"repo":{"id":47440536,"node_id":"MDEwOlJlcG9zaXRvcnk0NzQ0MDUzNg==","name":"engine","full_name":"cocos-creator/engine","private":false,"owner":{"login":"cocos-creator","id":6937061,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5MzcwNjE=","avatar_url":"https://avatars3.githubusercontent.com/u/6937061?v=4","gravatar_id":"","url":"https://api.github.com/users/cocos-creator","html_url":"https://github.com/cocos-creator","followers_url":"https://api.github.com/users/cocos-creator/followers","following_url":"https://api.github.com/users/cocos-creator/following{/other_user}","gists_url":"https://api.github.com/users/cocos-creator/gists{/gist_id}","starred_url":"https://api.github.com/users/cocos-creator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocos-creator/subscriptions","organizations_url":"https://api.github.com/users/cocos-creator/orgs","repos_url":"https://api.github.com/users/cocos-creator/repos","events_url":"https://api.github.com/users/cocos-creator/events{/privacy}","received_events_url":"https://api.github.com/users/cocos-creator/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/cocos-creator/engine","description":"Cocos Creator is a complete package of game development tools and workflow, including a game engine, resource management, scene editing, game preview, debug and publish one project to multiple platforms.","fork":false,"url":"https://api.github.com/repos/cocos-creator/engine","forks_url":"https://api.github.com/repos/cocos-creator/engine/forks","keys_url":"https://api.github.com/repos/cocos-creator/engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cocos-creator/engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cocos-creator/engine/teams","hooks_url":"https://api.github.com/repos/cocos-creator/engine/hooks","issue_events_url":"https://api.github.com/repos/cocos-creator/engine/issues/events{/number}","events_url":"https://api.github.com/repos/cocos-creator/engine/events","assignees_url":"https://api.github.com/repos/cocos-creator/engine/assignees{/user}","branches_url":"https://api.github.com/repos/cocos-creator/engine/branches{/branch}","tags_url":"https://api.github.com/repos/cocos-creator/engine/tags","blobs_url":"https://api.github.com/repos/cocos-creator/engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cocos-creator/engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cocos-creator/engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/cocos-creator/engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cocos-creator/engine/statuses/{sha}","languages_url":"https://api.github.com/repos/cocos-creator/engine/languages","stargazers_url":"https://api.github.com/repos/cocos-creator/engine/stargazers","contributors_url":"https://api.github.com/repos/cocos-creator/engine/contributors","subscribers_url":"https://api.github.com/repos/cocos-creator/engine/subscribers","subscription_url":"https://api.github.com/repos/cocos-creator/engine/subscription","commits_url":"https://api.github.com/repos/cocos-creator/engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/cocos-creator/engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/cocos-creator/engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/cocos-creator/engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/cocos-creator/engine/contents/{+path}","compare_url":"https://api.github.com/repos/cocos-creator/engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cocos-creator/engine/merges","archive_url":"https://api.github.com/repos/cocos-creator/engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cocos-creator/engine/downloads","issues_url":"https://api.github.com/repos/cocos-creator/engine/issues{/number}","pulls_url":"https://api.github.com/repos/cocos-creator/engine/pulls{/number}","milestones_url":"https://api.github.com/repos/cocos-creator/engine/milestones{/number}","notifications_url":"https://api.github.com/repos/cocos-creator/engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cocos-creator/engine/labels{/name}","releases_url":"https://api.github.com/repos/cocos-creator/engine/releases{/id}","deployments_url":"https://api.github.com/repos/cocos-creator/engine/deployments","created_at":"2015-12-05T03:28:59Z","updated_at":"2019-04-26T09:47:15Z","pushed_at":"2019-04-26T14:52:11Z","git_url":"git://github.com/cocos-creator/engine.git","ssh_url":"git@github.com:cocos-creator/engine.git","clone_url":"https://github.com/cocos-creator/engine.git","svn_url":"https://github.com/cocos-creator/engine","homepage":"http://www.cocos2d-x.org/creator","size":45847,"stargazers_count":1062,"watchers_count":1062,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":572,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":181,"license":null,"forks":572,"open_issues":181,"watchers":1062,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/4320"},"html":{"href":"https://github.com/cocos-creator/engine/pull/4320"},"issue":{"href":"https://api.github.com/repos/cocos-creator/engine/issues/4320"},"comments":{"href":"https://api.github.com/repos/cocos-creator/engine/issues/4320/comments"},"review_comments":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/4320/comments"},"review_comment":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/4320/commits"},"statuses":{"href":"https://api.github.com/repos/cocos-creator/engine/statuses/23aceb25ec3efdac75a0eda69108fc6f45434623"}},"author_association":"NONE"}}
other: {"actor":{"display_login":"YunHsiao"}}