FollowController does not. 

Software: Away3D 4.x

Delfeld, Newbie
Posted: 31 July 2012 06:09 AM   Total Posts: 16

How exactly does the FollowController follow the “lookAtObject”?  Is it supposed to?  And, in a similar strain, can the documentation be any less helpful?

I am using this type of thing:

In initEngine() I have:

...
camera view.camera;
cameraController = new FollowController(cameranull45,20);
... 

in assetCompleteHnd(), when it loads the mesh I want to follow, I have:

...
cameraController.lookAtObject theMesh;
... 

and in the frameHnd(), I have:

...
if (
theMesh)
{
 theMesh
.rotationY += currentRotationInc;
}
   
cameraController
.update();
view.render();
... 

That seems to work—the camera tracks the rotations.  However, in updateMovement() I have:

...
theMesh.+= dir FLY_SPEED;
cameraController.update();
view.render();
... 

and the camera does not follow theMesh off into the distance.

So . . .  what is going on?

   

Richard Olsson, Administrator
Posted: 31 July 2012 09:16 AM   Total Posts: 1192   [ # 1 ]

I tried to reproduce the issue and found that there is a bug in FollowController when the lookAtTarget is not in the same coordinate space as the camera (ie when it’s in a container.)

Could that be the case for you? Can you try adding “theMesh” straight to the scene instead of to a container, or move “theMesh” instead of moving the container, if that’s what you’re doing?

   

Delfeld, Newbie
Posted: 31 July 2012 04:44 PM   Total Posts: 16   [ # 2 ]

Thanks for the suggestion.  The FollowController works properly when the mesh is added directly to the scene. 

Previously, I was adding the Loader3D to the scene which carried the mesh along with it.  This method was taken from the example on http://www.flashmagazine.com/tutorials/detail/away3d_4_basics_-_the_cameras/ (basic_cube_v4.as), and does not seem to work.  I hope it is a simple bug to fix.

   

Richard Olsson, Administrator
Posted: 01 August 2012 07:21 AM   Total Posts: 1192   [ # 3 ]

Thanks for verifying.

Do you mind filing a bug report at http://github.com/away3d/away3d-core-fp11/issues and we will let you know through there once it has been fixed!

   

Delfeld, Newbie
Posted: 01 August 2012 02:40 PM   Total Posts: 16   [ # 4 ]

Added bug report at https://github.com/away3d/away3d-core-fp11/issues/377

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X