- Starting solo game with physics
This commit is contained in:
Kum1ta
2024-08-29 18:43:23 +02:00
parent 24704b8493
commit 64b2e8ab73
33 changed files with 40944 additions and 110 deletions

22
site/real_game/node_modules/cannon-es/LICENSE generated vendored Normal file
View File

@ -0,0 +1,22 @@
/*
* Copyright (c) 2015 cannon.js Authors
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

File diff suppressed because it is too large Load Diff

1603
site/real_game/node_modules/cannon-es/dist/cannon-es.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

13023
site/real_game/node_modules/cannon-es/dist/cannon-es.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

70
site/real_game/node_modules/cannon-es/package.json generated vendored Normal file
View File

@ -0,0 +1,70 @@
{
"name": "cannon-es",
"version": "0.20.0",
"license": "MIT",
"description": "A lightweight 3D physics engine written in JavaScript.",
"homepage": "https://github.com/schteppe/cannon.js",
"author": "Stefan Hedman <schteppe@gmail.com> (http://steffe.se)",
"contributors": [
"Cody Persinger <codypersinger@gmail.com> (https://github.com/codynova)",
"Marco Fugaro <marco.fugaro@gmail.com> (https://github.com/marcofugaro)"
],
"keywords": [
"cannon.js",
"cannon",
"physics",
"engine",
"3d"
],
"main": "./dist/cannon-es.cjs.js",
"module": "./dist/cannon-es.js",
"react-native": "./dist/cannon-es.js",
"types": "./dist/cannon-es.d.ts",
"sideEffects": false,
"files": [
"dist/"
],
"scripts": {
"prepare": "husky install",
"start": "npx serve",
"prebuild": "rimraf dist",
"build": "npm run typegen && rollup -c",
"prepublishOnly": "npm run build && npm run test",
"typecheck": "tsc --noEmit --emitDeclarationOnly false --strict",
"typegen": "tsc --outFile dist/cannon-es.d.ts",
"generate-docs": "typedoc",
"test": "jest"
},
"repository": {
"type": "git",
"url": "https://github.com/pmndrs/cannon-es.git"
},
"bugs": {
"url": "https://github.com/pmndrs/cannon-es/issues"
},
"devDependencies": {
"@babel/core": "^7.16.5",
"@babel/preset-env": "^7.16.5",
"@babel/preset-typescript": "^7.16.5",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.1",
"@rollup/plugin-replace": "^3.0.0",
"@types/jest": "^27.0.3",
"@types/node": "^17.0.4",
"husky": "^7.0.4",
"jest": "^27.4.5",
"lint-staged": "^12.1.4",
"prettier": "^2.5.1",
"rimraf": "^3.0.2",
"rollup": "^2.62.0",
"rollup-plugin-filesize": "^9.1.1",
"ts-jest": "^27.1.2",
"ts-node": "^10.4.0",
"typedoc": "^0.22.10",
"typescript": "^4.5.4"
},
"lint-staged": {
"*.{js,json,jsx,ts,tsx,md,yaml,yml}": "prettier --write"
}
}

64
site/real_game/node_modules/cannon-es/readme.md generated vendored Normal file
View File

@ -0,0 +1,64 @@
# cannon-es
This is a maintained fork of [cannon.js](https://github.com/schteppe/cannon.js), originally created by Stefan Hedman [@schteppe](https://github.com/schteppe).
It's a type-safe flatbundle (esm and cjs) which allows for **tree shaking** and usage in modern environments.
These minor changes and improvements were also made:
- These PRs from the original repo were merged: [schteppe/cannon.js#433](https://github.com/schteppe/cannon.js/pull/433), [schteppe/cannon.js#430](https://github.com/schteppe/cannon.js/pull/430), [schteppe/cannon.js#418](https://github.com/schteppe/cannon.js/pull/418), [schteppe/cannon.js#360](https://github.com/schteppe/cannon.js/pull/360), [schteppe/cannon.js#265](https://github.com/schteppe/cannon.js/pull/265), [schteppe/cannon.js#392](https://github.com/schteppe/cannon.js/pull/392), [schteppe/cannon.js#424](https://github.com/schteppe/cannon.js/pull/424)
- The `ConvexPolyhedron` constructor now accepts an object instead of a list of arguments. [#6](https://github.com/pmndrs/cannon-es/pull/6)
- The `Cylinder` is now oriented on the Y axis. [#30](https://github.com/pmndrs/cannon-es/pull/30)
- The `type` property of the `Cylinder` is now equal to `Shape.types.CYLINDER`. [#59](https://github.com/pmndrs/cannon-es/pull/59)
- `Body.applyImpulse()` and `Body.applyForce()` are now relative to the center of the body instead of the center of the world [86b0444](https://github.com/schteppe/cannon.js/commit/86b0444c93356aeaa25dd1af795fa162574c6f4b)
- Sleeping bodies now wake up if a force or an impulse is applied to them [#61](https://github.com/pmndrs/cannon-es/pull/61)
- Added a property `World.hasActiveBodies: boolean` which will be false when all physics bodies are sleeping. This allows for invalidating frames when physics aren't active for increased performance.
- Add support for [Trigger bodies](https://pmndrs.github.io/cannon-es/examples/trigger). [#83](https://github.com/pmndrs/cannon-es/pull/83)
- Deprecated properties and methods have been removed.
- The [original cannon.js debugger](https://github.com/schteppe/cannon.js/blob/master/tools/threejs/CannonDebugRenderer.js), which shows the wireframes of each body, has been moved to its own repo [cannon-es-debugger](https://github.com/pmndrs/cannon-es-debugger).
- Added optional property `World.frictionGravity: Vec3` which can be set to customize the force used when computing the friction between two colliding bodies. If `undefined`, `World.gravity` will be used. This property is useful to enable friction in zero gravity. This addresses issue [#224](https://github.com/schteppe/cannon.js/issues/224) and follows the [pattern established for p2.js](https://github.com/schteppe/p2.js/blob/master/src/world/World.js#L88-L92).
If instead you're using three.js in a **React** environment with [react-three-fiber](https://github.com/pmndrs/react-three-fiber), check out [use-cannon](https://github.com/pmndrs/use-cannon)! It's a wrapper around cannon-es.
## Installation
```
yarn add cannon-es
```
## Usage
```js
import { World } from 'cannon-es'
// ...
```
or, if you're using webpack, you can import it like this while still taking advantage of tree shaking:
```js
import * as CANNON from 'cannon-es'
// ...
```
## [Documentation](https://pmndrs.github.io/cannon-es/docs/)
[![](screenshots/docs.png)](https://pmndrs.github.io/cannon-es/docs/)
## [Examples](https://pmndrs.github.io/cannon-es/)
[![](screenshots/examples.png)](https://pmndrs.github.io/cannon-es/)
#### TO DO:
- Fix Octree `as any` assertions, and remove `as any` type assertions wherever possible
- Remove use of defined assertion (!) where possible (profile performance to ensure no degradation)
- Convert to abstract classes where possible (Equation, Solver, etc.?)
- V-HACD support (https://github.com/pmndrs/use-cannon/issues/35#issuecomment-600188994)
- Explore performance enhancements:
- https://github.com/RandyGaul/qu3e
- https://github.com/RandyGaul/cute_headers
- https://github.com/TheRohans/dapao/issues?q=is%3Aissue
- https://github.com/swift502/Sketchbook/commits/master/src/lib/cannon/cannon.js
- https://github.com/schteppe/cannon.js/pulls