Giter VIP home page Giter VIP logo

Comments (5)

CrazyWords1 avatar CrazyWords1 commented on June 12, 2024 1

Thank you so much, I figured out how to set the center of mass, I really appreciate your help. now I'm trying to figure out why the minecraft model doesn't visually match the physical model.

from libbulletjme.

stephengold avatar stephengold commented on June 12, 2024

The model does not want to accept setScale normally.

Applying setScale() to a compound shape is tricky, because it's not obvious how scaling should affect the child shapes. If possible, generate the collision shape at physics-space scale to begin with.

The center of mass at the corner

The center of mass is at (0,0,0) in the shape's coordinate system. You choose where to position the child shapes relative to that center.

Have you read the tutorial page that discusses collision shapes? In particular, the section on shapes for dynamic bodies? If you're unsure how to calculate the center of mass, principal axes, and moments of inertia for your entity by hand, you may want to use the principalAxes() and correctAxes() methods mentioned in the tutorial page.

the model does not want to converge with the visual representation

The open-source Minie and SPORT projects provide debug visualization tools for solving these sorts of issues. Perhaps you can adapt them for your Minecraft environment.

from libbulletjme.

CrazyWords1 avatar CrazyWords1 commented on June 12, 2024

With SPORT I was able to fix the visualization of the model, and I still have one last question, how i can mirror (flip) the CompoundCollisionShape on one of the axes?

P.S ( I mean the rotation of the model itself, not the PhysicsBody )

from libbulletjme.

stephengold avatar stephengold commented on June 12, 2024

That looks like a rendering question, not a Libbulletjme question.
Mathematically, mirroring on, say, the X axis replaces (x, y, z) with (-x, y, z).
In the context of 3-D graphics, reflection might also require reversing the winding order of the polygons.

from libbulletjme.

CrazyWords1 avatar CrazyWords1 commented on June 12, 2024

That looks like a rendering question, not a Libbulletjme question. Mathematically, mirroring on, say, the X axis replaces (x, y, z) with (-x, y, z). In the context of 3-D graphics, reflection might also require reversing the winding order of the polygons.

I really appreciate your help, thank you, you answered all my questions

from libbulletjme.

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.