Git Product home page Git Product logo

maxxfrazer / realityui Goto Github PK

View Code? Open in Web Editor NEW
638.0 12.0 34.0 15.27 MB

A Swift Package for creating familiar UI Elements and animations in RealityKit. For both Augmented Reality or Virtual Reality scenes. Now with visionOS support.

Home Page: https://maxxfrazer.github.io/RealityUI/

License: MIT License

Swift 100.00%
augmented-reality ux ar arkit virtual-reality swift swiftpm mixed-reality macos ios

realityui's Issues

Move to Components

Some of the features in this project can/should be moved from protocols to components, such as HasClick.

Tasks

  • Find all pieces which can/should be migrated to components, left in the comments here.
  • Issues for each component piece linked to this one.
  • PR's for each component added to staging branch, with tests added.
  • Update documentation for all before merging to main.

Note: This will require a major version bump to 2.0.0

Reasoning

  • Adherence to Entity-Component System (ECS): RealityKit is built on top of an Entity-Component System architecture. Using components instead of protocols embraces the architectural foundations of RealityKit, ensuring your code leverages the framework's inherent design patterns for more seamless integration.
  • Modularity and Flexibility: Components promote modular design. By separating the click action into its component, you can easily attach, modify, or remove functionalities without altering the core entity or other unrelated components. It also allows you to attach the same functionality to various entities regardless of their other functionalities or hierarchies.

Another important factor is future-proofing this library. RealityKit is at it's core an ECS, and will likely play nicer with classes that adhere to that in the future.

Contributions

Contributions are more than welcome for this update, please let me know if you'd like to help!
This will be the first major update of RealityUI, so input such as suggested components or their names would be greatly appreciated.
As this is a breaking change, I want it to be something really worth upgrading.

Bad conversion in macOS

Hi, under mac OS (not catalyst) I experience problems with translation. It seems that the Y coordinates is reversed.
I've made a quick and dirty test with RUISwitch scale 0.5, rotation 0, translation (0, 0.5, 0) and I have the button animation if I click between the middle and the bottom of the view while the button is drawn between the middle and the top.
I've tried to replace the conversion by event.locationInWindow on the "let touchInView =" lines for macOS, it seems to work better.
I believe it can't be so simple (I didn't test with rotations for example), so I hope you have enough information if you need to investigate.
Regards
Thanks for this code.

Animation Tests Failing

New animation tests fail with Xcode 15. The callback at the end of the animation never calls in the tests, but does call when used in full application.

HasClick to Component

New component name: TapActionComponent

Usage:

let entity: Entity = ...
entity.components.set(TapActionComponent { tappedEntity, worldPosition in
    print("Entity \(tappedEntity) was tapped at \(worldPosition ?? .zero)!")
})

See: #18

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.