Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 1 of 1

Thread: need a bump in the right direction

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default need a bump in the right direction

    if i have 2 sets of coords, say 50,50 and 100,100.
    and then an array of square shaped obstacles between the two points
    for (int i = 0; i < arrayOfStuffInTheWay.size(); i++) {
       int x = arrayOfStuffInTheWay.get(i).getX();
       int y = arrayOfStuffInTheWay.get(i).getY();
       int width = arrayOfStuffInTheWay.get(i).getWidth();
       int height = arrayOfStuffInTheWay.get(i).getHeight();
     
    if (theBounds of the object are touch the coordinates of the line){
       //compare the range between x+width to the line
       //compare the range between y+height to the line
       // then do some logic and return true or false if there is a line of sight obstruction
       }
    }
    i guess i need to know how to get the line .. and get it efficiently. thanks for any input u can give in advance
    Last edited by helloworld922; October 15th, 2011 at 06:58 PM.


Similar Threads

  1. retrieving rows in reverse direction from db
    By the light in forum JDBC & Databases
    Replies: 5
    Last Post: September 29th, 2011, 05:29 AM
  2. [SOLVED] Someone point me to the right direction..
    By ineedhelp in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: June 30th, 2011, 11:03 PM
  3. Homework help, don't understand teach's hint, need some direction
    By crazed8s in forum Java Theory & Questions
    Replies: 2
    Last Post: December 8th, 2010, 04:56 PM
  4. Direction,
    By Time in forum Algorithms & Recursion
    Replies: 2
    Last Post: May 21st, 2010, 06:21 PM
  5. BUmp* **Anyone knows the proces of hand detection algorithm?
    By Cross`17 in forum Algorithms & Recursion
    Replies: 1
    Last Post: May 21st, 2010, 06:11 PM