Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

877997 Posts in 32898 Topics- by 24323 Members - Latest Member: nickFromPaintteh

May 21, 2013, 01:18:06 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Quadtrees: check if 2 nodes are neighbours
Pages: [1]
Print
Author Topic: Quadtrees: check if 2 nodes are neighbours  (Read 200 times)
HernanZh
Level 2
**


hernizhou@hotmail.com
View Profile WWW Email
« on: August 23, 2012, 12:51:01 AM »

Hello, I currently have a quadtree in place for collision detection.
It works fine and all, but now I have something I want to figure out:
knowing 2 nodes in the quadtree, how do I check whether these 2 are neighbours or not?

I'm trying to figure out an algorithm for it, but I find it to be difficult.
Logged

st33d
Guest
« Reply #1 on: August 23, 2012, 02:03:46 AM »

Shouldn't your quadtree nodes be created with location and size data? Otherwise how do you know what's passing in and out of it?
Logged
HernanZh
Level 2
**


hernizhou@hotmail.com
View Profile WWW Email
« Reply #2 on: August 23, 2012, 02:09:30 AM »

Oh, good point, I forgot about that. I suppose I could check if their rectangle sizes are touching eachother.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic