Author Topic: Another Problem With That Iron Patriot  (Read 2873 times)

Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Another Problem With That Iron Patriot
« on: July 08, 2014, 11:26:10 pm »
getTransformedCenter() is in front and underneath it, instead of in the center. There's no triangle whatsoever outside of the model (I have checked), and even calcCenter() doesn't help with that.

Between you and your soccer team, Germany is in great favor with me today. : -)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Another Problem With That Iron Patriot
« Reply #1 on: July 08, 2014, 11:34:05 pm »
I noticed that too in my test case. No idea why, it has to have something to do with the model import and/or Bones serialization. I would simple set the center to another, more fitting value after loading the model.

About soccer:  :o

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Another Problem With That Iron Patriot
« Reply #2 on: July 08, 2014, 11:38:45 pm »
Which center are you using? The one of the Object3D returned by getRoot()? At least that's the one that i was using.

Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Re: Another Problem With That Iron Patriot
« Reply #3 on: July 09, 2014, 12:37:35 am »
I tried both get(0)'s and getRoot()'s. Now, I'm getting something really strange: I added the following method. Even as the spheres visually approach each other, the distance as printed by System.out.println("Distance: "+player.model.getRoot().getTransformedCenter().distance(computer.model.getRoot().getTransformedCenter())) grows.

Code: [Select]
     private void fixCenters() {
if (ironMan.getIronVersion() == IronMan.IRON_PATRIOT) {
     SimpleVector newCenter = ironMan.model.getRoot().getTransformedCenter();
     newCenter.x -= 100f;
     newCenter.y -= 250f;//250f
     ironMan.model.getRoot().setCenter(newCenter);
     Object3D center = Primitives.getSphere(30f);
     center.build();
     center.translate(ironMan.model.getRoot().getTransformedCenter());
     ironMan.model.getRoot().addChild(center);
     theWorld.addObject(center);
}

SimpleVector c = superman.model.getRoot().getTransformedCenter();
c.z-= 150f;
superman.model.getRoot().setCenter(c);
Object3D superCenter = Primitives.getSphere(30f);
superCenter.build();
superCenter.translate(superman.model.getRoot().getTransformedCenter());
superman.model.getRoot().addChild(superCenter);
theWorld.addObject(superCenter);
     }

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Another Problem With That Iron Patriot
« Reply #4 on: July 09, 2014, 08:27:33 am »
Can you provide some sample output of superman.model.getRoot().getTransformedCenter() / superman.model.getRoot().getTranslation()?
After all, center is just a point in object space. It has no relevance for anything inside the engine and all that happens when calling getTransformedCenter() is that this point will be transformed by the current world transformation and the resulting point will be returned.
« Last Edit: July 09, 2014, 11:42:45 pm by EgonOlsen »

Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Re: Another Problem With That Iron Patriot
« Reply #5 on: July 09, 2014, 06:56:38 pm »
I see your point, but the balls are where I want them to be and they are approaching each other. The following screenshot shows Iron Patriot moving towards Superman while the distance printout grows.



Oh, and I assume you meant getTranslation(): Superman center: (-10.0,9.6,10.0) Translation: (-5.0,4.8,80.0)
« Last Edit: July 09, 2014, 07:15:26 pm by AGP »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Another Problem With That Iron Patriot
« Reply #6 on: July 09, 2014, 11:11:23 pm »
Those differences are very minor. They might as well be introduced by the rotation pivot being slightly off or similar. What happens if you move the models closer together? Do these values still increase?

Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Re: Another Problem With That Iron Patriot
« Reply #7 on: July 09, 2014, 11:17:07 pm »
The differences are very minor per frame. And yes, Iron Patriot is going right through Superman and just keeps going.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Another Problem With That Iron Patriot
« Reply #8 on: July 09, 2014, 11:51:24 pm »
No idea how this is supposed to happen. But then again, i've no idea what getRoot() actually returns. I would like to see a complete output of

translation of both entities/transformed center of both entities/distance

for a complete run from the start to the point where the entities actually met (maybe not for every frame...but you get the idea).


Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Re: Another Problem With That Iron Patriot
« Reply #9 on: July 15, 2014, 08:56:58 pm »
I didn't want to abandon this thread, so I'll post my solution: since I knew that the spheres were approaching each other,I tested for the centers of the spheres instead of the centers of getRoot(). But I do think that it's a bug in Bones that the distances grow while visually they should be shrinking (here's a question whose answer I think that I know: would getRoot()'s object space position change at all ever?).

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Another Problem With That Iron Patriot
« Reply #10 on: July 15, 2014, 09:51:14 pm »
I've no idea what getRoot() actually returns and how it relates to transformations of the objects, so i can't answer that... :(

Offline raft

  • quad
  • ******
  • Posts: 1974
    • View Profile
    • http://www.aptalkarga.com
Re: Another Problem With That Iron Patriot
« Reply #11 on: July 17, 2014, 09:17:47 am »
I've no idea what getRoot() actually returns and how it relates to transformations of the objects, so i can't answer that... :(
getRoot() returns the root object that all animated objects are added as child. Root object is a dummy object, it isn't added to world. it is created by Object3D.createDummyObj(). it's intented to translate/rotate the whole AnimatedGroup easily.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Another Problem With That Iron Patriot
« Reply #12 on: July 17, 2014, 08:38:26 pm »
That's what i expected, but i have to idea why it should show this odd distance behaviour then... ???

Offline AGP

  • quad
  • ******
  • Posts: 1526
    • View Profile
Re: Another Problem With That Iron Patriot
« Reply #13 on: July 18, 2014, 09:58:26 am »
On two of my computers, I discovered today, I'm having a problem with the Mark 42 model in which the program crashes. I get a JVM log and all. The exact same program runs fine with either Mark 3 or Iron Patriot. It must be a very specific memory thing that only happens on that model and with certain video drivers...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Another Problem With That Iron Patriot
« Reply #14 on: July 18, 2014, 11:11:07 am »
Can you post the log please?