Git Product home page Git Product logo

spark-ar-physics's Introduction

Spark AR Physics

A module to help connecting Cannon.js to Spark AR

NPM

Installing

$ npm install spark-ar-physics

ToDo

  • sync positions
  • sync rotations
  • sync scale
  • document API
  • provide more exmaples
  • add tests

Known issues

  • Cannon.js can stress out Spark AR so it can crash often. When developing I recommend pausing the preview

spark-ar-physics's People

Contributors

ashleymarkfletcher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spark-ar-physics's Issues

Invert gravity and have device frame as 'walls'?

Hello there!

First off, thanks for the tutorial and the starter. I'm trying to tackle a project and hoping you can help. Essentially I want to have three objects float and collide with each other, bouncing off of the device's frame. I'm wondering if this is achievable through Cannon? Inverting the gravity like so: world.gravity.set(0, 9.82, 0); doesn't need to invert the gravity, and even then, I'd have to have a 'roof' of sorts to have the objects bounce off the top and sides. Can you think of a way to achieve this?

Thanks in advance!

TRIMESH likely doesnt work.

TriMesh uses Float32Array for the vertices, but SparkAR doesn't seem to support TypedArrays out of the box. (strange...dunno why). Of course, there may be polyfills available though that the user may download on his own in the unlikely case they use trimesh. The "official" package published on Spark AR Library appears ot have this issue if you use something like:
CANNON.Trimesh.createTorus(4, 3.5, 16, 16); . But from the typehintings, Trimesh seems to be unavailable and not found in intellisense though..even though you can still call it remotely.

Scale factor between Cannon.js and Spark?

Hi!
I see that in the example the scale of the cubes are .1, while in cannon they are all set to 5.. What would be the scale ratio between both engines ?

EDIT: Apparently, the imported models from SparkAR Library are in the wrong dimensions with Spark's own scale units ?

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.