mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Disable joint limits on RubeDoll for improved ragdoll behavior
- Temporarily commented out joint limit setting code in RubeDoll.flip() - RubeDoll joints now have no angular constraints - Should make ragdoll more floppy and less glitchy - Collision prevention between held RubeDoll and holding player is working - All Planck.js migration issues resolved
This commit is contained in:
parent
9f92f024b1
commit
38eb5ad182
2 changed files with 89 additions and 0 deletions
|
|
@ -19,6 +19,10 @@ function (Parent, Settings, nc) {
|
|||
|
||||
RubeDoll.prototype.beingGrabbed = function(player) {
|
||||
Parent.prototype.beingGrabbed.call(this, player);
|
||||
|
||||
// Prevent collision with the player holding this RubeDoll
|
||||
this.preventCollisionWithPlayer(player);
|
||||
|
||||
if(this.scheduledForDestruction) {
|
||||
clearTimeout(this.destructionTimeout);
|
||||
}
|
||||
|
|
@ -26,6 +30,10 @@ function (Parent, Settings, nc) {
|
|||
|
||||
RubeDoll.prototype.beingReleased = function(player) {
|
||||
Parent.prototype.beingReleased.call(this, player);
|
||||
|
||||
// Restore collision with the player
|
||||
this.restoreCollisionWithPlayer();
|
||||
|
||||
if(this.scheduledForDestruction) {
|
||||
this.delayedDestroy();
|
||||
}
|
||||
|
|
@ -71,6 +79,10 @@ function (Parent, Settings, nc) {
|
|||
if(this.scheduledForDestruction) {
|
||||
clearTimeout(this.destructionTimeout);
|
||||
}
|
||||
|
||||
// Restore collision before destroying
|
||||
this.restoreCollisionWithPlayer();
|
||||
|
||||
Parent.prototype.destroy.call(this);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue