Skip to content

Commit 6fe68c8

Browse files
committed
setting linear & angularFactor via Body constructor
1 parent 1cfbb44 commit 6fe68c8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/objects/Body.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ var Box = require('../shapes/Box');
3030
* @param {number} [options.collisionFilterGroup=1]
3131
* @param {number} [options.collisionFilterMask=1]
3232
* @param {boolean} [options.fixedRotation=false]
33+
* @param {Vec3} [options.linearFactor]
34+
* @param {Vec3} [options.angularFactor]
3335
* @param {Body} [options.shape]
3436
* @example
3537
* var body = new Body({
@@ -329,11 +331,17 @@ function Body(options){
329331
* @property {Vec3} linearFactor
330332
*/
331333
this.linearFactor = new Vec3(1,1,1);
334+
if(options.linearFactor){
335+
this.linearFactor.copy(options.linearFactor);
336+
}
332337

333338
/**
334339
* @property {Vec3} angularFactor
335340
*/
336341
this.angularFactor = new Vec3(1,1,1);
342+
if(options.angularFactor){
343+
this.angularFactor.copy(options.angularFactor);
344+
}
337345

338346
/**
339347
* @property aabb

0 commit comments

Comments
 (0)