Releases: schteppe/cannon.js
Releases · schteppe/cannon.js
v0.6.2
Summary
This release contains the new Trimesh
and ConeTwistConstraint
classes along with a few fixes and optimizations for convex collisions. It should be fully backwards compatible with the previous v0.6.1
.
Fixes
- Fixed narrowphase bug for compound sphere/sphere shape collision.
- Fixed bug in
RaycastVehicle
that didn't caused the world listeners to not add/remove properly. - Fixed sphere/plane contacts points when radius != 1.
- Fixed bug in
Heightfield
that made some things pass through the field. - Fix in
ConvexPolyhedron.prototype.computeEdges
along with some narrowphase optimizations makes convex/convex collisions more performant.
Additions
- Added methods
.raycastAll
,.raycastClosest
and.raycastAny
toWorld
. - Added
id
properties toEquation
andShape
. - Added
Trimesh
class, including sphere and plane collisions. - Added method
Body.prototype.vectorToLocalFrame
. - Made method
Body.prototype.addShape
chainable. - Added options for
Body
constructor:shape
,fixedRotation
,allowSleep
,sleepSpeedLimit
,sleepTimeLimit
,collisionFilterGroup
,collisionFilterMask
,angularDamping
. - Per-material restitution and friction that falls back on the old behavior. See properties
friction
andrestitution
in theMaterial
class. DistanceConstraint
distance now defaults to the distance between the bodies.- Exposed
Ray.pointInTriangle
. - Added methods
vectorToWorldFrame
,vectorToLocalFrame
,pointToLocal
andpointToWorld
toTransform
. - Added method
World.prototype.clearForces
. - Added method
ContactEquation.prototype.getImpactVelocityAlongNormal
. Sphere
constructor now throws an error ifradius
is negative.- The
AABB
class is now exposed. - Added methods
AABB.prototype.getCorners
,.toLocalFrame
,.toWorldFrame
,.clone
and.contains
. - Added property
material
to Shapeinstances
. It is thus possible to set per-shape materials, that will override theBody
material if it is set. - Added
World.prototype.removeBody
, deprecatedWorld.prototype.remove
. - Added
Constraint.prototype.enable
and.disable
. HingeConstraint
now extendsPointToPointConstraint
class.- Added static properties
Vec3.UNIT_X
,Vec3.UNIT_Y
,Vec3.UNIT_Z
. - Added class
ConeTwistConstraint
. - Added class
Octree
. - Added property
uniqueAxes
toConvexPolyhedron
.
Removed
HingeConstraint.prototype.getRotationalEquation1
- use property.rotationalEquation1
insteadHingeConstraint.prototype.getRotationalEquation2
- use property.rotationalEquation2
insteadHingeConstraint.prototype.getPointToPointEquation1
- use property.equationX
insteadHingeConstraint.prototype.getPointToPointEquation2
- use property.equationY
insteadHingeConstraint.prototype.getPointToPointEquation3
- use property.equationZ
instead
Deprecated
World.prototype.remove
- useWorld.prototype.removeBody
instead.- Passing
result
toRay.prototype.intersectBody(body, result)
is deprecated - please set the.result
property of theRay
instead. Vec3.prototype.norm
and.norm2
are deprecated - use.length
and.lengthSquared()
instead.Vec3.prototype.mult
is deprecated - use.scale
instead.- The
preStep
andpostStep
properties ofBody
are deprecated - use the events with the same name inWorld
instead. World.prototype.numObjects()
is deprecated - useworld.bodies.length
instead.World.prototype.rayTest
is deprecated - use.raycastAll
,.raycastClosest
or.raycastAny
instead.
v0.6.1
Changes
- Renamed body.tau to body.torque
Bug fixes
- Fixed bug that prevented Ray from intersecting compound bodies properly.
- Bodies should not fall through Heightfield any more.
- Fixed update bug in AABB for compound bodies.
- Fixed bug in AABB.prototype.overlaps.
Other
- The bundles should now work even if RequireJS is present on the same page.
- It's now possible to pass quaternion and velocities via the Body constructor.
- More docs!
v0.6.0
Changes
- Renamed
RigidBody
to justBody
and changed the constructor signature. - Removed the
Compound
class, since aBody
now contains a flatShape
hierarchy. - Renamed property
.motionState
to.type
inBody
. - Renamed the
'collide'
event.with
property to.body
. - Renamed
ObjectPool
to justPool
. World
now dispatches events'addBody'
and'removeBody'
.- Changed API for adding forces and impulses to a body. See
Body.applyImpulse
andBody.applyForce
. - Removed
World.collision_matrix
and instead addedWorld.collisionMatrix
andWorld.collisionMatrixPrevious
. They both now work with body indices instead of body IDs. - Renamed
Body.calculateAABB
to.computeAABB
. AddedBody.aabbNeedsUpdate
. ConvexPolyhedron
constructor now calculates normals instead of taking them as a parameter.- Reuse of various event objects to minimize object creation in the step loop.
- Removed unused class
ContactPoint
. - Changed the signature of
Broadphase.collisionPairs
toBroadphase.collisionPairs(world,pairs1,pairs2)
, removing the need of an array return value. - Renamed
ContactGenerator
toNarrowphase
. - Changed direction of the available math
.copy
methods, now they follow the patterndest.copy(source)
. - Rewrote large parts of the
Ray
class. Now it has a start point and an end point, instead of a start point and a direction. - Improved sleeping.
- Renamed property
.last_dt
to.dt
inWorld
.
Additions
- Added class
Spring
. - Added class
SAPBroadphase
. - Added class
TupleDictionary
. - Added method
.setFromEuler
toQuaternion
. - Added methods
.transpose
,.setRotationFromQuaternion
,.scale
to classMat3
. - Added
Broadphase.useBoundingBoxes
,.doBoundingBoxBroadphase
and.intersectionTest
. - Added
Body.collisionFilterGroup
andBody.collisionFilterMask
. - Added class
GridBroadphase
, though it only supportsPlane
andSphere
for now. - Added class
SPHSystem
. - Added classes
RaycastVehicle
andWheelInfo
. - Added class
RigidVehicle
. - Added class
Heightfield
.