Hello Markus,

Markus Broecker wrote:
> Hello everyone,
> 
> I'm having some Problems getting the Navigator to do what I want. I pass 
> him the Camerabeacon node, I created for my camera and my only viewport. 
> Things like setAt/From/Up work and I get my correct camera position. Now 
> I want to use the FlyNavigator, so call getWalkNavigator, save the 
> pointer as a FlyNavigator* and try to call the methods I need like 
               ^^^
                is this a typo, did you mean WalkNavigator * ?

> rotate(), forward(), right(), but they don't seem to do anything.

depending on the answer to the question above, this is not too 
surprising ;) - If it really is just a typo, then perhaps the mode of 
the Navigator is not set correctly ?

> I call 
> updateCameraTransformation() every frame in the display/idle function.
> As I get my input from the Network, I don't use buttonPress, etc methods 
> from Navigator, as I want to control the camera directly. (The network 
> works, and the received messages are correct, so the problem lies with 
> the navigator).

the Navigator is more or less built to be used through the 
buttonPress/Release, etc. functions and the Fly/Trackball/WalkNavigator 
classes are mostly useful as members of the Navigator, there is just too 
much (functional) coupling between them.

> On a completely unrelated side note, I use a lot of CPEdit() with 
> multiple fieldmasks. I was wondering wether this is considered bad 
> practice, and if I should use begin/end-EditCP. Is there a rule of thumb 
> when to use which version, or doesn't it matter?

For almost all situations using CPEdit is fine and actually prevents 
some types of errors (like: using beginEditCP(...) ... beginEditCP(...) 
instead of ... endEditCP(...) or different field masks for begin and end).
The only downside is that the endEditCP is only executed at the end of 
the scope, i.e. when the CPEdit destructor runs. As mentioned this is 
normally not a problem, unless you change some fields and then read some 
others that are updated, when endEditCP is called (e.g. bounding 
volumes). These cases can be handled in two ways:
1) add an artificial scope, i.e.

{
     CPEdit myFCEdit(myFC, MyFC::SomeMask);

     myFC->setSome(...);
}

myFC->getSomeDerivedValue();

2) use explicit beginEditCP, endEditCP.

        Hope it helps,
                Carsten

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to