Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8191791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:59:44+00:00 2026-06-07T03:59:44+00:00

I get an unexpected ArrayIndexOutOfBoundsException with this code; can anyone help? I create two

  • 0

I get an unexpected ArrayIndexOutOfBoundsException with this code; can anyone help?

I create two polygons like this:

float[]vertice={.1f, 2.7f, .4f, 4.3f, 3.4f, 5.3f, 5.6f, 3.3f, 3.3f, .1f};
Polygon oPolygon1=new Polygon(vertice);

float[]vertice2={.2f,1.3f,1.9f,4.5f,4.1f,1.3f};
Polygon oPolygon2=new Polygon(vertice2);

And update their positions with:

oPolygon1.setPosition(x1,y1);
oPolygon2.setPosition(x2,y2);

But when I try to use Intersector to see if they overlap…

if(Intersector.overlapConvexPolygons( oPolygon1, oPolygon2)){
   //do something
}

… I get the following error:

Exception in thread “LWJGL Application”
java.lang.ArrayIndexOutOfBoundsException:

In this block of code within the Intersector:

// projection axis is perpendicular to potential separation axis edge i->j
float projX = verts1[j + 1] - verts1[i + 1];
float projY = verts1[i] - verts1[j];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:59:46+00:00Added an answer on June 7, 2026 at 3:59 am

    This appears to be a bug in LibGDX. In the line setting projX, it should wrap the index

    float projX = verts1[(j + 1) % length1] - verts1[i + 1];
    

    I’ll get this fixed in the SVN.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't figure out why I get this error: Parse error: syntax error, unexpected
I get an unexpected T_STRING error for this very commonly used Wordpress code (loop),
See also SO 1664677 I get this error 2: Syntax error: ( unexpected when
In running this on index.html, I get the following error: Uncaught SyntaxError: Unexpected token
I would like to get the smallest element from a vector. For this I
This is what I'd like to do: $app = (new Factory())->GetApp(); However, I get
I get unexpected results when I use DateTime.ParseExact. Here's my test code: Dim MinVal
I get an error that says Parse error: syntax error, unexpected T_PRIVATE in E:\PortableApps\xampp\htdocs\SN\AC\ACclass.php
In the following script I get an error: syntax error: unexpected end of file
Imaginary Situation: You’ve used mysqldump to create a backup of a mysql database. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.