Jump to content
  • Advertisement
  • entries
  • comments
  • views

Physics in a Cell and Portal universe

Sign in to follow this  


I have regretfully omitted to mention something quite important, although I did allude to it.
How do we track which subspace an entity is in at any given moment - and what happens if an entity is poking partly through a portal?

We can handle this two ways, but personally, I think it's helpful to make the following declaration:


The origin of anything is an infinitely small point in space, occupying zero volume.
We can, as mentioned, utilize the BSP tree structure to quickly determine which subspace or cell contains a given point.
So we can say for certain which cell contains a given entity (say, the camera).
But what if the entity is partly sticking through one or more portals? Is the entity actually in more than one cell?

For the purposes of collision detection, visibility and etc, the answer is YES, we are going to have to take this entity into account when processing the neighboring cell.
But for the purpose of answering the query 'what cell am i in', the answer is NO, an entity is 'owned' by the cell that contains its origin.

The physical simulation of the game world can be partitioned by Cell, but NOT CLEANLY - we must support the notion of a 'dirty list' of entities that belong to other cells, and yet are partially invading the given cell, and so could potentially be involved in collisions. We need something that is not exactly 'simulation islands' but more something like 'simulation peninsulas' or maybe 'simulation islands with floating walkways' ( :P )

Even with this extra cost of maintaining the 'dirty lists', we're still several orders faster than if we only had one big simulation.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!