About Store Forum Documentation Contact



Post Reply 
problems with headers, and another small question
Author Message
craksy Offline
Member

Post: #1
problems with headers, and another small question
ok, my gamestate code was kinda messy so i decided to clean it up, starting by putting my Unit struct (extend of Chr), into it's own file.
I put the struct itself into a file named Unit.h, and the functions into a file named Unit.cpp ...
now i got this:
1>game.obj : error LNK2019: unresolved external symbol "public: __thiscall Unit::Unit(void)" (??0Unit@@QAE@XZ) referenced in function "public: static void __cdecl EE::ClassFunc<struct Unit>::New(void *)" (?New@?$ClassFunc@UUnit@@@EE@@SAXPAX@Z)


so... i won't post any code in case you are able to figure out what i did wrong without it .

what exactly did i do wrong? i should't do any difference if its in the game.cpp or in the Unit.h/Unit.cpp right?

please tell me if you need any code.


and i got another little question:
i have this in my games update function, to be able to move around the world, when the mouse reaches the edge of the screen:
Code:
    if(Ms.pos.x < -1.5)Cam.at.operator -=(Vec(1, 0, 0));
    if(Ms.pos.x >  1.5)Cam.at.operator +=(Vec(1, 0, 0));
    if(Ms.pos.y >  0.8)Cam.at.operator +=(Vec(0, 0, 1));
    if(Ms.pos.y < -0.8)Cam.at.operator -=(Vec(0, 0, 1));

but if you rotate the camera of cause, it would go the wrong direction.
i might be able to figure it out with trig, but tbh. it's not my greatest skill pfft
so, i was wondering if theres a build in function to move the camera according to rotation.
so no matter how the cam is rotated:
x = right
-x = left
-z = back
z = forth

think you could help me out with that one as well? smile

thanks in advance smile
10-24-2009 10:32 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: problems with headers, and another small question
you haven't defined the class constructor

Unit:::Unit()
{
...
}

Cam.at+=Cam.matrix.x*Tm.d();
10-24-2009 11:24 AM
Find all posts by this user Quote this message in a reply
Post Reply