mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Add support for dynamic collision detection
This commit implements collision detection using the map files loaded from the cache, and adds support for modifying the collision matrices at runtime when the game world is updated. All checks to see if a tile is reachable should now be done via. World#traversable, instead of Region#traversable, as the World object can handle checking tiles across multiple regions. These are done for the WalkingQueue and Pathfinder implementations.
This commit is contained in:
@@ -40,6 +40,20 @@ public final class MapObject {
|
||||
this.orientation = orientation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new {@code MapObject}.
|
||||
*
|
||||
* @param id The object ID of this map object.
|
||||
* @param x The local X coordinate of this object.
|
||||
* @param y The local Y coordinate of this object.
|
||||
* @param height The height level of this object.
|
||||
* @param type The type of this object.
|
||||
* @param orientation The orientation of this object.
|
||||
*/
|
||||
public MapObject(int id, int x, int y, int height, int type, int orientation) {
|
||||
this(id, (height & 0x3f) << 12 | (x & 0x3f) << 6 | (y & 0x3f), type, orientation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the object ID of this map object.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user