When I use some constant in a formula and trace for bugs I always get an error similar to this:
GameConstants.G = >Unknown type “com.madjack.games.disenthral.scenes.GameConstants”<
G is defined as:
[java]public final static float G = 6.67428E-11f;[/java]
Here the example is G, but when using any of those constants defined in my GameConstants class I get the error related to the constant used. Is there something I’m not getting?
For example, using tracing the following formula is a pain when you have to do it by hand.
[java]
public static float getOrbitalPeriodBinary(Star primary, Star companion) {
return FastMath.TWO_PI * FastMath.sqrt(FastMath.pow(primary.orbitRadius +
primary.getCompanionStar().orbitRadius, 3) /
GameConstants.G * (primary.mass + primary.getCompanionStar().mass));
}
[/java]
Anything I can do to fix that or is it a NetBeans problem?
Never had anything like this… The GameConstants class is a normal part of the project? Very strange.
Yeah, it is.
Running it without tracing works fine. Actually, it’s just while hovering that I get that behavior. The return value is fine (in this case it’s not since there’s a bug getting Infinity, but that’s beside the point). If I hit F8 to step it there no error. Just when hovering above the field.
The funniest (or saddest) is that it works fine when I hover above FastMath.TWO_PI.
I’m at a complete loss to explain that one.
Wich line are u toggling breakpoint? Does it matter?
Nope, it doesn’t matter if I enter the method manually (F7) or when a breakpoint is hit, I’ll always get the same behavior.