class - c++ no suitable conversion function from "Camera" to "Actor *" -
fairly new c++ so, please gentle. getting str8 point:
first actor class:
class actor { vec3 location; vec3 rotation; }
then camera class:
class camera: public actor { float fov; }
and controller class:
class controller { actor* pawnactor; void setpawnactor(actor* actor); }
now problem...
considering camera derives actor tried like...
controller.setpawnactor(camera);
...but... compiler says: no suitable conversion function "camera" "actor *" exists. of course use: void setpawnactor(camera* camera);
seems pointless me create function each possible actor become 'pawnactor'. ideas???
again i'm new whole c++ thing so...
thanks time everyone.
pass &camera if camera object function expecting pointer not object .
Comments
Post a Comment