OffscreenInvisibleComponent limitations in Isometric / Orthogonal #1306
DeathPhoenix22
started this conversation in
Ideas
Replies: 1 comment
-
Yes you are right. The two boxes are usually known as: logical bounds and visual bounds. Perhaps we can avoid overriding and instead provide a way of getting the visual bounds from
I assume you calculate visual bounds based on the texture attached to an entity? Is this something that can be generalised and/or obtained from JavaFX (I am thinking layout bounds) for a general view represented by a collection of Nodes? |
Beta Was this translation helpful? Give feedback.
0 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
Hi,
I've recently tried to use the OffscreenInvisibleComponent and notice really quickly that it supports only flat 2D games (TopDown or Scrollers). In my case, I'm using an Orthogonal perspective (I'll possibly switch to Isometric one day).
What I noticed is the use of the boundingBoxComponent to define limits of an entity. Normally, the BoundingBox should fit, but the Collisions system is also using the bbox to define collision patterns.
I then realized that: There are 2 natural boundaries to any Entity in any game using Entities in a perspective angle:
For the sake of backward compatibility and simplicity, I've defined, in my game, that the current BoundaryComponent will be used as designed (for Collisions).
I've therefor written a new Component that I called "VisibilityComponent" responsible for doing what the OffscreenInvisibleComponent was doing, but using what I called the "entity viewport".
@AlmasB I could integrate my changes simply by integrating a new method to the existing OffscreenInvisibleComponent that can be overriden. It would basically return the EntityViewport (by default the bbox of the boundingBoxComponent) so it would be 100% backward compatible. Then, games could redefine what does "Offscreen" mean by overriding the getEntityViewport(..) method.
Do you want me to PR this?
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions