mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 14:38:30 +00:00
Added the Mass Matter component to set the mass and density of a body.
This commit is contained in:
parent
a5e8d1e2d7
commit
93d246e948
1 changed files with 21 additions and 0 deletions
21
v3/src/physics/matter-js/components/Mass.js
Normal file
21
v3/src/physics/matter-js/components/Mass.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
var Body = require('../lib/body/Body');
|
||||
|
||||
var Mass = {
|
||||
|
||||
setMass: function (value)
|
||||
{
|
||||
Body.setMass(this.body, value);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
setDensity: function (value)
|
||||
{
|
||||
Body.setDensity(this.body, value);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
module.exports = Mass;
|
Loading…
Add table
Reference in a new issue