In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to implement the syntax sugar of system in the engine ECS framework? in order to solve this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
System in Bevy engine is a common Rust function, and this design is ergonomic. As the author said in his introduction to Bevy engine, there is no ECS framework design that is more ergonomic than Cluster engine. Someone on Twitter briefly analyzed how the syntax sugar of this part of the code in the cluster engine is implemented. Considering that many friends do not have access to Twitter at any time, I will bring the general idea here. System is a common Rust function, and its parameters represent the queries of those components that need to be accessed. The main example provided by the cluster is very striking, the system is the function, the component is the structure, and you don't need to implement additional trait to make the ECS framework work. Use bevy::prelude::*; is just like the example above, as long as the function is written according to certain rules, the function can be turned into a system by calling the .system () method in the construction mode of App. A normal Rust function is converted to a Box after calling the .system () method, using IntoForEachSystem and IntoQuerySystem trait for the two systems supported by the cluster. / / the specific code can be seen in the cluster documentation. Here is only an example of IntoQuerySystem, the trait.
Pub trait IntoQuerySystem {fn system (self)-> Box } with trait, we only need to implement trait to the functions that we may call, and it is certainly impossible to implement a function. Looking at this part of the source code of the cluster, we can see that a large number of macros are used: the specific code can look at the source code of the cluster. To sum up, the ergonomic ECS architecture implemented by the cluster is based on macros and trait. A small tutorial for Rust to write data visualization this article uses the plotly library, which is a small tutorial for hands-on experiments. Original tutorial text: https://shahinrostami.com/posts/programming/rust-notebooks/box-plots-at-the-olympics/OrbTk 0.3.1-alpha3 released that OrbTk is the Gui library that their team designed for the operating system. Now the latest version of this library has been released in crates.io, which has better performance than before, and there is a new topic switching engine to choose from. Read More: there is no stable ABI for https://github.com/redox-os/orbtk/releases/tag/0.3.1-alpha3"Rust. "the author has seen GNOME users (usually people who have worked on the C library for a long time) express the following problem: the compiled Rust code does not have a stable ABI (application binary interface). At the same time, Rust bundles its entire standard library with every binary it compiles, which makes the library built by Rust very large. The author is the kind of person who thinks that most of the infrastructure should be rewritten in Rust, so these issues are also of great concern to the author.
A brief introduction to the builder pattern a brief introduction to the builder pattern. And provide use cases in three actual projects. Read More: https://matklad.github.io/2020/08/12/who-builds-the-builder.htmlThis Week in Rust is officially updated every week. This Week in Rust has been updated again. This is already the 351st issue. Basically, the recent trends about Rust have been collected. Individuals have been paying more attention to the trends of the Tooling class. Rust-analyzer is getting better and easier to use. Other trends have basically been covered in the daily newspaper, and I will not mention them here. I will mainly talk about two, one is Rust GameDev, which is updated once a month, and the related trends of the block chain, which have only been updated recently.
This is the answer to the question about how to implement the syntax sugar of system in the engine ECS framework. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.