mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 12:43:26 +00:00
Added rotation methods and setters
This commit is contained in:
parent
57c41cba72
commit
de2e7847df
1 changed files with 65 additions and 0 deletions
|
@ -5,9 +5,11 @@
|
|||
*/
|
||||
|
||||
var Class = require('../../utils/Class');
|
||||
var DegToRad = require('../../math/DegToRad');
|
||||
var GenerateGridVerts = require('../../geom/mesh/GenerateGridVerts');
|
||||
var IntegerToRGB = require('../../display/color/IntegerToRGB');
|
||||
var Mesh = require('../mesh/Mesh');
|
||||
var RadToDeg = require('../../math/RadToDeg');
|
||||
var UUID = require('../../utils/string/UUID');
|
||||
|
||||
/**
|
||||
|
@ -185,6 +187,69 @@ var Plane = new Class({
|
|||
}
|
||||
},
|
||||
|
||||
addRotateX: function (value)
|
||||
{
|
||||
this.rotateX += value;
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
addRotateY: function (value)
|
||||
{
|
||||
this.rotateY += value;
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
addRotateZ: function (value)
|
||||
{
|
||||
this.rotateZ += value;
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
rotateX: {
|
||||
|
||||
get: function ()
|
||||
{
|
||||
return RadToDeg(this.modelRotation.x);
|
||||
},
|
||||
|
||||
set: function (value)
|
||||
{
|
||||
this.modelRotation.x = DegToRad(value);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
rotateY: {
|
||||
|
||||
get: function ()
|
||||
{
|
||||
return RadToDeg(this.modelRotation.y);
|
||||
},
|
||||
|
||||
set: function (value)
|
||||
{
|
||||
this.modelRotation.y = DegToRad(value);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
rotateZ: {
|
||||
|
||||
get: function ()
|
||||
{
|
||||
return RadToDeg(this.modelRotation.z);
|
||||
},
|
||||
|
||||
set: function (value)
|
||||
{
|
||||
this.modelRotation.z = DegToRad(value);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles the pre-destroy step for the Plane, which removes the vertices and debug callbacks.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue