/datum/camerachunk
Vars | |
active_static_images | images currently in use on obscured turfs. |
---|---|
cameras | cameras that can see into our grid indexed by the z level of the camera |
obscuredTurfs | turfs our cameras cant see but are inside our grid. associative list of the form: list(obscured turf = static image on that turf) |
seenby | camera mobs that can see turfs in our grid |
turfs | list of all turfs, associative with that turf's static image turf -> /image |
visibleTurfs | turfs our cameras can see inside our grid |
Procs | |
New | new turfs that we couldnt see last update but can now turfs that we could see last update but cant see now Create a new camera chunk, since the chunks are made as they are needed. |
add | Add an AI eye to the chunk, then update if changed. |
hasChanged | Updates the chunk, makes sure that it doesn't update too much. If the chunk isn't being watched it will instead be flagged to update the next time an AI Eye moves near it. update_delay_buffer is used for cameras that are moving around, which are cyborg inbuilt cameras and mecha onboard cameras. This buffer should be usually lower than UPDATE_BUFFER_TIME because otherwise a moving camera can run out of its own view before updating static. |
remove | Remove an AI eye from the chunk |
update | The actual updating. It gathers the visible turfs from cameras and puts them into the appropiate lists. Accepts an optional partial_update argument, that blocks any calls out to chunks that could affect us, like above or below |
visibilityChanged | Called when a chunk has changed. I.E: A wall was deleted. |
Var Details
active_static_images
images currently in use on obscured turfs.
cameras
cameras that can see into our grid indexed by the z level of the camera
obscuredTurfs
turfs our cameras cant see but are inside our grid. associative list of the form: list(obscured turf = static image on that turf)
seenby
camera mobs that can see turfs in our grid
turfs
list of all turfs, associative with that turf's static image turf -> /image
visibleTurfs
turfs our cameras can see inside our grid
Proc Details
New
new turfs that we couldnt see last update but can now turfs that we could see last update but cant see now Create a new camera chunk, since the chunks are made as they are needed.
add
Add an AI eye to the chunk, then update if changed.
hasChanged
Updates the chunk, makes sure that it doesn't update too much. If the chunk isn't being watched it will instead be flagged to update the next time an AI Eye moves near it. update_delay_buffer is used for cameras that are moving around, which are cyborg inbuilt cameras and mecha onboard cameras. This buffer should be usually lower than UPDATE_BUFFER_TIME because otherwise a moving camera can run out of its own view before updating static.
remove
Remove an AI eye from the chunk
update
The actual updating. It gathers the visible turfs from cameras and puts them into the appropiate lists. Accepts an optional partial_update argument, that blocks any calls out to chunks that could affect us, like above or below
visibilityChanged
Called when a chunk has changed. I.E: A wall was deleted.