Skip to content

Releases: pythonarcade/arcade-accelerate

Version 1.0.2

27 Apr 06:53
76cafd3
Compare
Choose a tag to compare

This release contains changes to bring the arcade-accelerate API up to date with current changes in Arcade 3.0. These changes are localized to the arcade.math module.

The arcade.math.lerp_vec function has been removed, and replaced instead with arcade.math.lerp_2d and arcade.math.lerp_3d.

Additionally a rust-native override for the new arcade.math.quaternion_rotation function has been added.

Version 1.0.1

03 Mar 06:47
64d824e
Compare
Choose a tag to compare

This release contains a number of performance improvements to collision detection.

Namely a new version of are_polygons_intersecting called are_polygons_intersecting_native. This new function accepts &Vec<(f32, f32)> instead of Vec<(f32, f32)>. The normal function cannot accept references due to it being a [#pyfunction]. This means that whenever it is used natively from Rust, we have to copy the vectors into it. The native function allows us to just pass references to the vectors and avoid the copy.

There are also a handful of other places where copying the points vector from a HitBox has been eliminated in favor of passing by reference, another major area this has been done in is with get_adjusted_points, which now has a similar get_adjusted_points_native function. In addition to this new native function on HitBox and RotatableHitBox, they now have an internal cache of the adjusted points, such that the adjusted points are only re-calculated when the cache is marked as dirty.

The final major improvement is using the intern macro on strings sent to getattr within the collision detection functions. This avoids allocating a new string within Python every time the function is called, and passes a reference to the same string on subsequent calls to it, this greatly improves performance because this process is very expensive and happening in a very hot loop.

Version 1.0.0

02 Mar 02:00
Compare
Choose a tag to compare

This version is serving as an initial release and is compatible with the Arcade 3.0 API.

In general right now, basic SpriteList collision detection has been done, as well as many of the basic Math/Geometry functions provided by Arcade. We do not currently have benchmarking statistics for every function, more comprehensive benchmarking tools will be built out over time, in general a lot of these functions have proven to be roughly an order of magnitude faster, but your mileage may vary on any particular function at this point.

SpriteList collision has proven to be 30-35% faster on average, again until more comprehensive benchmarks have been built out, your mileage may vary on this.

Classes Overriden

  • arcade.hitbox.base.HitBox
  • arcade.hitbox.base.RotatableHitBox

Functions Overriden

arcade.math

  • rotate_point
  • clamp
  • lerp
  • lerp_vec
  • lerp_angle
  • get_distance
  • get_angle_degrees
  • get_angle_radians
  • rand_in_rect
  • rand_in_circle
  • rand_on_circle
  • rand_on_line
  • rand_angle_360_deg
  • rand_angle_spread_deg
  • rand_vec_degree_spread
  • rand_vec_magnitude

arcade.geometry

  • are_polygons_intersecting
  • is_point_in_box
  • get_triangle_orientation
  • are_lines_intersecting
  • is_point_in_polygon

arcade.sprite_list.collision

  • check_for_collision_with_list
  • check_for_collision_with_lists

Version 0.1.0

17 Apr 00:58
Compare
Choose a tag to compare

Initial Release Testing.