Brainstorming: Physics and Packet Handling for Entities
#31
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.
Reply
Thanks given by:
#32
Cool, I just moved the physics code to the cEntity class. Also, it is using cChunk to get the block information Smile 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.
Reply
Thanks given by:
#33
Entity collision with blocks or with other entities?
Reply
Thanks given by:
#34
with other entities
Reply
Thanks given by:
#35
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?
Reply
Thanks given by:
#36
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?
Reply
Thanks given by:
#37
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 implementedTongue ).
Reply
Thanks given by:
#38
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.
Reply
Thanks given by:
#39
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.
Reply
Thanks given by:
#40
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 Wink Don't you compile before committing?
Reply
Thanks given by:




Users browsing this thread: 18 Guest(s)