Worlds¶
World¶
-
class
serge.world.
World
(name)[source]¶ Bases:
serge.common.Loggable
,serge.serialize.Serializable
,serge.common.EventAware
The main world object
The Engine will control main worlds. Each world has a number of Zones which contain Actors.
-
clearActorsExceptTags
(tags)[source]¶ Clear all actors except the ones with a tag in the list of tags
-
requestResortActors
()[source]¶ Request that actors are resorted the next time we render
Call this if you have adjusted the rendering order of actors
-
scheduleActorRemoval
(actor)[source]¶ Remove an actor at the end of the next update for the world
This method can be used to safely remove an actor from the world during the execution of the world update. It can sometimes be useful to do this when inside logic that is iterating over actors or inside the updateWorld event loop.
-
sleepPhysicsForActors
(actors)[source]¶ Tell the actors to go to sleep from a physics perspective
The actors will still be visible and will still be updated but they will not update their physics. Useful for optimising when an actor does not need to interact with the physics simulation for a while.
If an actor is unzoned then this will have no impact on them
-