ulfben

intersectsAABB (Intro Android 2018)

Jan 28th, 2018
1,056
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. //for Entity.java
  2. public boolean isColliding(Entity that){
  3.     return Entity.intersectsAABB(this, that);
  4. }
  5.  
  6. public void onCollision(Entity that){
  7.     // no default implementation
  8. }
  9.  
  10. public static boolean intersectsAABB(Entity a, Entity b) {
  11.     return !(a.right() < b.left()
  12.             || b.right() < a.left()
  13.             || a.bottom() < b.top()
  14.             || b.bottom() < a.top());
  15. }
Advertisement
Comments
  • Gyqizv
    125 days
    # text 0.21 KB | 0 0
    1. Best t33n active cpx link daily updates!
    2.  
    3. Copy and paste the link in a new browser tab and then hit enter!
    4.  
    5. https://crazyporn.@xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
    6.  
    7. Remove the @
  • Yuizcko
    79 days
    # text 0.19 KB | 0 0
    1. Best t33n active cpx link daily updates!
    2.  
    3. Copy and paste the link in a new browser tab and then hit enter!
    4.  
    5. https://crazyporn.xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
Add Comment
Please, Sign In to add comment