pub struct Tilemap {
pub events: Ledger<TilemapEvent>,
/* private fields */
}Fields§
§events: Ledger<TilemapEvent>Implementations§
Source§impl Tilemap
impl Tilemap
pub fn world_to_tile_pos(&self, world_pos: &Vec2) -> V2i32
pub fn tile_to_world_pos(&self, tile_pos: &V2i32) -> Vec2
pub fn quantize(&self, t: &Box2d, world_pos: &Vec2) -> Rect2i32
pub fn tile_to_chunk_and_local_pos(&self, tile_pos: &V2i32) -> (V2i32, V2i32)
pub fn tile_to_chunk_pos(&self, tile_pos: &V2i32) -> V2i32
pub fn get_chunk(&self, chunk_pos: &V2i32) -> Option<&Chunk>
pub fn get_tile(&self, pos: V2i32) -> u8
pub fn set_tile(&mut self, pos: V2i32, tile: u8)
pub fn remove_tile(&mut self, pos: V2i32)
pub fn simple_resolve_ball(&self, col: &Ball, pos: Vec2, dir: &Vec2) -> Vec2
pub fn simple_resolve_box(&self, col: &Box2d, pos: Vec2, dir: &Vec2) -> Vec2
Trait Implementations§
Source§impl CollidesRel2d<Point> for Tilemap
impl CollidesRel2d<Point> for Tilemap
Source§fn collides_rel(&self, _t: &Point, rel: &impl Transformation2d) -> bool
fn collides_rel(&self, _t: &Point, rel: &impl Transformation2d) -> bool
Checks whether objects collide. Read more
Source§impl<'de> Deserialize<'de> for Tilemap
impl<'de> Deserialize<'de> for Tilemap
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PenetratesRel2d<Point> for Tilemap
impl PenetratesRel2d<Point> for Tilemap
Source§fn penetrates_rel(
&self,
_t: &Point,
rel: &impl Transformation2d,
) -> Option<Vec2>
fn penetrates_rel( &self, _t: &Point, rel: &impl Transformation2d, ) -> Option<Vec2>
Auto Trait Implementations§
impl Freeze for Tilemap
impl RefUnwindSafe for Tilemap
impl Send for Tilemap
impl Sync for Tilemap
impl Unpin for Tilemap
impl UnsafeUnpin for Tilemap
impl UnwindSafe for Tilemap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more