12-25-2012, 08:19 AM
I'm trying to rewrite cEntity in regard to physics. I'd like all entities to have their "speed" and to handle physics by default (overridable in subclasses). So that we can write the fluid interaction once, in the cEntity class and not in every subclass that is affected by fluids (basically everything except for players and falling blocks).
However, it is proving more difficult than at first anticipated. The most difficult part so far is the collision checking with the walls. Entities may be several blocks in diameter and in height, meaning several blocks need to be checked in each direction. It's one hell of a geometry nightmare. 3D Bresenham algorithm with fractional direction, yuck.
However, it is proving more difficult than at first anticipated. The most difficult part so far is the collision checking with the walls. Entities may be several blocks in diameter and in height, meaning several blocks need to be checked in each direction. It's one hell of a geometry nightmare. 3D Bresenham algorithm with fractional direction, yuck.