BabylonJS/BabylonReactNative là dự án Mobile trên GitHub, viết chủ yếu bằng C++, với 433 sao. Build React Native applications with the power of Babylon Native
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Babylon React Native brings the power and flexibility of Babylon.js into a React Native environment via Babylon Native.
Current Status
Limitations
Android and iOS only - support for Windows is experimental.
Touch input only - mouse, keyboard, and controllers are not yet supported.
Single view only - multiple views are not yet supported (only a single view can be displayed).
What is Supported from Babylon.js
See this from the Babylon Native repo.
Performance
React Native applications targeting JavaScriptCore on iOS or Hermes will not have JIT enabled. This may cause performance issues for JavaScript heavy scenarios.
Other
Babylon React Native relies heavily on newer React Native constructs including JSI to get the performance characteristics required for real time rendering. JSI allows for direct synchronous communication between native code and JavaScript code, but is incompatible with "remote debugging." If you need to debug your JavaScript code that uses Babylon React Native, you should enable Hermes and use "direct debugging" (e.g. chrome://inspect or edge://inspect). See the React Native documentation for more info.
Usage
See the package usage for installation instructions and/or the Playground app's App.tsx for example usage. You can also clone this sample repo to quickly get started.
Frameworks (Expo, ...)
Note: Official support for React Native frameworks, like Expo, is not provided by BabylonReactNative. While BabylonReactNative may work with these frameworks, we do not conduct testing, bug fixes, or feature development to ensure compatibility.
Contributing
This quick overview will help you get started developing in the Babylon React Native repository. We support development on Windows and macOS, but assume the use of PowerShell in the instructions below (unless otherwise noted).
If you are interested in making contributions, be sure to also review CONTRIBUTING.md.
Using BabylonReactNative
The following section will describe how to build locally a package and how to develop BabylonReactNative. If your intent is to use the plugin, follow instructions in the NPM BabylonReactNative readme.
Preparing a new Repo
Required Tools: git, Node.js (16.13.0+)
Step 1 for all development environments and targets is to clone the repo. Use a git-enabled terminal to follow the steps below.
If the Metro server is not started with npm run android, you can start it manually by running npm run start in a terminal.
Android Studio is the tool of choice for downloading the various versions of NDK.
If something goes wrong with the build npm run android --verbose can give some hints.
If the emulator is not launched by the build, you can run ~/Android/Sdk/emulator/emulator @name_of_your_image.
For other emulator issues, follow the instructions from Babylon Native documentation.
Refer to the Babylon Native documentation for additional information that may help troubleshoot issues.
Universal Windows Platform (UWP)
UWP can only be built on a PC. CMake must be manually run to generate project definitions for BabylonNative dependencies.
Run npm ci in Apps\Playground\Playground.
Run npm ci in Package.
Run npx gulp buildUWP in Package. This command will run cmake and build BabylonNative dependencies. It may take a while to complete.
In Apps\Playground\Playground, run npm run windows.
Note: if you experience build issues for Apps\Playground related to autolinking, try running npx react-native autolink-windows in the Apps\Playground\Playground folder. You can also run npm run windows-verbose to view logging.
Testing in the Playground App
When making local changes, the following manual test steps should be performed within the Playground app to prevent regressions. These should be checked on Android and iOS, and ideally in both debug and release, but minimally in release.
Basic rendering - launch the Playground app and make sure the model loaded and is rendering at 60fps.
Animation - make sure the loaded model is animating.
Input handling - swipe across the display and make sure the model rotates around the y-axis.
Display rotation - rotate the device 90 degrees and make sure the view rotates and renders correctly.
View replacement - tap the Toggle EngineView button twice to replace the render target view.
Engine dispose - tap the Toggle EngineScreen button twice to dispose and re-instantiate the Babylon engine.
Suspend/resume - switch to a different app and then back to the Playground and make sure it is still rendering correctly.
Fast refresh (debug only) - save the App.tsx file to trigger a fast refresh.
Dev mode reload (debug only) - in the Metro server console window, press the R key on the keyboard to reload the JS engine and make sure rendering restarts successfully.
XR mode - tap the Start XR button and make sure XR mode is working.
XR display rotation - rotate the device 90 degrees and make sure the view rotates and renders correctly.
XR view replacement - tap the Toggle EngineView button twice to replace the render target view.
XR suspend/resume - switch to a different app and then back to the Playground and make sure it is still rendering correctly.
Building the NPM Package
Every change for a Pull Request will trigger the build of the NPM package. The artifact is named BabylonReactNative and can be found in the Artifact section of the corresponding GitHub Action.
:warning: The zip contains a Tarball Gzipped .tgz that is automatically decompressed on macOS. When installing that directory ( npm install /path/to/unzipped/untarred/package ) npm creates symlinks that are not supported by the build system. Installing the .tgz instead of its decompressed version works correctly.
To get a .tgz that can be shared or published, follow these steps:
Prepare tools:
cd Package
npm install
Prepare package dependencies
cd ../Modules/@babylonjs/react-native
export BABYLON_NO_CMAKE_POSTINSTALL=1
npm install
Package content is in Package/Assembled folder.
Run npm pack to make a .tgz.
Supported Versions
Package versions are listed on this npm.js page: @babylonjs/react-native. Check supported Babylon.js version and corresponding BabylonNative dependency in package README
Security
If you believe you have found a security vulnerability in this repository, please see SECURITY.md.
BabylonJS/BabylonReactNative có phải mã nguồn mở không?
Có — BabylonJS/BabylonReactNative phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/BabylonJS/BabylonReactNative.
BabylonJS/BabylonReactNative có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho BabylonJS/BabylonReactNative. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
BabylonJS/BabylonReactNative dùng license gì?
BabylonJS/BabylonReactNative phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
BabylonJS/BabylonReactNative là gì?
BabylonJS/BabylonReactNative (BabylonJS/BabylonReactNative) là dự án C++ trên GitHub. Theo mô tả gốc: Build React Native applications with the power of Babylon Native
Cùng nhóm Mobile còn repo nào?
BabylonJS/BabylonReactNative thuộc nhóm Mobile trên TopGit, cùng 2 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về BabylonJS/BabylonReactNative ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/BabylonJS/BabylonReactNative là nguồn chính thức.
Vì sao BabylonJS/BabylonReactNative được xếp vào nhóm Mobile?
TopGit xếp BabylonJS/BabylonReactNative vào nhóm Mobile dựa trên GitHub topics và mô tả của repo (gắn thẻ: "babylon", "react-native"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về BabylonReactNative?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về BabylonReactNative.