You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This release makes it more easy and verbose to construct Shapes due to new constructors.
Shapes now have position and angle properties, which indicates the local position in the body they are attached to. This also means that a Shape instance can be attached to a single Body.
The raycasting API is refactored and should now be more verbose and flexible.
TopDownVehicle class was added. Use it to make racing games!
Updated all Shape constructors so they take their parameters via an options object. This way, Shape constructor parameters can be passed in the same options object. 380aaa5
new Rectangle(w, h) => new Box({ width: w, height: h })
new Capsule(l, r) => new Capsule({ length: l, radius: r })
new Circle(r) => new Circle({ radius: r })
new Convex(array) => new Convex({ vertices: array })
new Heightfield(array, options) => new Heightfield({ heights: array, [...other options...] })
new Line(l) => new Line({ length: l })
Removed .shapeOffsets and .shapeAngles from Body in favor of the new .position and .angle properties in the Shape instances. This means that a shape can only be added to one body. 16e1a47
Raycasting API is scratched and rewritten. Replaced World.prototype.raycastAll, .raycastClosest and .raycastAny with .raycast(result, ray). Moved the intersection methods in Ray to their respective Shape. d1feff1
The following options can now be passed via the Shape constructor: material, position, angle, collisionGroup, collisionMask, sensor, collisionResponse 6a20c75380aaa5