Giter Club home page Giter Club logo

Comments (3)

sebcrozet avatar sebcrozet commented on August 17, 2024

Thank you for this feature suggestion. What are some concrete use-case for these factors?

If you are looking for the ability to lock the rotation and/or translation movements of a rigid-body, you can already use RigidBodyDesc.restrictRotations, RigidBodyDesc.lockRotations, and RigidBodyDesc.lockTranslations.

from rapier.js.

LeXXik avatar LeXXik commented on August 17, 2024

@sebcrozet to be honest, I don't have many examples, when I would use it other than just to lock some axis. I think the only time I used it with interpolation between 0 and 1 was when there was a game with wind gusts, where a wind would suddenly "blow" from some direction at varied strength, dampening the player controller movement at some direction. I guess the same could be achieved by applying a force on the controller.

I stumbled upon this while integrating Rapier with PlayCanvas, which currently is integrated with Ammo. The Editor exposes those properties:
image

Setting one of them to 0 would effectively "lock" the axis, which is a way to do it in Ammo. Not too critical of a feature, I suppose, as I can probably output a message to user that only 0 or 1 is supported when using Rapier backend.

from rapier.js.

LeXXik avatar LeXXik commented on August 17, 2024

In a casual game of bowling, I have some hazards on the road that imped the ball's travel. For example, water or sand, which affect the ball's movement in a single or both axii. The way it works is that the ball multiplies own factors with whatever it traverses through. I think it would be a good case for enabling linear/angular factors here. For now, I have to code in the factors separately for each type, verify the obstacle type the ball is going through and manually adjust the velocity based on the factors multiplication result.

Edit:
Actually, thinking about it, this is not how the linear factor should be used. I mean it can, but then it is a decision of mine, rather than the physics engine. One's linear factor should not affect the other one's. It's probably related to the friction factors rather, but I think we can't change friction on each axis individually.

from rapier.js.

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.