jPCT-AE - a 3d engine for Android > Support

setRotationPivot / Config.useRotationPivotFrom3DS on AE

<< < (2/3) > >>

lomac:
OK, I have found the circumstances that cause the problem. It only happens if you extend Object3D to make for instance your player class, as you did in the car demo.

So if my player class looks like this

--- Code: ---public class Player {
Actions actions;

Object3D model;

public SimpleVector lastFramePos;

public Player(Actions actions, Object3D model) {
this.model = model;
this.actions = actions;

actions.world.addObject(model);
}
}
--- End code ---

and I call player.model.rotateY(), then it works correctly everywhere.

But, if my player class looks like this:

--- Code: ---public class Player extends Object3D {
Actions actions;

public SimpleVector lastFramePos;

public Player(Actions actions, Object3D model) {
super(model);
this.actions = actions;

actions.world.addObject(this);
}
}
--- End code ---

and I call player.rotateY(), then the player does not rotate correctly in ae, but does in desktop. The only way to fix it in AE is to call player.setRotationPivot(SimpleVector.ORIGIN); EVERY FRAME in the rendering loop. (It does not matter where in the frame loop, beginning or end, it fixes it)


EgonOlsen:
WTF... ??? I'll have a look, but this is really strange...

EgonOlsen:
Are you getting the log flooded with messages like


--- Code: ---Object <some name> hasn't been build yet. Forcing build()!

--- End code ---

??

lomac:
Yes, I see it for a short while then it stops.

EgonOlsen:
Have to tried to simply build() all objects (obviously you aren't doing this) before setting the pivots, then set the pivots once, then render? There's a difference between desktop an AE in the default build()-behaviour. AE auto-builds at runtime if your code forgot to do it, desktop doesn't, at least not by default.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version