- Changed: updated to Bevy 0.14.
- Changed:
DefaultPlugin
renamedCursorRayPlugin
to reflect what it actually does. - Removed: all primitive raycasts have been removed. Users should use
bevy_math
instead.
Raycasting is now 20-50% faster.
- Changed: updated to Bevy 0.13.
- Removed: This crate's
Ray3d
type has been replaced with Bevy's newRay3d
type.- Methods on
Ray3d
have been replaced with standalone functions. - This has resulted in a ~10% drop in performance in benchmarks.
- Methods on
- Changed:
Ray3d::from_transform
is nowray_from_transform
- Changed:
Ray3d::from_screenspace
is nowray_from_screenspace
- Changed:
Triangle
removed in favor of a simpler[Vec3A; 3]
.
- Changed: updated to Bevy 0.12.
- Changed: plugin depends on bevy sub-crates (e.g.
bevy_ecs
) instead ofbevy
to reduce dependency count.
- Changed: immediate and deferred raycasting APIs organized into respective modules.
- Added: the
DefaultRaycastingPlugin
now builds a ray using the mouse cursor every frame and stores it in theCursorRay
resource. - Added:
RaycastMethod::Cursor
variant added toRaycastSource
settings for the common use case of using the mouse cursor. - Added:
debug_cast_ray
mirrors thecast_ray
method, but handles debug drawing the ray and any intersections. - Changed: removed unused
Reflect
derive fromRaycastSettings
. This struct is neither a resource nor a component. - Changed: unified the look of debug gizmos across the immediate and deferred APIs.
- Changed: relaxed type bounds on the generic raycast set type parameter in
RaycastSource<T>
andRaycastMesh<T>
to no longer requireClone.
- Added: substantially improved documentation.
- Fixed: plugin not building with
--no-default-features
. - Fixed:
RaycastSource
's visibility settings being ignored.
- Fixed: window scale factor not being considered for screenspace raycasts.
- Fixed: overly-strict query filter preventing raycasting 2d meshes.
- Changed: the immediate mode raycasting system param
Raycast
no longer requires a type parameter for a raycasting set. Instead, you can supply this constraint as a filter inRaycastSettings
. This makes it possible to raycast any bevy mesh without any special components on cameras or meshes. - Fixed:
SimplifiedMesh
andRaycastSettings
added to the prelude.
- Changed: the
should_early_exit
boolean field has been removed fromRaycastSettings
in favor of a more flexible closureearly_exit_test
. This early exit test is run on every entity to determine if it should block further entities from being hit. The previous behavior can be replicated by passing in a closure that ignores the input and returns a boolean, such as&|_| true
instead oftrue
. - Added: raycasts can now apply a test to determine which entities to allow during a raycast by
using the
filter
field onRaycastSettings
.
- Changed:
Raycast::cast_ray
now accepts aRaycastSettings
parameter. - Added: entity visibility handling can now be configured using the
RaycastVisibility
field onRaycastSettings
andRaycastSource
:Ignore
: Completely ignore visibility checks. Hidden items can still be raycasted against.MustBeVisible
: Only raycast against entities that are visible in the hierarchy.MustBeVisibleAndInView
: Only raycast against entities that are visible in the hierarchy and visible to a camera or light. This is the same as setting theshould_frustum_cull
parameter ofcast_ray
totrue
in 0.10.
- Changed:
Raycast::cast_ray
is now a mutable query. The system param now stores allocated buffers inLocal
s to reuse allocated memory. - Changed: parallel AABB culling now uses an unbounded channel to reduce time spent allocating a bounded channel when many entities are present.
- Added:
Raycast
system param allows immediate raycasting into the world using thecast_ray
method. - Removed the
Intersection
component. Intersection data can be found usingRaycastMesh::intersections()
andRaycastSource::intersections()
. - Changed:
Ray3d::from_screenspace
start from the near plane. - Fixed: Raycasts do not hit bottoms of un-rotated
RayCastMesh
es. - Changed:
DefaultPluginState
renamed toRaycastPluginState
.
- Implement
Reflect
forRaycastMesh
,RaycastSource
, andRaycastMethod
. - Fix raycasting for non-indexed meshes.
- Update to bevy 0.10.
- All internal debug related code is now behind feature flags to enable running with
default_features = false
. - Renamed:
RayCastSource
toRaycastSource
RayCastMesh
toRaycastMesh
RayCastMethod
toRaycastMethod
RayCastSet
toRaycastSet
- Update method naming to be more consistent with the ecosystem:
intersect_list()
->get_intersections()
intersect_top()
->get_nearest_intersection()
ray()
->get_ray()
- Added
intersections()
, the counterpart toget_intersections()
. This method returns an empty slice if there are no intersections, instead of anOption
. The latter is useful if you want a guarantee that there is at least one intersection after unwrapping theOption
.