Skip to content

Commit 3f30a3d

Browse files
committed
jsdocs updates.
1 parent 4fbb7d2 commit 3f30a3d

2 files changed

Lines changed: 17 additions & 15 deletions

File tree

src/math/Math.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,10 +1009,10 @@ Phaser.Math = {
10091009
},
10101010

10111011
/**
1012-
* Generate a sine and cosine table simultaneously and extremely quickly. Based on research by Franky of scene.at
1013-
*
1014-
* The parameters allow you to specify the length, amplitude and frequency of the wave. Once you have called this function
1015-
* you should get the results via getSinTable() and getCosTable(). This generator is fast enough to be used in real-time.
1012+
* Generate a sine and cosine table simultaneously and extremely quickly.
1013+
* The parameters allow you to specify the length, amplitude and frequency of the wave.
1014+
* This generator is fast enough to be used in real-time.
1015+
* Code based on research by Franky of scene.at
10161016
*
10171017
* @method Phaser.Math#sinCosGenerator
10181018
* @param {number} length - The length of the wave

src/physics/arcade/Body.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ Phaser.Physics.Arcade.Body = function (sprite) {
5959
this.allowRotation = true;
6060

6161
/**
62-
* @property {number} rotation - The amount the Body is rotated.
62+
* An Arcade Physics Body can have angularVelocity and angularAcceleration. Please understand that the collision Body
63+
* itself never rotates, it is always axis-aligned. However these values are passed up to the parent Sprite and updates its rotation.
64+
* @property {number} rotation
6365
*/
6466
this.rotation = sprite.rotation;
6567

@@ -112,12 +114,12 @@ Phaser.Physics.Arcade.Body = function (sprite) {
112114
this.center = new Phaser.Point(sprite.x + this.halfWidth, sprite.y + this.halfHeight);
113115

114116
/**
115-
* @property {Phaser.Point} velocity - The velocity in pixels per second sq. of the Body.
117+
* @property {Phaser.Point} velocity - The velocity, or rate of change in speed of the Body. Measured in pixels per second.
116118
*/
117119
this.velocity = new Phaser.Point();
118120

119121
/**
120-
* @property {Phaser.Point} newVelocity - New velocity.
122+
* @property {Phaser.Point} newVelocity - The new velocity. Calculated during the Body.preUpdate and applied to its position.
121123
* @readonly
122124
*/
123125
this.newVelocity = new Phaser.Point(0, 0);
@@ -128,7 +130,7 @@ Phaser.Physics.Arcade.Body = function (sprite) {
128130
this.deltaMax = new Phaser.Point(0, 0);
129131

130132
/**
131-
* @property {Phaser.Point} acceleration - The velocity in pixels per second sq. of the Body.
133+
* @property {Phaser.Point} acceleration - The acceleration is the rate of change of the velocity. Measured in pixels per second squared.
132134
*/
133135
this.acceleration = new Phaser.Point();
134136

@@ -149,7 +151,7 @@ Phaser.Physics.Arcade.Body = function (sprite) {
149151
this.gravity = new Phaser.Point(0, 0);
150152

151153
/**
152-
* @property {Phaser.Point} bounce - The elasticitiy of the Body when colliding. bounce.x/y = 1 means full rebound, bounce.x/y = 0.5 means 50% rebound velocity.
154+
* @property {Phaser.Point} bounce - The elasticity of the Body when colliding. bounce.x/y = 1 means full rebound, bounce.x/y = 0.5 means 50% rebound velocity.
153155
*/
154156
this.bounce = new Phaser.Point();
155157

@@ -165,37 +167,37 @@ Phaser.Physics.Arcade.Body = function (sprite) {
165167
this.friction = new Phaser.Point(1, 0);
166168

167169
/**
168-
* @property {number} angularVelocity - The angular velocity in pixels per second sq. of the Body.
170+
* @property {number} angularVelocity - The angular velocity controls the rotation speed of the Body. It is measured in radians per second.
169171
* @default
170172
*/
171173
this.angularVelocity = 0;
172174

173175
/**
174-
* @property {number} angularAcceleration - The angular acceleration in pixels per second sq. of the Body.
176+
* @property {number} angularAcceleration - The angular acceleration is the rate of change of the angular velocity. Measured in radians per second squared.
175177
* @default
176178
*/
177179
this.angularAcceleration = 0;
178180

179181
/**
180-
* @property {number} angularDrag - The angular drag applied to the rotation of the Body.
182+
* @property {number} angularDrag - The drag applied during the rotation of the Body.
181183
* @default
182184
*/
183185
this.angularDrag = 0;
184186

185187
/**
186-
* @property {number} maxAngular - The maximum angular velocity in pixels per second sq. that the Body can reach.
188+
* @property {number} maxAngular - The maximum angular velocity in radians per second that the Body can reach.
187189
* @default
188190
*/
189191
this.maxAngular = 1000;
190192

191193
/**
192-
* @property {number} mass - The mass of the Body.
194+
* @property {number} mass - The mass of the Body. When two bodies collide their mass is used in the calculation to determine the exchange of velocity.
193195
* @default
194196
*/
195197
this.mass = 1;
196198

197199
/**
198-
* @property {number} angle - The angle of the Body in radians as calculated by its velocity, rather than its visual angle.
200+
* @property {number} angle - The angle of the Body in radians, as calculated by its angularVelocity.
199201
* @readonly
200202
*/
201203
this.angle = 0;

0 commit comments

Comments
 (0)