Repository navigation
Releases
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
RaycastVehiclethat didn't caused the world listeners to not add/remove properly. - Fixed sphere/plane contacts points when radius != 1.
- Fixed bug in
Heightfieldthat made some things pass through the field. - Fix in
ConvexPolyhedron.prototype.computeEdgesalong with some narrowphase optimizations makes convex/convex collisions more performant.
Additions
- Added methods
.raycastAll,.raycastClosestand.raycastAnytoWorld. - Added
idproperties toEquationandShape. - Added
Trimeshclass, including sphere and plane collisions. - Added method
Body.prototype.vectorToLocalFrame. - Made method
Body.prototype.addShapechainable. - Added options for
Bodyconstructor:shape,fixedRotation,allowSleep,sleepSpeedLimit,sleepTimeLimit,collisionFilterGroup,collisionFilterMask,angularDamping. - Per-material restitution and friction that falls back on the old behavior. See properties
frictionandrestitutionin theMaterialclass. DistanceConstraintdistance now defaults to the distance between the bodies.- Exposed
Ray.pointInTriangle. - Added methods
vectorToWorldFrame,vectorToLocalFrame,pointToLocalandpointToWorldtoTransform. - Added method
World.prototype.clearForces. - Added method
ContactEquation.prototype.getImpactVelocityAlongNormal. Sphereconstructor now throws an error ifradiusis negative.- The
AABBclass is now exposed. - Added methods
AABB.prototype.getCorners,.toLocalFrame,.toWorldFrame,.cloneand.contains. - Added property
materialto Shapeinstances. It is thus possible to set per-shape materials, that will override theBodymaterial if it is set. - Added
World.prototype.removeBody, deprecatedWorld.prototype.remove. - Added
Constraint.prototype.enableand.disable. HingeConstraintnow extendsPointToPointConstraintclass.- Added static properties
Vec3.UNIT_X,Vec3.UNIT_Y,Vec3.UNIT_Z. - Added class
ConeTwistConstraint. - Added class
Octree. - Added property
uniqueAxestoConvexPolyhedron.
Removed
HingeConstraint.prototype.getRotationalEquation1- use property.rotationalEquation1insteadHingeConstraint.prototype.getRotationalEquation2- use property.rotationalEquation2insteadHingeConstraint.prototype.getPointToPointEquation1- use property.equationXinsteadHingeConstraint.prototype.getPointToPointEquation2- use property.equationYinsteadHingeConstraint.prototype.getPointToPointEquation3- use property.equationZinstead
Deprecated
World.prototype.remove- useWorld.prototype.removeBodyinstead.- Passing
resulttoRay.prototype.intersectBody(body, result)is deprecated - please set the.resultproperty of theRayinstead. Vec3.prototype.normand.norm2are deprecated - use.lengthand.lengthSquared()instead.Vec3.prototype.multis deprecated - use.scaleinstead.- The
preStepandpostStepproperties ofBodyare deprecated - use the events with the same name inWorldinstead. World.prototype.numObjects()is deprecated - useworld.bodies.lengthinstead.World.prototype.rayTestis deprecated - use.raycastAll,.raycastClosestor.raycastAnyinstead.
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
RigidBodyto justBodyand changed the constructor signature. - Removed the
Compoundclass, since aBodynow contains a flatShapehierarchy. - Renamed property
.motionStateto.typeinBody. - Renamed the
'collide'event.withproperty to.body. - Renamed
ObjectPoolto justPool. Worldnow dispatches events'addBody'and'removeBody'.- Changed API for adding forces and impulses to a body. See
Body.applyImpulseandBody.applyForce. - Removed
World.collision_matrixand instead addedWorld.collisionMatrixandWorld.collisionMatrixPrevious. They both now work with body indices instead of body IDs. - Renamed
Body.calculateAABBto.computeAABB. AddedBody.aabbNeedsUpdate. ConvexPolyhedronconstructor 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.collisionPairstoBroadphase.collisionPairs(world,pairs1,pairs2), removing the need of an array return value. - Renamed
ContactGeneratortoNarrowphase. - Changed direction of the available math
.copymethods, now they follow the patterndest.copy(source). - Rewrote large parts of the
Rayclass. Now it has a start point and an end point, instead of a start point and a direction. - Improved sleeping.
- Renamed property
.last_dtto.dtinWorld.
Additions
- Added class
Spring. - Added class
SAPBroadphase. - Added class
TupleDictionary. - Added method
.setFromEulertoQuaternion. - Added methods
.transpose,.setRotationFromQuaternion,.scaleto classMat3. - Added
Broadphase.useBoundingBoxes,.doBoundingBoxBroadphaseand.intersectionTest. - Added
Body.collisionFilterGroupandBody.collisionFilterMask. - Added class
GridBroadphase, though it only supportsPlaneandSpherefor now. - Added class
SPHSystem. - Added classes
RaycastVehicleandWheelInfo. - Added class
RigidVehicle. - Added class
Heightfield.