GhostControls behaving weirdly on my Windows

Gist of the issue is this: I finished applying some GhostControls for hitboxes, and they look like this:

Now, I know it’s slightly hard to see, but those GhostControls around the player’s bodies should be matching the rotation of the body parts (like the arm is at 90 degrees and stuff). Also, the huge box in front of on of the players is good right now. However, this is how it looked in on my Linux system and on my friend’s system:

The hitboxes are all correctly rotated and following the player, even through animations. Even though the box is wrong now, I can fix that. It’s the ghostControls rotation I want to know about.

What is it on my Windows version of JME that could be causing this? Is it an update I need to install or something?

Ghost controls don’t rotate, they use the AABB for collision detection.

Axis Aligned Bounding Box? Well, I know something about that, but I don’t think you understood my issue. What I’m trying to say is that when I attach a Ghost control to a node, and the node rotates, the ghost control should rotate too, correct? But mine doesn’t. Or at least, as you can see in the first pic, it doesn’t. In the second one, it does.

No it should not. It doesn’t rotate, thats what axis aligned means.

So, then, is the 2nd picture have something wrong? Or at least, could you describe why there is a discrepancy between the two images? They have the same code.

@machspeeds said: So, then, is the 2nd picture have something wrong? Or at least, could you describe why there is a discrepancy between the two images? They have the same code.

Well, something is different. Can you describe the difference between how they were run?

Well, something is different. Can you describe the difference between how they were run?

Well, what can I say? One is run on JME3 rc2 (no nightly updates installed) on Windows, the other JME3 rc2 on Ubuntu 12.04. Windows has java version 1.6.0_38, don’t know what my Ubuntu is running though.

Both of them are running this exact code to create and attach the Ghost controls:

[java]SceneGraphVisitorAdapter hitboxes = new SceneGraphVisitorAdapter() {
@Override
public void visit(Node node) {
System.out.println(node.getName() + “HI”);
if(node.getUserData(“hitbox”)!=null){
System.out.println(“HERE”);
if(node.getUserData(“hitbox”).equals(“head”)){
//RigidBodyControl head = new RigidBodyControl(new SphereCollisionShape(1f), 1.0f);
GhostControl head = new GhostControl(new CapsuleCollisionShape(1,1, 1));
// head.setPhysicsLocation(node.getWorldTranslation());
node.addControl(head);
bulletAppState.getPhysicsSpace().add(head);
} else if(node.getUserData(“hitbox”).equals(“torso”)){
GhostControl torso = new GhostControl(new BoxCollisionShape(new Vector3f(2f,3f,1f)));
//torso.setPhysicsLocation(node.getWorldTranslation());
node.addControl(torso);
bulletAppState.getPhysicsSpace().add(torso);
} else if(node.getUserData(“hitbox”).equals(“left_arm”) || node.getUserData(“hitbox”).equals(“right_arm”)){
GhostControl arm = new GhostControl(new BoxCollisionShape(new Vector3f(.5f,3f,1f)));
//arm.setPhysicsLocation(node.getWorldTranslation());
node.addControl(arm);
bulletAppState.getPhysicsSpace().add(arm);
} else if(node.getUserData(“hitbox”).equals(“left_leg”) || node.getUserData(“hitbox”).equals(“right_leg”)){
GhostControl arm = new GhostControl(new BoxCollisionShape(new Vector3f(.5f,3f,1f)));
//arm.setPhysicsLocation(node.getWorldTranslation());
node.addControl(arm);
bulletAppState.getPhysicsSpace().add(arm);
}

      }
    }

};[/java]

Any thoughts?

@machspeeds said: Well, what can I say? One is run on JME3 rc2 (no nightly updates installed) on Windows, the other JME3 rc2 on Ubuntu 12.04. Windows has java version 1.6.0_38, don't know what my Ubuntu is running though.

Both of them are running this exact code to create and attach the Ghost controls:

Any thoughts?

I’m almost reading more into what you didn’t say than what you did…

Does that mean that the second one has all patches applied? (That’s the implication behind mentioning it for the first case very specifically and leaving it completely out for the second one.)

What other code is different? Specifically pointing out that this code is the same implies that there is other code that is different. For example, how do we know the second picture is even showing the same debug shapes… maybe that one has a rag doll or similar applied and we are seeing actual collision shapes and not AABB ghosts.

The problem is in the differences and not the similarities. If the “exact same code is running” but different results are happening… then the issue is not in the “exact same code that is running”.

Oh, man, I need to be more explicit? Okay, sorry for the confusion.

They are EXACTLY the same in version. No nightly updates, only the current JME 3.0 RC2.

And the code is exactly the same all throughout. I just pulled from github to my Ubuntu version, ran it and BANG. The 2nd result popped. I would be happy to point out differences, if there were any.

Currently checking if my friend has the same version too. I’m pretty sure he does, but double checking.

The only thing I can say with certainty is that “something is different”. You just need to figure out what.

So it has come to this. Well, when homework is out of the way, I’ll try pulling to a new project entirely and checking out the results.

Stay tuned…

Okay, so I reinstalled JME, and somehow, everything worked. I guess I was on some old update or something, I’m not sure.

But thanks for time guys. This is really good news for me.

1 Like