# `ark-api` changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased - [🤝 **social**](https://ark.embark.dev/api/ark_api/social/index.html) - Added a new field `muted` and `#[non_exhaustive]` to `Relationship` - Added `add_muted` and `remove_muted` for managing "muted" player relationships. - Added `get_relationships_with_filter`, `RelationshipFilter` to allow for filtering on additional properties. ### Added ⭐ - [🔩 **core**](https://ark.embark.dev/api/ark_api/core/index.html) - Added `DebugContextProperty` which can be used to describe key state of a module which will be gathered and displayed if a module crashes, to help with debugging and figuring out why the module crashed - [📮 **telemetry**](https://ark.embark.dev/api/ark_api/telemetry/index.html) - Added [`send_event_for_player`](https://ark.embark.dev/api/ark_api/telemetry/fn.send_event_for_player.html) to send a telemetry event associated with a specific player. - [🌐 **world**](https://docs.rs/ark-api/0.16.0/ark_api/world/index.html) - Added `within_entity_batched` and `within_entity` to perform overlaps using a entities shape. - Added `Environment::sun_intensity` to control the intensity of the sun independent of the skybox - Added `try_get_entity_value` and `try_set_entity_value` functions to allow safely adding and getting entity component parameter values. - Added `draw_mesh_with_materials_and_styles` for rendering multiple meshes that might share styles. - Added `MeshStyleBuilder::with_visibility_flags` which can be used to set the visibility of a mesh in different render passess. - Added `FormattedText::new_with_fonts` which allows you to pass in multiple fonts which formatted text can use. - Added `Font` which represents a .ttf font. - Added `get_collided_entity_pairs`, `get_collision_info`, `get_all_collision_info`, `get_ended_collision_entity_pairs`, `get_started_trigger_entity_pairs` and `get_ended_trigger_entity_pairs`. - Added `exclude_from_shared_body` to enable excluding entities from shared physics bodies. - Added `set_rotation_grab_finger_id` and `rotation_grab_finger_id()` functions to `CameraComponent` which allow modules to grant the host a (single-finger) grab for rotating the camera. - Added `with_rotation_translation_scale` to `WorldMesh` - Create a transformed mesh based on another mesh without duplicating data - Added `had_initial_overlap()` to `RaycastHit` - Added `set_name()` to `EntityInfo` - Added `SoftContact`, `SoftContactDamping` and `SoftContactStiffness` properties to Physics component. - Added support for Reduced Coordinate Articulation (again) with two new components: `Articulation` and `ArticulationJoint`. - Added ability to create a `PlayerIdSet` from a `PlayerIdBitSet` - Added support for setting unstable dynamic parameters on `AudioSource` components. - Added `ArticulationJoint::drive_target_orientation` to get/set angular position as Quat. To be used along with the changed `ArticulationJoint::drive_target_position`. - Added `ArticulationJoint::drive_target_linear_velocity` and `ArticulationJoint::drive_target_angular_velocity` to be more consistent with drive target position and orientation. - Added `ArticulationJoint::position` and `ArticulationJoint::orientation`. - Added `ArticulationJoint::drive_enable`. A convenience param for toggling drives on and off. - [🍏 **applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - Added `Applet::detach_player`, `DetachPlayerRequest` et al., which allow spawning a new instance of the same applet with different applet arguments, and detach the player there. - Added `Applet::get_session_id` which allows retrieving the current session ID, common to all detached applet instances and the root applet instance they came from. A sentinel value `LOCAL_SESSION` may be returned by this function, which indicates this is a local (non-multiplayer) session. - Added `Applet::notify_finished_hot_reload` which the applet must call at the end of a hot-reload caused by a detach player request. - Added support for cancelling `DetachPlayerRequest` - Propagate client info (render quality mode) to the server. - Added `set_player_cursor_mode()` and `set_player_cursor_shape()`. - Added `get_players_count` and `get_players` - Added `get_window_states_count` and `get_window_states` - Added `GamepadInput` enum for gamepad analog sticks or button triggers input. - Added `MouseButton::Back` and `MouseButton::Forward` to the input API. - Added `open_player_url()`. - Added `EventEnum::Timestamp(u64)`, a timestamp for when the events were sent. - Added `Applet::detach_players_v3`, which now allows a maximum number of users for the server to be specified. - Added `Applet::get_max_user_count` which allows retrieving the max user count of the current session. - [📤 **behavior-controller**](https://ark.embark.dev/api/ark_api/behavior_controller/index.html) - Added `BehaviorController::list_behavior_modules` for asynchronously retrieving a list of behavior modules from the connected module store. - Added `BehaviorController::BehaviorModuleMeta` and `BehaviorController::BehaviorMeta`, which contains metadata for the entire behavior module and for each behavior in that behavior module - Added `allocate_actor_id()` to `Behavior` - Added re-export of [`macaw::CoordinateSystem`](https://docs.rs/macaw/0.17.0/macaw/trait.CoordinateSystem.html) - [🚄 **profiler**](https://ark.embark.dev/api/ark_api/profiler/index.html) - Replaced puffin with `scope!`, `function!` and `set_scopes_on` macros provided by the Ark API. This makes it easier to use the profiler as modules do not themselves need to depend on the `puffin` crate with the right version and can instead just use the profiling macros. - [📝 **report**](https://ark.embark.dev/api/ark_api/report/index.html). New API for functionality for sending player reports from within a module. - [👾 **ml**](https://docs.rs/ark-api/0.16.0/ark_api/ml/index.html) - Added `Experiment::new_from_settings` function, introducing a more direct way of creating experiments - Added `Experiment::raw_config` function, mirroring `raw_experiment_config_from_registry` for ongoing - Added `config_from_registry` function, retrieving a JSON blob from a training server without parsing it. - [💽 **storage**](https://docs.rs/ark-api/0.16.0/storage/index.html). - Added `Store::async_open` (resp. `AsyncStore::async_open`) which allow opening stores in a background task. It returns a handle that can be polled with `try_take` and will eventually return a `Store` (resp. `AsyncStore`). - Added `SimpleAsyncStore` which provides a storage api which does not do any background loading of data. - [🎚**feature-toggle**](https://docs.rs/ark-api/0.16.0/feature_toggle/index.html). New API! - [🧠**ml-inference**](https://docs.rs/ark-api/0.16.0/ml_inference/index.html). New API for ML inference. - Added `onnx_to_cervo()` and `SnapshotFormat` - [✉️ **http-client**](https://docs.rs/ark-api/latest/http/index.html). New API for stateful HTTP and GRPC. - [💌 **content-moderation**](https://ark.embark.dev/api/ark_api/content_moderation/index.html). New API for functionality to moderate content and filter user input texts. - [**✉️ system-metrics**](https://ark.embark.dev/api/ark_api/system_metrics/index.html) New API for giving access to current system metrics, such as CPU, disk, and memory usage - [⌚ **time**](https://ark.embark.dev/api/ark_api/time/index.html) Added `Instant::now` and `Instant::format_for_display` functions - Folded all functionality for implementing a new module directly into `ark-api` under [`module`](https://ark.embark.dev/api/ark_api/module/index.html). This was previously part of the separate `ark-module` crate, which is now no longer used. - [🖼️ **render**](https://ark.embark.dev/api/ark_api/render/index.html) - Added `get_mesh_bounds()` accessor to `RenderMesh` - [🧑 **user**](https://ark.embark.dev/api/ark_api/user/index.html) - Added `User::full_display_name_of()` for getting full unique username of a player. - Added `User::is_admin()` for determining if a player is an admin. ### Changed 🔧 - [🌐 **world**](https://docs.rs/ark-api/0.16.0/ark_api/world/index.html) - Changed [`Environment::sky_exposure`](https://docs.rs/ark-api/0.16.0/ark_api/world/struct.Environment.html#method.sky_exposure) to `Environment::sky_intensity` and made it control only the skybox intensity rather than sun and sky together. - Scale is now uniform in the transform hierarchy. To set a non-uniform scale for the rendered or physical shape, use `Render::non_uniform_scale` or `Physics::non_uniform_scale`. - Implement `From>` and `From>` for `WorldMaterials`. - `World::retrieve_messages` now expects a slice of entities and returns all messages and counts per entity. - `MorphTargetData::new` now takes an `Iterator` rather than a `std::collections::HashMap` - Use ray origin as the origin for entity based shape casts (instead the entity position) - Fix material leaks when moving between worlds - Impulse in `get_collision_info` now match the pair order in the query - `normal` and `point` of a ray or shape query hit now defaults to `-ray.dir` and `ray.origin + ray.dir * hit.distance` if `PhysX` fails to calculate the values themselves, before both were undefined. - Fixed bug where shape and ray-casts only returned at most one hit per query. - Added `ClosestPointQueryBatch` and `Physics::closest_point`. - Changed `ArticulationJoint::drive_target_position` to get/set linear position as Vec3. To be used along with the new `ArticulationJoint::drive_target_orientation`. - [📤 **behavior-controller**](https://ark.embark.dev/api/ark_api/behavior_controller/index.html) - Changed `BehaviorController::load_behavior_module` into an asynchronous call - Replaced all functions expecting an `ActorId` to expect an `ActorIdWithVersion`. - [📡 **http-request**](https://ark.embark.dev/api/ark_api/http_request/index.html) - URLs for request now have to use the new `Url` enum which requires the URL to either be fully static or have a static domain and a dynamically created path. This means it is no longer possible to use arbitrary dynamic URLs and only https protocol is supported, for security purposes. - `PlayerId` is now a newtype instead of an alias for the FFI `PlayerId` raw `u64` value. It is also a type that is now shared across all APIs to make it easier to use. To refer to the local/main player use `PlayerId::Local` instead of `0` - [💽 **storage**](https://docs.rs/ark-api/0.16.0/storage/index.html). - Simplify `StoreName` `Debug` trait implementation so it shows it just like a string instead of as `StoreName(xx)` - [👾 **ml**](https://docs.rs/ark-api/0.16.0/ark_api/ml/index.html) - `Experiment::new_from_settings()` no longer takes a `num_actions` argument - `Inference::new()` no longer requires feature and action count. The backend will instead read this from the provided model. - [🖼️ **render**](https://ark.embark.dev/api/ark_api/render/index.html) - Changed `RenderMesh` creation routines to take a `Mesh` by reference instead of by value. - [**input**](https://ark.embark.dev/api/ark_api/render/index.html) - Change `InputManager::events` to return `EventEnum` instead of `Event` and remove `Event` in favour of using `EventEnum`. - Introduce `InputManager::commands` to retrieve commands which were previously returned as an `Event`. - Renamed `#[ark::ark_test]` derive macro to simply `#[ark::test]` - Upgraded to `puffin` to 0.17.0 - Upgraded to `speedy` 0.8.4 to use new `glam` - Require Rust 1.75.0 - Upgraded to `saft` 0.33.0 - Upgraded to `num_enum` 0.6.1 - Upgrade public-api `v0.30` -> `v0.32` & pinned nightly to 2023-08-25 ### Removed 🔥 - [👾 **ml**](https://docs.rs/ark-api/0.16.0/ark_api/ml/index.html) - Removed `Experiment::num_features()` and `Experiment::num_actions()` - [🌐 **world**](https://docs.rs/ark-api/0.16.0/ark_api/world/index.html) - Removed `PhysicsCharacter` component. - Removed `Joint` component. - Removed external mesh style support for `RenderComponent` - Removed deprecated `raycast()` and `raycast_batched()` in world api. - Removed `EntityMessageDispatcher`. Use `EntityMessageQueue::spatial_query_request` or the ergonomic `SpatialQuery` instead. - Removed deprecated and unused `ray_cast()` in world api. - Deprecated and removed `allow_interruption()` from `AudioSource` component. - Removed `ArticulationJoint::drive_target_velocity`. Instead use the more consistent `ArticulationJoint::drive_target_linear_velocity` and `ArticulationJoint::drive_target_angular_velocity` - Removed `ArticulationJoint::linear_position` and `ArticulationJoint::angular_position`. Instead use `ArticulationJoint::position` and `ArticulationJoint::orientation`. - [🍏 **applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - Removed support for `EventType` `Mouse`, `Key`, `Touch` variants. - [🚄 **profiler**](https://ark.embark.dev/api/ark_api/profiler/index.html) - Removed deprecated `report_thread_stream` from FFI. The api was removed one and a half year ago. - Removed deprecated and unused `create_box_mesh()` and `create_sphere_mesh()`. ### Deprecated ⌚ - [⌚ **time**](https://ark.embark.dev/api/ark_api/time/index.html) - Deprecated `time()` and its associated functions, use the free standing `Instant::now` and `Instant::format_for_display` instead. - [**util**](https://docs.rs/crate/ark-api/0.17.0-pre.26/source/src/util/index.html) - Mark `create_box_mesh()` and `create_sphere_mesh()` in `mesh_shape` as deprecated. - [🍏 **applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - Deprecate `EventType` `WindowStates` `Players` variants. ## 0.16.0 - 2022-08-31 ### Added ⭐ - [👾 **ml**](https://docs.rs/ark-api/0.16.0/ark_api/ml/index.html) - New function: [`onnx_to_cervo`](https://docs.rs/ark-api/0.16.0/ark_api/ml/fn.onnx_to_cervo.html). Given a buffer of ONNX byte-data, converts it to a Cervo-wrapped NNEF brain instead. - [💽 **storage**](https://docs.rs/ark-api/0.16.0/storage/index.html). - Added support for user-specific stores, both global and device-local, with [`StoreRealm::GlobalUser`](https://docs.rs/ark-api/0.16.0/ark_api/storage/enum.StoreRealm.html#variant.GlobalUser) and [`StoreRealm::DeviceUser`](https://docs.rs/ark-api/0.16.0/ark_api/storage/enum.StoreRealm.html#variant.DeviceUser). With this one can store user-specific data in a store. - [🌐 **world**](https://docs.rs/ark-api/0.16.0/ark_api/world/index.html) - Added [`Physics::is_enabled`](https://docs.rs/ark-api/0.16.0/ark_api/world/struct.Physics.html#method.is_enabled) - Added [`Physics::non_uniform_scale`](https://docs.rs/ark-api/0.16.0/ark_api/world/struct.Physics.html#method.non_uniform_scale) - Added [`Render::non_uniform_scale`](https://docs.rs/ark-api/0.16.0/ark_api/world/struct.Render.html#method.non_uniform_scale) - Added [`Error::HttpRequestFailed`](https://docs.rs/ark-api/0.16.0/ark_api/enum.Error.html#variant.HttpRequestFailed). ### Changed 🔧 - [👾 **ml**](https://docs.rs/ark-api/0.16.0/ark_api/ml/index.html) - Require [Rust 1.63.0+](https://blog.rust-lang.org/2022/06/30/Rust-1.63.0.html) - [🌐 **world**](https://docs.rs/ark-api/0.16.0/ark_api/world/index.html) - Made [`PhysicsShapeDesc`](https://docs.rs/ark-api/0.16.0/ark_api/world/enum.PhysicsShapeDesc.html) ordinary exhaustive enum (removed `#[non_exhaustive]`) to simplify matching - [💽 **storage**](https://docs.rs/ark-api/0.16.0/ark_api/storage/index.html). - Store names now require to be created with the [`StoreName`](https://docs.rs/ark-api/0.16.0/ark_api/storage/struct.StoreName.html) type which allows compile-time validation that it is a valid store name, rather than runtime panic. ### Removed 🔥 - [🚄 **profiler**](https://ark.embark.dev/api/ark_api/profiler/index.html) - Removed deprecated `report_thread_stream`, use [`report_thread_stream_info`](https://docs.rs/ark-api/0.16.0/ark_api/profiler/fn.report_thread_stream_info.html). Had been deprecated for 1 year. - [🌐 **world**](https://ark.embark.dev/api/ark_api/world/index.html) - Removed export of FFI `properties` and `messages` modules. All the types were already available in main `world` module. - Removed deprecated `World::push_message`, `World::pop_message`, `World::has_message`. ### Deprecated ⌚ - Added the `#[deprecated]` attribute to a significant amount of functions & types that had been deprecated for over a year but only with comments ## 0.15.1 - 2022-07-08 ### Changed 🔧 - Upgraded to `speedy` 0.8.2 which includes our required [`glam` support PR](https://github.com/koute/speedy/pull/13). - Require Rust 1.62.0 (properly through crate configuration). ## 0.15.0 - 2022-07-08 First public version published on crates.io 🎉 ### Added ⭐ - [📤 **behavior-controller**](https://ark.embark.dev/api/ark_api/behavior_controller/index.html) - New API which provides functionality to indirectly communicate with external behavior modules. - New high-level API to send and receive system messages to/from behavior modules. - [📨 **behavior**](https://ark.embark.dev/api/ark_api/behavior/index.html) - Added new API which provides functionality for a behavior module to communicate with the rest of the world. - Added `iter_actors_with_aspect` which provides an iterator over all actors with a specific aspect - Added `random_seed_value` to the Behavior API. - New high-level API to send and receive system messages to/from the behavior controller. - [🍏 **applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - Added `delta_angle` to the relative mouse/touch movements (based on client-side mouse sensitivity and optional invert y axis) - Added [`request_quit`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.request_quit). This can be used to quit an applet which is useful if it is running headless without user input. - Added `applet::input::InputManager` for easier input handling - Added `applet::set_player_clipboard_string`: multiplayer support for "Click to copy" functionality. - Added `EventEnum::GamepadButton` which provides a way to receive gamepad button events. - [🚄 **profiler**](https://ark.embark.dev/api/ark_api/profiler/index.html) - Add `ark::profiler::is_active`: the module should call `puffin::set_scopes_on(ark::profiler::is_active());` each frame to allow ark to switch the profiler on/off. - [🖼️ **render**](https://ark.embark.dev/api/ark_api/render/index.html) - New immediate mode render API for drawing both 2d and 3d things on the screen. Aims to replace the Canvas API and mesh-related Scene APIs. - Added camera and environment lighting/fog APIs. - New explicit SDF rendering API, both in Render and World API. - New debug line drawing API, identical to the old Scene debug line drawing API. - Added `draw_mesh_with_materials` and `draw_meshes_with_materials` for rendering meshes with material overrides. - Added `create_mesh_with_material` and `create_mesh_with_materials_and_sections` for creating meshes with materials. - Added `get_indices`, `get_vertex_positions`, `get_vertex_normals` and `get_vertex_colors` to the `RenderMesh`. - [🧑 **user**](https://ark.embark.dev/api/ark_api/user/index.html) - Added [`id`](https://ark.embark.dev/api/ark_api/user/struct.User.html#method.id). This can be used to get the id of the current user if they are logged in. - Added `id_of` and `display_name_of` to get id/name of a player (`PlayerId`) for multiplayer. - [🌐 **world**](https://ark.embark.dev/api/ark_api/world/index.html) - Added global illumination world scale parameter to the `Environment`. - Added `MeshStyle::MeshVisibilityFlags` that are used to enable/disable different parts of the renderer like reflections. - Added `MeshStyle::mesh_visibility_player_id_set_flags` and `MeshStyle::mesh_visibility_player_id_set` which allows for setting visibility flags for specific players. - Added `MeshStyle::mesh_style_player_id_set_flags` and `MeshStyle::mesh_style_player_id_set` which allows for setting mesh style flags for specific players. - Added `PlayerIdSet` that can be set on render and audio components to filter visual and audible things by player. - Added `WorldMaterial` and `MaterialDesc` that are used to create re-usable PBR materials. - Added `WorldMesh::create_with_material` which allows you to create a mesh from raw mesh data and a material. - Added `MaterialOverrides` to the `MeshStyleComponent` that can be used to give meshes a set of materials overriding the mesh's original materials. - Added `WorldMesh::get_material_descs` and `WorldMesh::get_material_descs_with_names` to allow users to obtain material information from meshes. - Added `WorldMesh::get_dominant_colors_with_area` and `WorldMesh::get_section_material_index` to get the most prominent color of the mesh and the area the color occupies. - Added `MeshStyleFlags::OUTLINE` and corresponding `outline_thickness` and `outline_color` parameters - Added `MeshStyleFlags::OVERLAY` for rendering objects after post processing - Added `Physics::sleeping` to put an entity to sleep, or to check if it is asleep (only works on dynamic objects) - Added `Physics::sleep_threshold` to get/set the minimal energy limit an entity must reach before automatically going to sleep (only works on dynamic objects) - Added new component [`AudioSource`](https://ark.embark.dev/api/ark_api/world/struct.AudioSource.html) - Added new resource [`AudioClip`](https://ark.embark.dev/api/ark_api/world/struct.AudioClip.html) - Added support for loading GLTF files directly. - Added new field `options` to [`RaycastQuery`](https://ark.embark.dev/api/ark_api/world/struct.RaycastQuery.html) with additional query options. - Added new `SpatialQueryOptions::IGNORE_INTERIOR_HITS` flag for specifying if inside hits should be ignored for raycasts. - Added support for spherecasts (a.k.a. sphere sweeps) with `World::spherecast`, `World::spherecast_batched` and using `SpatialQueryRequestBuilder`. - Return all hit points with normals from raycast queries using `SpatialQueryRequestBuilder`. - Added new functionality to `EntityArena` for creating transient entities: `schedule_for_destruction` and `destroy_pending_entities`. - Added `World::update` which takes one parameter: a closure for your world update routine. This function makes sure World API library functions for receiving/sending messages and destroying transient entities are executed in the right order. For the global arena, in which entities created with `Entity::create` will end up, the `destroy_pending_entities` will be executed before your update routine so transient entities will live one update tick. Transient entities (placed in the global `EntityArena`) are now used by the `AudioSource::play_on_shot` function that can be used to easily play sounds at a specific location. - Deprecated `push_message`, `pop_message`, `has_message` in favour of `send_messages`, `retrieve_messages` and `get_message_counts`. - Added new `MeshSimplified` which simplifies and existing mesh, useful for collision meshes for instance. - Added `World:get_data_debug_name` to get the debug name from a `DataHandle`. This will default to the name a mesh was created with for a mesh. For other data objects you currently have to set it yourself. - Added some new parameters to SdfSkin to control visualization and the automatic bone weight assignments to vertices. - Added support for accessing `MeshStyle` on `SdfModel` and `SkinnedSdfModel` - Added support for setting debug options on individual entities (debug shape rendering) - Added support for batching commonly updated entity values (transforms, tints, enable flag). - Added `Shape::FormattedText` which allows fast text drawing. - Added `Camera::screen_space_offset` to allow offsetting the screen center without using viewports. - Added `OVERLAY` mesh style flag, for rendering UI stuff sharply on top of the TAA. - [💽 **storage**](https://ark.embark.dev/api/ark_api/storage/index.html). - Added `AsyncStore` that only synchronizes keys at startup and provides an async `get()` method. ### Changed 🔧 - [🍏 **applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - [`Applet::window_state()`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.window_state) now returns an `Option`, with `None` indicating headless mode. - [👾 **ml**](https://ark.embark.dev/api/ark_api/ml/index.html) - Refactored the API to make it more robust and more asynchronous, and to have a clearer separation between training and inference. You now create training experiments using `Experiment::new` and inference using `Inference::new`. Creating a new training experiment is an asynchronous operation that may take some time to complete when training in the cloud. - Expose errors with the [`Error`](https://ark.embark.dev/api/ark_api/struct.Error.html) instead of FFI [`ErrorCode`](https://ark.embark.dev/api/ark_api_ffi/enum.Error). - use run-id instead of experiment-id - [🖼️ **render**](https://ark.embark.dev/api/ark_api/render/index.html) - `create_mesh_from_gltf` now requires a debug name. - Drawing functions no longer return `Result`, only creation functions can return errors that have to be handled - [🧰 **resource**](https://ark.embark.dev/api/ark_api/resource/index.html) - `get_static` now takes a `&'static str` instead of `&str` - Renamed `get_static` to `get` - Added `get_dynamic` which takes a `&str` unlike `get` which takes `&'static str` - [🧑 **user**](https://ark.embark.dev/api/ark_api/user/index.html) - Add type-safe `struct UserId`. - Renamed `User::name` to `User::display_name` to indicate that the returned name should be used for display only. - [🌐 **world**](https://ark.embark.dev/api/ark_api/world/index.html) - Removed `WorldMeshOwned`. `WorldMesh` is now reference counted so a `WorldMesh` that goes out of scope (drop called) will be released and destroyed if the reference count reaches zero. A `WorldMesh` that is cloned (clone called) will retain its reference count. A mesh set on an entity will increase its reference count and if nothing else than the entity holds a reference to the mesh, the mesh will be destroyed with the entity. - `MeshData` now has a `name` field to give better warnings and error messages. - `create_from_gltf` now requires a debug name. - Deprecated Google Poly mesh loading support - `Environment::set_collision_matrix` parameter is now a reference instead of value - Camera: - Camera now need to be activated manually by calling `EntityMessenger::set_active` or `EntityMessenger::set_active_for_player`. - Replace `local_target` with `local_forward_vector`. - Deprecated `push_message`, `pop_message`, `has_message` in favour of `send_messages`, `retrieve_messages` and `get_message_counts`. - `SpatialQueryRequestBuilder` can now give you multiple hits from a raycast. - Require [Rust 1.62.0+](https://blog.rust-lang.org/2022/06/30/Rust-1.62.0.html) - Require [rustup 1.24.1](https://blog.rust-lang.org/2021/04/29/Rustup-1.24.1.html) - Renamed re-export of `Plane` and `Ray` types from `macaw` to `Plane3` and `Ray3`, which is their real names. - Removed `convert_vec3_slice_to_f32` utility function - You now receive a more helpful error message when a feature is not enabled for an API such as `world` or `ml`. - Added non-optional `MeshData::name` used to identify the source of a mesh. - Renamed `mesh` property of the `Render` component to `shape`. It can now take either a `WorldMesh`, `SdfProgram` or `SdfSkin`. - Fix UB in `retrieve_messages` by actually initializing the whole return vec and tracking invalid/not processed messages. ### Removed 🔥 - [🍏 **applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - Removed VR HMD events as we for now no longer support VR - [🌐 **world**](https://ark.embark.dev/api/ark_api/world/index.html) - Added [`EntityLayerMask::with`](https://ark.embark.dev/api/ark_api/world/struct.EntityLayerMask.html#method.with) and [`EntityLayerMask::except`](https://ark.embark.dev/api/ark_api/world/struct.EntityLayerMask.html#method.with) to allow you to easily merge layer masks. `EntityLayerMask` now also supports the `|` operator to merge them (equivalent to `with`). - Removed articulations support. - Removed Poly model loading support. - Removed mesh alignment transform (`set_offset`, `auto_align`). - Removed `hsv_transform`. - Deprecated `SkinnedSdfModel`. Deprecated `Opacity`, `Lighting`, `PlayerIdSet`, `MeshStyle` properties of the `SdfModel` component. - Removed Canvas API. Functionality has been moved to the new Render API. - Removed Imgui API. Texture allocation has been moved to the new Render API. - Removed Scene API. Functionality has been moved to the Render API and World API - Removed Scene Procedural API. Functionality has been moved to the Render API and World API ### Unstable 🚧 ## 0.14.0 - 2020-12-10 ### Added ⭐ - [🍏 **applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - Added support for a _launch argument string_ to applets that users can specify through a module URL link parameter. For example if a module is launched with [`https://ark.link/module/cube-simple?&arg=test%20world`](https://ark.link/module/cube-simple?&arg=test%20world), then the new [`launch_argument`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.launch_argument) function would return `test world`. - Added [`MouseInput::Still`](https://ark.embark.dev/api/ark_api/applet/enum.MouseInput.html#variant.Still) and [`TouchInput::Still`](https://ark.embark.dev/api/ark_api/applet/enum.TouchInput.html#variant.Still) to represent absent input events. - Added [`VirtualKeyCode::LCommand`](https://ark.embark.dev/api/ark_api/applet/enum.VirtualKeyCode.html#variant.RCommand) and [`VirtualKeyCode::RCommand`](https://ark.embark.dev/api/ark_api/applet/enum.VirtualKeyCode.html#variant.LCommand), which represents the command keys on MacOS and control keys on Windows and Linux. - Added support for applets launching other applets with a URL through the new `launch_applet_with_url` function - [📡 **http-request**](https://ark.embark.dev/api/ark_api/http_request/index.html) - Added support for _HEAD_, _OPTIONS_`, _CONNECT_, and _TRACE_ [HTTP methods](https://ark.embark.dev/api/ark_api/http_request/enum.Method.html). - [🐷 **scene-procedural**](https://ark.embark.dev/api/ark_api/scene_procedural/index.html) - Stabilized API for SDF rendering (currently mainly used for creatures and related things) - [💽 **storage**](https://ark.embark.dev/api/ark_api/storage/index.html). - Added new Storage API which allows modules to store and retrieve arbitrary data efficiently locally on disk as well as in globally synchronized data stores. - [📮 **telemetry**](https://ark.embark.dev/api/ark_api/telemetry/index.html) - Added new Telemetry API for modules to be able to send their own custom events to analyze how users are using the module. - [🌐 **world**](https://ark.embark.dev/api/ark_api/world/index.html) - Added the ability to set [`solver_position_iterations`](https://ark.embark.dev/api/ark_api/world/struct.Physics.html#method.solver_position_iterations) and [`solver_velocity_iterations`](https://ark.embark.dev/api/ark_api/world/struct.Physics.html#method.solver_velocity_iterations) to dynamic rigid bodies. - Added support for issuing raycasts in a batch for improved performance, [`World::raycast_batched`](https://ark.embark.dev/api/ark_api/world/struct.World.html#method.raycast_batched). - Allow scale on dynamic bodies. - Added support for triangle meshes as kinematic objects. - Added `WorldMeshOwned`, to impose some discipline on mesh handling. ### Changed 🔧 - [🌐 **world**](https://ark.embark.dev/api/ark_api/world/index.html) - Deprecated `World::ray_cast`. - Redesigned and renamed `EntityLayerFilter` to [`EntityLayerMask`](https://ark.embark.dev/api/ark_api/world/struct.EntityLayerMask.html). - Some properties like `mass`, center of mass and inertia tensor now have immediate effect, don't have to wait for the next frame. Additionally, changing the collision matrix has instant effect now. - Leaving out `WorldEntityQueryBuilder`'s `with_layer_mask` now has more useful behavior. - [🔘 **imgui**](https://ark.embark.dev/api/ark_api/imgui/index.html) - Upgraded to `imgui` 0.6.0 ([changelog](https://github.com/Gekkio/imgui-rs/blob/master/CHANGELOG.markdown)). - [`Mesh`](https://ark.embark.dev/api/ark_api/struct.Mesh.html) and [`MeshData`](https://ark.embark.dev/api/ark_api/struct.MeshData.html) now implement [`PartialEq`](https://doc.rust-lang.org/std/cmp/trait.PartialEq.html). - Upgraded to `macaw` 0.3.0 ([changelog](https://github.com/EmbarkStudios/wim-app/blob/main/packages/macaw/CHANGELOG.md)) and `glam` 0.10.0 ([changelog](https://github.com/bitshifter/glam-rs/blob/master/CHANGELOG.md#0100---2020-10-31)). This includes a breaking change, `Vec4::truncate` return type is now `Vec3A` instead of `Vec3`. - Require [Rust 1.48.0+](https://blog.rust-lang.org/2020/11/19/Rust-1.48) - Update to Macaw 0.4.0. - Made all methods on [`EntityLayerMask`](https://ark.embark.dev/api/ark_api/world/struct.EntityLayerMask.html) be `const fn` to allow constructing complex layer masks and store them as constants. ### Fixed 🐛 - `mesh_shapes::create_sphere_mesh` now clamps its subdivision arguments to be at least 3 as lower numbers would panic or produce a mesh that does not visibly render. - Compatibility with Rust 1.48.0. ### Removed 🔥 - [🍏 **applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - Removed [`VirtualKeyCode`](https://ark.embark.dev/api/ark_api/applet/enum.VirtualKeyCode.html)'s excessive amount of key code variants. To provide users with the best experience, platform-specific key codes have been removed. Key codes that remain are closely modeled after TKL (tenkeyless) keyboards minus the function keys. - Removed unused `Error::Unknown`. - Removed deprecated HTTP Download API. Use the more general [HTTP Request API](https://ark.embark.dev/api/ark_api/http_request/index.html) instead. ### 0.13.0 - 2020-10-19 ### Added ⭐ - [🍏 **applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - Added [`touch_input_events`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.touch_input_events) for retrieving touch events for the current frame. - [💾 **file-ux**](https://ark.embark.dev/api/ark_api/file_ux/index.html) - New API for modules to let user save data to files through save file dialog. - [📡 **http-request**](https://ark.embark.dev/api/ark_api/http_request/index.html) - New API that can do GET/POST/PUT/DELETE/PATCH async HTTP requests to local or internet services - [🔉 **mixer**](https://ark.embark.dev/api/ark_api/mixer/index.html) - Added new [`load`](https://ark.embark.dev/api/ark_api/mixer/struct.Clip.html#method.load) with support for loading OGG data into audio clips. - Added utility function `semitones_to_rate` to compute the playback rate to set for a musical semitone difference. - [👾 **ml**](https://ark.embark.dev/api/ark_api/ml/index.html) - Stabilized API for Machine Learning training and inference - [🧰 **resource**](https://ark.embark.dev/api/ark_api/resource/index.html) - Stabilized API for including static file resources within a module - [⌚ **time**](https://ark.embark.dev/api/ark_api/time/index.html) - New API for querying the real-world clock, useful for listing saved objects by date & time. - [🌐 **world**](https://ark.embark.dev/api/ark_api/world/index.html) - Added [`Articulation`](https://ark.embark.dev/api/ark_api/world/struct.Articulation.html) and [`ArticulationLink`](https://ark.embark.dev/api/ark_api/world/struct.ArticulationLink.html) components. Lets you set up a PhysX articulation hierarchy between rigid bodies, useful for machine learned animation and many other things. ### Changed 🔧 - [🖼️ **canvas**](https://ark.embark.dev/api/ark_api/canvas/index.html) - Changed return value to use [`Error`](https://ark.embark.dev/api/ark_api/struct.Error.html) instead of FFI [`ErrorCode`](https://ark.embark.dev/api/ark_api_ffi/enum.ErrorCode.html) - [⏬ **http-download**](https://ark.embark.dev/api/ark_api/http_download/index.html) - API has internally been replaced to use the HTTP Request FFI API, no user change is required at this time but in a later release the HTTP Download API in this crate will be deprecated in favor of [HTTP Request API](https://ark.embark.dev/api/ark_api/http_request/index.html). - [🔉 **mixer**](https://ark.embark.dev/api/ark_api/audio/index.html) - [`unload_clip`](https://ark.embark.dev/api/ark_api/mixer/struct.Mixer.html#method.unload_clip) no longer returns FFI [`ErrorCode`](https://ark.embark.dev/api/ark_api_ffi/enum.ErrorCode.html), panics on invalid parameters or failures - [🎭 **scene**](https://ark.embark.dev/api/ark_api/scene/index.html) - Changed [`has_mesh_semantics`](https://ark.embark.dev/api/ark_api/scene/trait.SceneExtHasMeshSemantics.html#tymethod.has_mesh_semantics) to return `bool` instead of `ErrorCode` - [🌐 **world**](https://ark.embark.dev/api/ark_api/world/index.html) - Removed return of raw FFI [`ErrorCode`](https://ark.embark.dev/api/ark_api_ffi/enum.ErrorCode.html) from multiple functions, was always `ErrorCode::Success` - Require [Rust 1.47+](https://blog.rust-lang.org/2020/10/08/Rust-1.47) - Breaking changes to the [`Error`](https://ark.embark.dev/api/ark_api/struct.Error.html) type - It is now an error enum and streamlined to only handle API errors. - Modules should not use on [`Error`](https://ark.embark.dev/api/ark_api/struct.Error.html) themselves as a general error handling primitive, prefer [`thiserror`](https://crates.io/crates/thiserror) or [`anyhow`](https://crates.io/crates/anyhow). - Renamed `Error::from_code` -> `Error::from` - Removed `Error::from_std`, `Error::from_std_box`, `Error::message` - Removed `bail`, `ensure`, `ensure_success`, `err_msg` macros and functions - Moved out `ColorRgba8`, `Plane` and `Ray` types to new 🦜 `macaw` high-level math library crate. Types are re-exported with same name and identical so no code changes are needed. ### Removed 🔥 - [🍏 **applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - Removed unused temporary `PointerEventType` enum - Removed deprecated `delta_time` function, use [`game_delta_time`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.game_delta_time) instead - Removed deprecated `absolute_time` function, use [`game_time`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.game_time) or [`real_time_since_start`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.real_time_since_start) instead - [🔉 **mixer**](https://ark.embark.dev/api/ark_api/mixer/index.html) - Removed free-standing `set_world_params_3d` function, use [`Mixer::set_world_params_3d`](https://ark.embark.dev/api/ark_api/mixer/struct.Mixer.html#method.set_world_params_3d) - Removed deprecated Log API and `log::macros`. Logging macros are exposed directly in root instead, example: [`ark::info!("testing")`](https://ark.embark.dev/api/ark_api/macro.info.html) - Removed the legacy callback-based Audio entrypoint API - Removed re-export of [`ErrorCode`](https://ark.embark.dev/api/ark_api_ffi/enum.ErrorCode.html) from `ark-api-ffi`, use the new [`Error`](https://ark.embark.dev/api/ark_api/struct.Error.html) enum only instead. ### 0.12.0 - 2020-09-17 ### Added ⭐ - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) - Added [`contact_entities`](https://ark.embark.dev/api/ark_api/world/struct.Physics.html#method.contact_entities) and [`in_contact_with`](https://ark.embark.dev/api/ark_api/world/struct.Physics.html#method.in_contact_with) methods on physics component. Lets you check what other entities an entity is touching. - Allow modifying the following physics properties at runtime: `mass`, `center_of_mass`, `mass_rotation`, `inertia_tensor`. - Added accessor to query the rigid body mode of an Entity with `rigid_body_mode`. - Fix setting the transform of entities with static physics at runtime. - [**canvas**](https://ark.embark.dev/api/ark_api/canvas/index.html) - Is now stable! - [**applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - Added v4 API with function to set the appearance of the mouse cursor. ### Changed 🔧 - Require [Rust 1.46+](https://blog.rust-lang.org/2020/08/27/Rust-1.46.0.html) ### Fixed 🐛 - Fixed big bug in `ColorRgba8` to `Vec4` conversion (sRGBA to linear space) ### Unstable 🚧 - [**http-request**](https://ark.embark.dev/api/ark_api/unstable/http_request/index.html) Added new HTTP Request API that can do GET/POST/PUT/DELETE/PATCH async requests - [**ml**](https://ark.embark.dev/api/ark_api/unstable/ml/index.html) Added support for retrieving state values and pushing augmented observations ### 0.11.0 - 2020-08-24 ### Added ⭐ - [**applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - Added [`game_time()`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.game_time) and [`real_time_since_start()`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.real_time_since_start) which should be used instead of now deprecated [`absolute_time()`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.absolute_time) to explicitly choose game time or real time. - Added [`game_delta_time()`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.game_delta_time), new name for now deprecated [`delta_time()`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.delta_time). - Added [`set_timestep_mode`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.set_timestep_mode) to control the timestep mode. Modules that use imgui will need to use this to select non-fixed timestep. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) - Added [`trigger_volume()`](https://ark.embark.dev/api/ark_api/world/struct.Physics.html#method.trigger_volume) property on entities, and new corresponding [`OnTrigger`](https://ark.embark.dev/api/ark_api/world/messages/struct.OnTrigger.html) event messages. Now you can see when an entity enters or leaves a "trigger volume" defined by the shape of another entity. - Added physics support for convex meshes: [`PhysicsShape::ConvexMesh`](https://ark.embark.dev/api/ark_api/world/enum.PhysicsShape.html#variant.ConvexMesh). - Added [`linear_damping`](https://ark.embark.dev/api/ark_api/world/struct.Physics.html#method.linear_damping) and [`angular_damping`](https://ark.embark.dev/api/ark_api/world/struct.Physics.html#method.angular_damping) physics properties - Added support for changing [`velocity`](https://ark.embark.dev/api/ark_api/world/struct.Physics.html#method.velocity), [`angular_velocity`](https://ark.embark.dev/api/ark_api/world/struct.Physics.html#method.angular_velocity) and [`dynamic_lock_flags`](https://ark.embark.dev/api/ark_api/world/struct.Physics.html#method.dynamic_lock_flags) on physics bodies after creation. ### Deprecated ⌚ - [**applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - Deprecated [`absolute_time()`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.absolute_time), use [`game_time()`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.game_time) or [`real_time_since_start()`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.real_time_since_start) instead - Deprecated [`delta_time()`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.delta_time), use [`game_delta_time()`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.game_delta_time) ### Changed 🔧 - Require [Rust 1.45+](https://blog.rust-lang.org/2020/07/16/Rust-1.45.0.html) - Upgraded [`glam`](https://crates.io/crates/glam) to 0.9.0. This includes a change of `Vec3` internal representation from 16-byte SIMD type to 12-byte 3x floats. - [**applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - [`set_cursor_mode`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.set_cursor_mode) now takes a `self` parameter, which it was missing - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) - [`EntityOwned`](https://ark.embark.dev/api/ark_api/world/struct.EntityOwned.html) is now marked with `#[must_use]` ### Fixed 🐛 - [**applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - [`MouseInput::Move`](https://ark.embark.dev/api/ark_api/applet/enum.MouseInput.html) events now get rays in the correct space, just like the `ButtonPress`/`Release`. ### Unstable 🚧 - [**scene procedural**](https://ark.embark.dev/api/ark_api/unstable/scene_procedural/index.html) - Added per-instance options for opacity, lighting, depth test and depth write - Added cone primitive ### 0.10.0 - 2020-06-25 ### Added ⭐ - [**applet**](https://ark.embark.dev/api/ark_api/applet/index.html) - Added clipboard functions [`clipboard_string`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.clipboard_string) and [`set_clipboard_string`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.set_clipboard_string) - Added support for getting a random seed at startup through new [`random_seed_value`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.random_seed_value). - Added VR HMD events with [`Applet::hmd_events`](https://ark.embark.dev/api/ark_api/applet/struct.Applet.html#method.-hmd_events) - [**profiler**](https://ark.embark.dev/api/ark_api/profiler/index.html) - Added new stable Puffin Profiler API! - [**scene**](https://ark.embark.dev/api/ark_api/scene/index.html) - Added [`MeshStyle::TWO_SIDED`](https://ark.embark.dev/api/ark_api/scene/struct.MeshStyleFlags.html#associatedconstant.TWO_SIDED) flag for two-sided rendering. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) - Added [`MeshStyle::TWO_SIDED`](https://ark.embark.dev/api/ark_api/scene/struct.MeshStyleFlags.html#associatedconstant.TWO_SIDED) flag for two-sided rendering. - Added [`EntityMessageQueue::spatial_query_request`](https://ark.embark.dev/api/ark_api/world/struct.EntityMessageQueue.html#method.spatial_query_request) (made public). - Added [`Entity::name`](https://ark.embark.dev/api/ark_api/world/struct.Entity.html#method.name), [`EntityOwned::name`](https://ark.embark.dev/api/ark_api/world/struct.EntityOwned.html#method.name), [`EntityInfo::name`](https://ark.embark.dev/api/ark_api/world/struct.EntityInfo.html#method.name) and `Debug` impls for `Entity` and `EntityOwned`. - Added [`World::retain_data`](https://ark.embark.dev/api/ark_api/world/struct.World.html#method.retain_data) which enables a [`DataHandle`](https://ark.embark.dev/api/ark_api/world/struct.DataHandle.html) to be retained by increasing its reference count. - Added [`PhysicsShape`](https://ark.embark.dev/api/ark_api/world/enum.PhysicsShape.html) used to describe what physics shape the physics component should use. - Added [`CompoundPhysicsShape`](https://ark.embark.dev/api/ark_api/world/struct.CompoundPhysicsShape.html) used to build a physics shape from a set of primitives. - Added readback of forces from D6 joints with [`linear_force`](https://ark.embark.dev/api/ark_api/world/struct.D6Joint.html#method.linear_force) and [`angular_force`](https://ark.embark.dev/api/ark_api/world/struct.D6Joint.html#method.angular_force) accessors. - Added readback of mass, center of mass and inertia tensor from dynamic rigid bodies. ### Changed 🔧 - Require [Rust 1.44+](https://blog.rust-lang.org/2020/06/04/Rust-1.44.0.html) - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) - Changed name of `EntityInfo::name` to `EntityInfo::name_data`. - `WorldData` now implements `Clone`. - `Physics` enable functions now use [`PhysicsShape`](https://ark.embark.dev/api/ark_api/world/enum.PhysicsShape.html) instead of the FFI equivalent. ### Removed 🔥 - Removed deprecated feature flags `with_async`, `unstable-sys`, `unstable-world` - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Removed `EntityMessageQueueState` (made private). ### Fixed 🐛 - Fixed so `require_` macros work even if `ark-api` crate is not renamed to `ark` in import ### Unstable 🚧 - [**unstable ml**](https://ark.embark.dev/api/ark_api/unstable/ml/index.html) - Added support for reporting a demonstration for imitation learning with [`push_demo_experience`](https://ark.embark.dev/api/ark_api/unstable/ml/struct.ML.html#method.push_demo_experience) - [**unstable scene procedural**](https://ark.embark.dev/api/ark_api/unstable/scene_procedural/index.html) - New API for drawing geometry using procedures ## 0.9.0 - 2020-05-28 ### Added ⭐ - [**applet**](https://ark.embark.dev/api/ark_api/applet/index.html) Initial release of the Applet API which can be used to get access key, mouse and text inputs, windows state and more. - [**imgui**](https://ark.embark.dev/api/ark_api/world/imgui.html) Expose input_text_multiline - [**mixer**](https://ark.embark.dev/api/ark_api/mixer/index.html) Added `mixer().unload_clip()`, to reclaim the memory used by a clip you no longer need - [**mixer**](https://ark.embark.dev/api/ark_api/mixer/index.html) Added a new more "rusty" and user-friendly API. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) World v1 API has been stabilized which adds reflection functionality. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) EntityMessenger now internally uses EntityMessenger2. Use EntityMessenger2 for a more ergonomic interface and the ability to poll for message replies. - [**unstable profiler**](https://ark.embark.dev/api/ark_api/unstable/profiler/index.html) New unstable API for using the Puffin Profiler for profiling modules - [**unstable resource**](https://ark.embark.dev/api/ark_api/unstable/resource/index.html) New unstable API for using static resources in modules - [**unstable canvas**](https://ark.embark.dev/api/ark_api/unstable/canvas/index.html) New unstable API for drawing textured and/or colored triangles in screen space ### Changed 🔧 - Split out module implementation to a separate `ark-module` crate that only module binaries can use, not libraries. This is a big change and requires changing all modules to depend on `ark-module` crate and initialize it. - `ColorRgba8` now does correct conversion to and from linear 0-1 RGBA space. - Renamed `with_unstable_apis` feature flag to `internal__unstable_apis` to make it clear it is an internal flag that should not be used by other crates - Enum `try_from` functions now return `Result` instead of `Option` and are implemented using `std::convert::TryFrom` - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) EntityMessenger collision callback `CollisionEventFn` now returns a slice of collision pairs instead of a single collision pair. ### Removed 🔥 - **input** Removed API. It was not an API, just a few re-exported FFI types and is replaced by the Applet API - [**scene**](https://ark.embark.dev/api/ark_api/scene/index.html) Removed `set_camera_look_at` that was deprecated in 0.5.0 in favor of new `set_camera` - **unstable sys** Removed API, functionality replaced by the applet API. ## 0.8.0 - 2020-05-07 ### Added ⭐ - [**module-run**](https://ark.embark.dev/api/ark_api/module_run/index.html) Module Run API has now been stabilized! - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) D6Joint has been added. A more powerful replacement for Joint, supporting six degrees of freedom and more advanced drive possibilities. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Added `EntityArena`. A collection that owns a set of `EntityOwned` objects. Use it to manage different sets of entities. A global `EntityArena` exists in which entities created through the usual functions will be placed. Get access to it using `EntityArena::global`. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Added `EntityOwned`. An owned version of `Entity` that will destroy the entity when dropped. Creating an `Entity` through its create functions will now create an `EntityOwned` and place it in the global `EntityArena` and return the reference as an `Entity`. You can regain ownership of an entity placed in the global arena using `Entity::try_into_owned`. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Added utility methods to convert between Mat4 and Transform - [**unstable world**](https://ark.embark.dev/api/ark_api/unstable/world/index.html) Added `EntityMessenger2`, `EntityMessageDispatcher`, `EntityMessageQueue` to make it easier to deal with messages to and from entities. - [**unstable ml**](https://ark.embark.dev/api/ark_api/unstable/ml/index.html) Add an API to let userland access raw snapshot data, for persistence - [**unstable ml**](https://ark.embark.dev/api/ark_api/unstable/ml/index.html) Add method to start hive from checkpoint. ### Fixed 🐛 - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) `Transform::{world_position, world_rotation, world_scale}` functions will now work as expected, without a frame delay, and it is also possible to set them. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Negative scaling is handled more gracefully. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Setting the transform or velocity on a dynamic physics object will now work. ### Changed 🔧 - Require Rust 1.43+ - [**mixer**](https://ark.embark.dev/api/ark_api/mixer/index.html) Prevent accidentally assigning a `MixerClipId` to a `MixerPlayId`. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) `Velocity::angular_velocity` now means an angular velocity as a pseudo-vector, with its magnitude measuring the rate at which an object rotates or revolves (in radians per seconds), and its direction pointing perpendicular to the instantaneous plane of rotation or angular displacement. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) `Entity::clone` is now `Entity::clone_entity` to not confuse it with regular `clone` (which will only clone the reference), `Entity::destroy` is now called `Entity::try_destroy` as it will only work if the entity has been created in the global `EntityArena`. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Spatial queries will now return an empty result even if it didn't result in any hits / matching entities. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) The old "negative red to disable lighting" hack that was never intended to work in the World API, but did anyway, no longer works in the World API, due to a refactoring. It's still working in the Scene API for compatibility with Kittiwake. ### Removed 🔥 - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Removed `EntityHandle`. Replaced with `Entity`. ## 0.7.0 - 2020-04-16 ### Added ⭐ - [**input**](https://ark.embark.dev/api/ark_api/input/index.html) Added input support for virtual reality controllers and head-mounted display. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Added new [`Camera`](https://ark.embark.dev/api/ark_api/world/struct.Camera.html) property: `local_up_vector`. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Added new [`Camera`](https://ark.embark.dev/api/ark_api/world/struct.Camera.html) and [`Environment`](https://ark.embark.dev/api/ark_api/world/struct.Environment.html) function `set_active` to set it as the active one. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Added new functions to [`EntityMessenger`](https://ark.embark.dev/api/ark_api/world/struct.EntityMessenger.html): - `set_active` - `raycast_world_with_mask` - lets you do a raycast with a world position and direction, removing the need for sending the message to an entity (EntityMessenger creates a global receiver internally). - `raycast_with_mask_and_options` - lets you configure how the ray should be calculated (by applying different components of the entity transform or not). - `behind_plane_with_mask_and_options` - lets you configure how of the plane should be calculated (by applying different components of the entity transform or not). - `within_sphere_with_mask_and_options` - lets you configure how of the sphere should be calculated (by applying different components of the entity transform or not). - [**unstable ml**](https://ark.embark.dev/api/ark_api/unstable/ml/index.html) Added new functionality for reading back metrics and inferring from Hive snapshots. - [**unstable module-run**](https://ark.embark.dev/api/ark_api/unstable/module_run/index.html) Added support for launching separate named modules, in addition to launching the calling module itself - [**unstable world**](https://ark.embark.dev/api/ark_api/unstable/world/index.html) Added [`WorldEntityQuery`](https://ark.embark.dev/api/ark_api/unstable/world/struct.WorldEntityQuery.html) that lets you query the world for entities by tag or layer. - [**unstable world**](https://ark.embark.dev/api/ark_api/unstable/world/index.html) Added [`EntityQueryType`](https://ark.embark.dev/api/ark_api/unstable/world/enum.EntityQueryType.html) that lets you choose the initial set of the query, either `AllEntities`, `TransformChildren` or `TransformDescendants`. ### Fixed 🐛 - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Fixed bug in `CollisionMatrix::set` that made it impossible to enable or disable collisions on the same layer. ### Removed 🔥 - Removed `all_apis` feature. Was rarely used and better to specify exact APIs a module wants to use instead - Removed `audio` feature. Was not used for anything. ### Changed 🔧 - [**unstable module-run**](https://ark.embark.dev/api/ark_api/unstable/module_run/index.html) Functions now have to be created (bound) before launching with [`Function`](https://ark.embark.dev/api/ark_api/unstable/module_run/struct.Function.html). ## 0.6.0 - 2020-03-26 ### Added ⭐ - Added [`#[ark_test]`](https://ark.embark.dev/api/ark_api/attr.ark_test.html) procedural macro that can be used to export unit test functions that can be invoked from the host. See the [Testing](https://ark.embark.dev/guide/modules/testing.html) guide for more details. - [**cmdlet**](https://ark.embark.dev/api/ark_api/cmdlet/index.html) Added new high-level macro wrappers to easily implement cmdlet modules. See [`impl_cmdlet_async`](https://ark.embark.dev/api/ark_api/macro.impl_async_cmdlet.html) and [`impl_blocking_cmdlet`](https://ark.embark.dev/api/ark_api/macro.impl_blocking_cmdlet.html) macros. - [**core**](https://ark.embark.dev/api/ark_api/core/index.html) Core now exposes [`ark_register_panic_hook`](https://ark.embark.dev/api/ark_api_ffi/type.RegisterPanicHookFn.html) which allows us to report back panics that occur within modules for display to the user, as opposed to the opaque and unhelpful Wasmer errors. This works automatically for all modules using it, no changes needed! - [**scene**](https://ark.embark.dev/api/ark_api/scene/index.html) Added new Google Poly extension, [`SceneExtPoly`](https://ark.embark.dev/api/ark_api/scene/trait.SceneExtPoly.html), that exposes an async API for Google Poly mesh creation. - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Added new properties `UpDirection` and `CollisionFlags` to `PhysicsCharacter` component. - [**unstable module-run**](https://ark.embark.dev/api/ark_api/unstable/module_run/index.html) New experimental API that enables modules to launch copies of themselves in parallel for offloading heavy compute tasks - [**unstable world**](https://ark.embark.dev/api/ark_api/unstable/world/index.html) New unstable world API with functions for creating and retrieving generic data. Currently used for reflecting what components and parameters an entity has. New module WorldPersistence for grabbing a snapshot state of a set of entities and restoring them from a snapshot. - [**unstable ml**](https://ark.embark.dev/api/ark_api/unstable/ml/index.html) New unstable machine learning API. Can communicate with Hive to perform training, or (soon) load a pre-trained network and infer. ### Changed 🔧 - Require Rust 1.42+ - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Added constraints to all component properties, so that for instance a read-only property can only be read. ### Removed 🔥 - [**world**](https://ark.embark.dev/api/ark_api/world/index.html) Removed public `world::wasm` module where it was possible to access [`World`](https://ark.embark.dev/api/ark_api/unstable/world/struct.World.html) from. This was not intended to be a public module and was intended to be accessed through `world::World`. - Removed `debug_ui` API ## 0.5.2 - 2020-03-12 ### Added ⭐ - **async** `Runtime::block_on` drives a future to completion. - **sys** New function `set_cursor_mode` for hiding and grabbing cursor. Will only work when disabling editor UI with tab. - **world** Add collision filtering by layer mask. - **world** World API has now been stabilized! - **world** Add clone_entities and copy_component functions ## 0.5.1 - 2020-03-05 ### Added ⭐ - **world** Add support for `Physics` dynamic rigid body lock flags (linear, angular). - **world** Add support for getting `Transform` world translation/rotation/scale. - **world** Add support for selecting what collision events you are interested in through the `collision_events_mask` on the `Physics` component. - **world** Add support for setting a tag on an entity (`u64`) using the `Tag` component. - **world** Add support for setting a a layer mask on an entity (`u64` bitset) using the `Layer` component, stating what layers it belongs to. Used for collision and queries. - **world** Add support for doing spatial queries against a specific set of layers (`u64` bitset). - **world** Add support for setting a custom mesh on the `Bounds` component that can be used as a custom `Physics` collider. - **world** Add component `PhysicsCharacter`. Useful for doing character collisions/physics against a world. Can walk stairs etc using a capsule as a collider. Note: You have to manually maintain gravity for this entity and also the `Velocity` component will be used to set the velocity. - **world** Add is_valid() to Entity and Mesh in the API wrappers. ### Changed 🔧 - **imgui** API has now been stabilized! - **imgui** New `TextureFormat` enum instead of `bytes_per_pixel` parameter ## 0.5.0 - 2020-03-02 ### Added - **scene** Add `set_camera` which supports specifying `up` vector for the look at camera - **world** Joints now support break forces. ### Changed - **core** Remove deprecated `wasm_return_slice`, replaced by `return_slice` - **imgui** Redefined API as unstable ### Deprecated - **scene** Deprecated `set_camera_look_at` in favor of new `set_camera` ## 0.4.7 - 2020-02-28 ### Added - **world**: Expose the visible flag on the render component in the API. - **world**: Expose the current linear and angular velocity of dynamic physics objects. - **world**: Improve error checks, assert/warn if accidentally using missing component. - **world**: More flexibility in applying forces - both the force vector and (new) a position can be in local or world space. Torques can now also be applied in local space. - **world**: Add Velocity component. Use to set a velocity when not using physics. Can be handy to set for instance velocity once in the key input callback. - **world**: Add Bounds component. Use to set a custom bound used for physics / collision / spatial queries. MatchRenderMesh needs to be set to false to not have it automatically match the mesh of the render component. - **world**: Add smoothing animation. Use to smoothen out discontinuities in animation for instance when cancelling animating a camera sweep. - **world**: Add per-entity flag to disable gravity. ### Changed - **world**: Rename the joint types (revolute->hinge, prismatic->slider, spherical->ball) - **world**: Fix some scale and offset issues on mesh colliders. - **world**: Breaking change, `Render::set_mesh` is now `Render::mesh().set()` (using an accessor pattern like most other properties) - **world**: Can now use physics on entities without a Render component (but Bounds is required as a replacement). ## 0.4.6 - 2020-02-24 ### Added - **world**: Expose a few more physics joint types. - **world**: Expose "Kinematic" physics objects. - **world**: Expose getting the velocity from joints. - **world**: Implement direct drive for joints. - **world**: Add support for setting parent on the Transform component which will make the transform local to its parent. ### Changed - **scene**, **world**: Fix bugs in `set_camera_look_at` where looking straight up or down was broken. ## 0.4.5 - 2020-02-14 ### Added - **world**: Add support for camera + fov (see simple-camera-world) - **world**: Add looping and delay to animation - **world**: Add support for animation callbacks (cancelled / finished) - **world**: Add some more (brute force) implementations of spatial queries (see physics-world for one example) - **world**: Add support for variable length spatial query results - **world**: Add basic support for PhysX joints (revolutes, sphericals, fixed only). - **world**: Add flag to create rigid bodies as sleeping. ### Changed - Async functions and future runtime now are only enabled if using the `with_async` feature flag. This affects specific API functions also such as `HttpDownload::get_async`. Improve compile times for modules that do not use futures/async. - **world**: Implement quadratic easing modes (see simple-camera-world) - **world**: Change animation to be duration based instead of speed ## 0.4.4 - 2020-02-10 ### Changed - **world**: Unstable World API and wrappers redesigned, many capabilities added (physics, animation). Examples in modules: particle-physics, physics-world, shooter-world, simple-raycast-world. - **sys**: New module Sys, with a single function get_elapsed_time, for internal profiling. ### Removed - Removed vector distance functions functions. Use `.length()` from `glam` directly instead - **scene**: Removed unused `LookAtCamera` ## 0.4.3 - 2020-01-29 ### Changed - Changed `FFI_API` type to be a struct containing both id and name of API - Moved `imgui::create_texture` to `imgui::imgui().create_texture()`, old function is deprecated - Renamed `wasm_return_slice` to `return_slice`, old function is deprecated - Removed inner `wasm` modules and wrapper traits for `debug_ui`, `http_download`, `imgui`, and `log` APIs - Require Rust 1.40 (or later) - Stabilized `scene-ext-ray-intersect` and `scene-ext-has-mesh-semantics` extensions ### Added - Added a lot more documentation to API structures and functions - Added non-blocking downloads via `http_download().get_async()`, and a runtime for futures. - Added `MeshStyleFlags::BILLBOARD` flag for enabling billboard rendering of a mesh through the `scene-ext-mesh-style` extension. - Added unstable world API. This is highly in development and will evolve and change rapidly. ## 0.4.2 - 2020-01-17 ### Added - **scene:**: `scene-ext-mesh-style` unstable extension added to be able to render mesh instances with a specific style. Through the style one can now enable lighting, alpha blending, premultiplied alpha, flat shading, set the diffuse tint and apply a hue/saturation/value transform. Use MeshStyleBuilder to create a style with self-documenting functions. - Add initial `imgui` API, currently not all widgets are supported. For a list of supported widgets check out the `imgui-example` module that's included with this release. ## 0.4.1 - 2019-12-10 ### Added - **scene:**: `scene-ext-ray-intersect` unstable extension added to be able to intersect a ray with a mesh. This is not yet performance optimized but is fast enough to be usable sparingly. ## 0.4.0 - 2019-12-08 ### Changed - Upgraded to `ark-api-ffi` 0.4.0 - **scene:** Upgrade to use new v4 API. `SceneBuildApi::create_mesh` now always uses mesh stream buffers that was previously an optional extension with fallback support. - **scene:** `scene` feature no longer enables `with_serde` feature - **scene:** Stabilized the `scene-ext-mesh-buffer` API extension. The feature flag for it has been removed. Though preferred to use v4 API instead, which includes it. ### Removed - Removed `bincode` and `strum` dependencies. This significantly improves build times of modules from scratch when not using `serde`: 40s -> 12s. ### Fixed - **scene:** `LookAtCamera` now only supports serialization if `with_serde` feature is used. - **scene:** Removed serialization derives on `MeshHandle`, is not supposed to be serialized. ## 0.3.0 - 2019-12-08 ### Changed - `with_serde` feature now also affects types exported from `ark-api-ffi` - Upgraded to use 0.3.0 of `ark-api-ffi` ## 0.2.1 - 2019-12-08 ### Added - First published private release