mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-05 19:12:40 +08:00
65b0478c69
* 3d v1.1.1-exp physics expriment (#6787) * activate when not awake (#6781) * activate when not awake * cannon too * off event listener when onDestroy * add clearVelocity & clearForces * add CC_CONFIG to ammo\cannon * add convex mesh & reuse mesh * cache enable false by default * terrain collider * cone collider * fix scale of ammo box & sphere * simple collider * add worldBounds & boundingSphere to collider * add clear*** to rigid body * enhance physics material * enhance event * plane collider * stash * tweaks * update @cocos/ammo to v1.0.7-beta.1 * typing * enchance update shape dynamic * absolute scale cannon-box * expose allowsleep * fix warning of generate declaration * remove physics_builtin * DO NOT MERGE * Better reuse * Correct construct and deconstruct * avoid ammo memory leaks * minor refactor contact data * fix cannon terrain tileSize * stash * optimize auto wakeup * [Ammo] fix update by re add * 400~ * overwrite ArrayCollisionMatrix.prototype.reset * Export enum by namespace * stash * fix remove child shape of btCompound * fix event with CCD * dynamic instantiate * STASH * add group to rigid body * update attachedRigidBody of collider in editor * stash physics config * tweaks of ammo config * stash * stash * collision matrix * stash * rename deltaTime to fixedTimeStep * group mask collider * allow get mask * set default group to Layers.Enum.DEFAULT * add group change fallback * cannon collision matrix * fix * update @cocos/ammo to 1.0.7-beta.2 * more prop * fix * disable on 1.1.1-exp * tweaks * fix circular dependency * tweaks * rename simple to simplex * rename collider -> colliders * stash * ammo p2p * hinge constraint * adapt cannon p2p pivotB * ammo p2p setPivotB * constraint * tweaks * remove macro of physics * refactor physics selector * import ammo from ammo-instantiated * update @cocos/ammo * update @cocos/cannon
71 lines
1.8 KiB
TypeScript
71 lines
1.8 KiB
TypeScript
/**
|
|
* @hidden
|
|
*/
|
|
|
|
import { PhysicsSystem } from "./physics-system";
|
|
import { replaceProperty, removeProperty } from "../../core";
|
|
import { BoxColliderComponent } from "./components/colliders/box-collider-component";
|
|
import { SphereColliderComponent } from "./components/colliders/sphere-collider-component";
|
|
import { CapsuleColliderComponent } from "./components/colliders/capsule-collider-component";
|
|
import { RigidBodyComponent } from "./components/rigid-body-component";
|
|
import { ColliderComponent } from "./components/colliders/collider-component";
|
|
|
|
replaceProperty(PhysicsSystem, 'PhysicsSystem', [
|
|
{
|
|
"name": "ins",
|
|
"newName": "instance"
|
|
}
|
|
]);
|
|
|
|
replaceProperty(PhysicsSystem.prototype, 'PhysicsSystem.prototype', [
|
|
{
|
|
"name": "deltaTime",
|
|
"newName": "fixedTimeStep"
|
|
},
|
|
{
|
|
"name": "maxSubStep",
|
|
"newName": "maxSubSteps"
|
|
}
|
|
]);
|
|
|
|
removeProperty(PhysicsSystem.prototype, 'PhysicsSystem.prototype', [
|
|
{
|
|
"name": "useFixedTime"
|
|
}
|
|
]);
|
|
|
|
replaceProperty(ColliderComponent.prototype, 'ColliderComponent.prototype', [
|
|
{
|
|
"name": "attachedRigidbody",
|
|
"newName": "attachedRigidBody"
|
|
}
|
|
]);
|
|
|
|
replaceProperty(BoxColliderComponent.prototype, 'BoxColliderComponent.prototype', [
|
|
{
|
|
"name": "boxShape",
|
|
"newName": "shape"
|
|
}
|
|
]);
|
|
|
|
replaceProperty(SphereColliderComponent.prototype, 'SphereColliderComponent.prototype', [
|
|
{
|
|
"name": "sphereShape",
|
|
"newName": "shape"
|
|
}
|
|
]);
|
|
|
|
replaceProperty(CapsuleColliderComponent.prototype, 'CapsuleColliderComponent.prototype', [
|
|
{
|
|
"name": "capsuleShape",
|
|
"newName": "shape"
|
|
}
|
|
]);
|
|
|
|
replaceProperty(RigidBodyComponent.prototype, 'RigidBodyComponent.prototype', [
|
|
{
|
|
"name": "rigidBody",
|
|
"newName": "body"
|
|
}
|
|
]);
|