mirror of
https://github.com/liabru/matter-js.git
synced 2025-03-14 00:38:41 -04:00
most editable car
A better control for cars, when these have small dimensions, with tires with a diameter less than 40.
This commit is contained in:
parent
2ec247b7af
commit
ec636a8eaa
1 changed files with 3 additions and 2 deletions
|
@ -235,11 +235,12 @@ var Bodies = require('./Bodies');
|
|||
* @param {number} width
|
||||
* @param {number} height
|
||||
* @param {number} wheelSize
|
||||
* @param {number} padding
|
||||
* @return {composite} A new composite car body
|
||||
*/
|
||||
Composites.car = function(xx, yy, width, height, wheelSize) {
|
||||
Composites.car = function(xx, yy, width, height, wheelSize, padding = 20) {
|
||||
var group = Body.nextGroup(true),
|
||||
wheelBase = 20,
|
||||
wheelBase = padding,
|
||||
wheelAOffset = -width * 0.5 + wheelBase,
|
||||
wheelBOffset = width * 0.5 - wheelBase,
|
||||
wheelYOffset = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue