- Updated dev dependencies.
Map.updateMap
method for tilemaps doesn't map bottom row (fixed by @theblacknight Kevin Bergin).
npm run build-typings
command now add module declaration to types.d.ts file automatically.
Map.updateMap
method for containers doesn't check if child object's points array is empty while assigning neighbour points to last point.
- Rework of
Map.updateMap
method for matter objects. Map.updateMap
method for matter objects now ignores internal segments in concave bodies.
Ray.cast
method won't test mapped object when ray is inside of mapped object and hit another mapped object within / overlap the first one.Map.updateMap
method for matter objects don't map properly non enclosed concave bodies.
- Typo in
Map.updateMap
method for polygons. - Typo in
Map.updateMap
method for containers. - Fixed code changes caused by faulty linter.
Map.updateMap
method now add array of neighbours to points inMap.points
.- Optimisation of
Map.updateMap
method for tilemaps. Ray.castCircle
andRay.castCone
methods now checks if ray is "glancing" mapped objects.Ray.cast
method now won't test mapped object if current closest intersection is closer to ray than it's bounding box.
Raycaster.removeMappedObjects
method isn't checking if passed objects are mapped.Map.destroy
method doesn't work properly for Arcade and Matter bodies (fixed by @dreasgrech Andreas Grech).- Fixed docs typos
- Added
Raycaster.dynamicMappedObjects
to store dynamic maps. Raycaster.update
method now traverse throughRaycaster.dynamicMappedObjects
to update maps.- Setting
Raycaster.Map.dynamic
now updatesRaycaster.dynamicMappedObjects
andRatcaster._stats
.
Raycaster.drawDebug
method isn't checking if mapped object has defined data property.Raycaster.destroy
method isn't destroyingRaycaster.graphics
object used for debug.Raycaster.destroy
method isn't removing scene'supdate
event listener.Ray.destroy
method isn't destroyingRay.graphics
object used for debug.
- Added TypeScript typings.
- Updated
PhaserRaycaster
plugin class.
- Fixed docs typos
Raycaster.mapGameObjects
method now checks if mapped object is supported.Map.updateMap
method for container objects now checks if mapped children objects are supported.
- Added
Ray.destroy
method. - Added
Map.destroy
method. - Added
Raycaster.destroy
method. - Added
mapChild
option toMap.config
parameters.
Raycaster.removeMappedObjects
method now also destroysMap
objects.- Container's
Map
now allows to choose single child element which will be mapped, by passing it asmapChild
option toMap.config
parameters. - Container's
Map
now allows to use circle map children withMap.segmentCount
set to 0. Transformed children circles are stored inMap._circles
property. - Updated NPM dev dependencies.
Ray.overlap
- method is using deprecated methodRay.testOverlap
instead ofRay.testArcadeOverlap
to test Arcade body.
Raycaster.update
- typo in code.Ray.cast
,Ray.castCircle
andRay.castCone
methods after optimization in fringe cases when ray "glanced" object's border box corner didn't detect hit properly.
- Added debug mode.
- Added statistics.
- Added additional intersection data. Each point contains reference to hit mapped object and it's segment if available.
Ray.cast
,Ray.castCircle
andRay.castCone
methods optimization.
Map.config
doesn't addMap.getBoundingBox
method to containers map.Raycaster.mapGameObjects
doesn't add map to data attribute if it's already enabled.
Ray.cast
,Ray.castCircle
andRay.castCone
methods return additionally hit mapped objects and segments.
Ray.cast
,Ray.castCircle
andRay.castCone
methods return additionally hit mapped objects and segments.
Raycaster.mapGameObjects
doesn't mapPhaser.Tilemaps.TilemapLayer
which replacedPhaser.Tilemaps.StaticTilemapLayer
andPhaser.Tilemaps.DynamicTilemapLayer
in Phaser 3.50.0.
- Added matter physics game objects collision methods to
Ray
. Ray.setCollisionCategory
is new method that sets the collision category ofRay
matter body.Ray.setCollisionGroup
is new method that sets the collision category ofRay
matter body.Ray.setCollidesWith
is new method that sets the collision mask forRay
matter body.Ray.setOnCollide
is new method that setsonCollide
event's calback forRay
matter body.Ray.setOnCollideEnd
is new method that setsonCollideEnd
event's calback forRay
matter body.Ray.setOnCollideActive
is new method that setsonCollideActive
event's calback forRay
matter body.Ray.setOnCollideWith
is new method that setsonCollide
event's calback forRay
matter body when it collides with the given body or bodies.
Ray.processOverlap
method return false for all arcade bodies.
- Added matter physics support.
Raycaster.mapGameObjects
now accepts matter bodies.Map
can now map matter bodies.Map.getBoundingBox
is new method that allows to get map bounding box.Map.forceConvex
is new property that force using matter body's convex body (hull) for mapping.Map.forceVerticesMapping
is new property that force using circle matter body's vertices for mapping.Ray.enablePhysics
is new method that creates arcade / matter physics body for ray.Ray.bodyType
is new property which define if ray's body use arcade or matter physics.
Ray.enableArcadeBody
was replaced byRay.enablePhysics
.Ray.processOverlap
now also accepts matter bodies and matter CollisionInfo objects.Map
contains now reference toRaycaster
object.
Ray.round
is new property that determines if ray's hit point will be rounded.
- Slight ray casting optimisation: raycaster will cast ray at each angle only once.
Ray.intersections
is new property that stores intersections calculated by last casting.Ray.slicedIntersections
is new property that stores intersections calculated by last casting sliced into array ofPhaser.Geom.Triangle
objects.Ray.autoSlice
is new property that determine if after casting, intesections should be sliced.Ray.slice
is new method that allows to slice array of intersections into array ofPhaser.Geom.Triangle
objects.Ray.enableArcadeBody
is new method that creates arcade physics body for ray.Ray.overlap
is new method that allows to if game objects wih physics bodies overlap ray's field of view.Ray
can be added to arcade physics collider / overlap.
Ray.range
was renamed toRay.rayRange
.Ray.setRange
was renamed toRay.setRayRange
.
Map
can now mapPhaser.Tilemaps.StaticTilemapLayer
andPhaser.Tilemaps.DynamicTilemapLayer
objects.
Map
can be enabled / disabled withMap.active
option. Disabled map return empty arrays instead of its points and segments and won't be updated.Raycaster.enableMaps
is new methods that allows to enable objects maps by passing game object / game objects array as an argument.Raycaster.disableMaps
is new methods that allows to disable objects maps by passing game object / game objects array as an argument.
Map
can now mapPhaser.GameObjects.Container
objects and its children. At this moment circle maps of container's children are tested byRay
objects properly only whenRaycaster.mapSegmentCount
orMap.segmentCount
is set above 0 (when circle map consists of segments which number is defined byMap.segmentCount
).
- Automatic map updates on update event can be now disabled, by passing
autoUpdate
option to raycaster constructor.
- Typo in
Ray.setDetectionRange
method. - In
Ray.cast
method, when ray's range is set belowPhaser.Math.MAX_SAFE_INTEGER
and theres no available intersections within detection range, method was trying to calculate ray's target distance to ray origin, even if target was not passed.
Ray.castCone
is new method that allows to cast rays in a cone. cone direction is defined byRay.angle
and cone angle is defined byRay.cone
.Ray.setCone
is new method that allows to setRay.cone
(Ray.castCone
method's cone angle).Ray.setConeDeg
is new method that allows to setRay.cone
(Ray.castCone
method's cone angle) in degrees.
Ray.angle
is now normalized (between 0 - 2π).
- Not defining
Raycaster.boundingBox
when physics was not defined caused error.
- Not defining
Raycaster.boundingBox
when physics was not defined caused error.
Ray.setAngleDeg
is new method that allows to setRay.angle
in degrees.
Raycaster
: bounds will be set to the world bounds by default.Ray.castAll
: method renamed toRay.castCircle
.
- Not passing argument to
Raycaster.createRay
method caused error.