Yeah, please go ahead. I am still doing R&D for physics, so I am looking at the client code, trying a couple of things, thinking some crazy ideas, etc... so it is perfect timing.
Brainstorming: Physics and Packet Handling for Entities
|
04-22-2013, 05:26 PM
Cool, I just moved the physics code to the cEntity class. Also, it is using cChunk to get the block information Now, the next feature to do should be entity collision. I think this one my be tricky, but it will be useful for minecarts/projectiles.
04-22-2013, 07:03 PM
Entity collision with blocks or with other entities?
04-22-2013, 11:54 PM
with other entities
04-23-2013, 04:13 AM
I'd have done proper block collisions first, but it's your way.
How are you going about this? Some sort of spring physics? When two entities are closer to each other than their dimensions, add a velocity away from each other proportionate to how close they are?
04-23-2013, 02:36 PM
I see what you mean about block collisions. I found a bug with blocks that are not solid. The collision is detected as if the block was solid. So, I should probably fix that before going to entity on entity physics.
For entity to entity physics, I was thinking elastic physics (we might have to introduce the concept of mass). What do you all think?
04-23-2013, 06:24 PM
As far as I know, there is no block collision code for entities. There's only the cTracer which does a single ray collision, but entities need volume-collision, or at least (like in Vanilla) bounding-box collision.
Adding mass to entities is a good idea. Isn't it needed for proper physics already? It should be - at least for the fluid interaction (not that that would be implemented ).
04-25-2013, 02:36 PM
Yeah, you are right. There is only cTracer for a single block collision. Ok, I'll add some proper block collision. That's easier than entity to entity collision.
04-29-2013, 04:58 AM
I added mass. However, I am not using it yet. It will be used for entity on entity collision. I am now writing bounding-volume collision with blocks. I'll add some dimensions for entities like width, height, and length.
I think a more reasonable dimensions would be "height" and "diameter", so that you don't have to worry about entity rotation (I don't think vanilla worries, either)
Also, I fixed your mass commit, it was missing a semicolon Don't you compile before committing? |
« Next Oldest | Next Newest »
|
Users browsing this thread: 5 Guest(s)