andargor
Member
|
Strange error on zoom out
I've derived a class from Game::Item and I fix the camera to objects created by this class like this (as per tutorials, "ship" is of the Ship class):
Cam.setSpherical(
ship->pos(),
Cam.yaw,
Cam.pitch,
0,
Cam.dist*ScaleFactor(Ms.wheel()*-0.2f))
.updateVelocities()
.set();
If I zoom out too much, the game crashes with a "pure virtual function call" error. It is definitely caused by the Ship object, because if I remove it and replace it's position by Vec(0,0,0), I can zoom out very far (until Esenthel eats all my memory ^^).
I checked the declarations of Game::Item and Game::Obj to see if there was an abstract function that needed to be implemented, but I didn,t find any.
What causes this? For now, I'm clamping Cam.dist to a low number, like 200.0 as a work-around.
(This post was last modified: 04-29-2011 02:13 AM by andargor.)
|
|
04-29-2011 02:13 AM |
|
Esenthel
Administrator
|
RE: Strange error on zoom out
use debugging, probably your object gets unloaded and you try to use it
|
|
04-29-2011 11:59 AM |
|
andargor
Member
|
RE: Strange error on zoom out
Sorry about the late reply, I just wanted to say thanks for the response. I'm just getting my head wrapped around Game::ObjMemx and absElms / validElms
I looked at the definitions and couldn't find a difference, but elms() is the same as validElms()?
(This post was last modified: 05-13-2011 04:31 AM by andargor.)
|
|
05-13-2011 04:31 AM |
|
Esenthel
Administrator
|
RE: Strange error on zoom out
please read documentation for memory containers (and check memory containers tutorials), if you won't find answer write again
|
|
05-13-2011 07:53 AM |
|
andargor
Member
|
RE: Strange error on zoom out
Thanks, I checked them out, and now I know enough to be dangerous.
|
|
05-14-2011 11:34 PM |
|