Giter Site home page Giter Site logo

Change scale at runtime about cannon-es HOT 2 OPEN

pmndrs avatar pmndrs commented on May 25, 2024
Change scale at runtime

from cannon-es.

Comments (2)

krispya avatar krispya commented on May 25, 2024

Hi all, I started working on this concept with this branch: https://github.com/krispya/cannon-es/tree/exp/scaling

I have a proof of concept working which you can see with the 'Scaling' demo I added to examples. Right now the proof of concept only scales spheres and boxes, but I was curious what people thought before I made it more robust.

The main motivation for me to add this is to get easier interoperability between three and cannon-es when applying basic args to the mesh and bounding area created by cannon. A common use case for this is use-cannon which encourages sharing props between them. This turns the process into a single method call or as simple as setting an option on construct.

The main concern is this gets close to violating the rigid body contract. Schteppe wanted to enforce this by making users destroy and create a new body when they wanted to change its dimensions. For me, I thought it was enough to make scale update on set in the render loop like position and quaternion do, but instead have its own updateScale method much like updateAABB or other costly functions.

from cannon-es.

krispya avatar krispya commented on May 25, 2024

Updated to work with Complex Polyhedron and Cylinder now. I didn't bother touching Heightfield and Trimesh until there is more of a conversation. Trimesh has a local scale property and method which might be better than how I am handling it on shapes right now.

from cannon-es.

Related Issues (20)

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.