Git Product home page Git Product logo

Comments (4)

ddevault avatar ddevault commented on June 28, 2024

Yeah, physics are weird.

from truecraft.

UnknownShadow200 avatar UnknownShadow200 commented on June 28, 2024

I'm wondering if all these calls:

+ new Vector3(0.5)

in the PhysicsEngine classes in both the server and the client are partially responsible. This seems incorrect, as the BlockProvider returns a bounding box of [0, 1] by default, not [-0.5, 0.5].

from truecraft.

ddevault avatar ddevault commented on June 28, 2024

That's not why. That just moves the item entity to the middle of the block it was mined from. Spasming is because TrueCraft physics are janky.

from truecraft.

UnknownShadow200 avatar UnknownShadow200 commented on June 28, 2024

Hmm. Because when I removed the '0.5' offset from the Y axis collision, it seemed to stop the problem on the ground (but not in the air)
mcitems

Edit: Okay, I see what you said about the physics. But I have a few questions:

  1. Why are entity bounding boxes [Position, Position + Size]? Shouldn't they be [(pos.X - size.X / 2, pos.Y, pos.Z - size.Z / 2), (pos.X + size.X / 2, pos.Y + size.Y, pos.Z + size.Z / 2)]
  2. What's the reasoning behind these:
entity.Velocity.Z - (TempBoundingBox.Min.Z - collisionPoint.Value));

Shouldn't the velocity on the axis of collision just be 0?
3) Shouldn't the offsetting of the horizontal axes by 0.5 belong in the ItemEntity class, rather than the PhysicsEngine?
4) Shouldn't

collision = position;

Be adjusted to reflect that velocity components less than 0 collide with the max component of the block bounding box, not the min? Also, that some blocks may not have a min point of 0?
5) Shouldn't 'collision' only be assigned when the 'collisionPoint' variable is changed?

from truecraft.

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.