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

Moving an Object3D to another smoothly.

<< < (5/5)

EgonOlsen:
Try to print out the content of the camera's matrix in addition (i.e. Camera.getBack()).

dl.zerocool:
Here you have it : (First fire)

--- Code: ---05-29 09:44:44.009: INFO/System.out(16056): Live a bee : Bee0 id: 6
05-29 09:44:44.029: INFO/System.out(16056): Camera onFire getPosition(0.0,0.0,0.0)
05-29 09:44:44.039: INFO/System.out(16056): Camera onFire getDirection(0.0,0.0,1.0)
05-29 09:44:44.039: INFO/System.out(16056): Camera onFire getBack(
05-29 09:44:44.039: INFO/System.out(16056):     1.0    0.0    0.0    0.0
05-29 09:44:44.039: INFO/System.out(16056):     0.0    1.0    0.0    0.0
05-29 09:44:44.039: INFO/System.out(16056):     0.0    0.0    1.0    0.0
05-29 09:44:44.039: INFO/System.out(16056):     0.0    0.0    0.0    1.0
05-29 09:44:44.039: INFO/System.out(16056): )
--- End code ---


After rotation : (snd Fire)

--- Code: ---05-29 09:44:46.579: INFO/System.out(16056): Camera onFire getDirection(0.0,0.0,1.0)
05-29 09:44:46.589: INFO/System.out(16056): Camera onFire getBack(
05-29 09:44:46.589: INFO/System.out(16056):     1.0    0.0    0.0    0.0
05-29 09:44:46.589: INFO/System.out(16056):     0.0    1.0    0.0    0.0
05-29 09:44:46.589: INFO/System.out(16056):     0.0    0.0    1.0    0.0
05-29 09:44:46.589: INFO/System.out(16056):     0.0    0.0    0.0    1.0
05-29 09:44:46.589: INFO/System.out(16056): )
--- End code ---

After more rotation (just in case) :

--- Code: ---05-29 09:44:50.359: INFO/System.out(16056): Camera onFire getPosition(0.0,0.0,0.0)
05-29 09:44:50.359: INFO/System.out(16056): Camera onFire getDirection(0.0,0.0,1.0)
05-29 09:44:50.359: INFO/System.out(16056): Camera onFire getBack(
05-29 09:44:50.359: INFO/System.out(16056):     1.0    0.0    0.0    0.0
05-29 09:44:50.359: INFO/System.out(16056):     0.0    1.0    0.0    0.0
05-29 09:44:50.359: INFO/System.out(16056):     0.0    0.0    1.0    0.0
05-29 09:44:50.359: INFO/System.out(16056):     0.0    0.0    0.0    1.0
05-29 09:44:50.359: INFO/System.out(16056): )
--- End code ---


dl.zerocool:
I think I've found something it's probably related to the fact that Player inerith from Camera.
When a player is create it does automaticly call constructor from Camera
perhaps at this moment it does override the jpct world camera.

I'm trying to do this with a composition instead.

EgonOlsen:
I don't think so, but unless you are using PLAYER as the world camera, there's no relation between the two...i'm confused now about who is using which camera in which context...anyway, i've uploaded a new jar that corrects a small oddity in lookAt(). It now recycles the internal matrix instead of assigning a new one for each call. This may help, if you are buffering the back matrix somewhere yourself, so that you might work with an outdated instance of it. I doubt that this will help, but maybe it's worth a try.

dl.zerocool:
Solved,

Ahhh... I can't trust this kind of things ^^

It was that, the camera from Player was not the Camera from jpct
But the object camera that Player created because he was extending Camera...

what is strange it that sensors does had effect on the Player.rotate  things who where functions from Camera directly...
Now what I do is pretty simple, Player is not more extending Camera, when I create a Player I pass a camera object
and I reimplemented the methods I need to call on Player.

So basically a composition :P

Thanks for your help !

Navigation

[0] Message Index

[*] Previous page

Go to full version