tauruslittrow84
New member
- Joined
- Nov 12, 2011
- Messages
- 58
- Reaction score
- 0
- Points
- 0
I am trying to make a spotlight as a vessel I can move around on my base.
after toiling over this with others...
I still get this 'identifier not found error'
It seems to be something with member function calling Any ideas
Here's the error:
Here is my header .h
And here is my .cpp
after toiling over this with others...
I still get this 'identifier not found error'
It seems to be something with member function calling Any ideas
Here's the error:
Code:
1>Compiling...
1>spotlamp.cpp
1>c:\users\crice\documents\visual studio 2008\projects\spotlamp\spotlamp\spotlamp.cpp(32) : error C3861: 'AddSpotLight': identifier not found
1>Build log was saved at "file://c:\Users\crice\Documents\Visual Studio 2008\Projects\spotlamp\spotlamp\Debug\BuildLog.htm"
1>spotlamp - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Here is my header .h
Code:
#define ORBITER_MODULE
#include "Orbitersdk.h"
// ==============================================================
// spotlamp class interface
// ==============================================================
class spotlamp: public VESSEL2 {
public:
spotlamp (OBJHANDLE hVessel, int flightmodel)
: VESSEL2 (hVessel, flightmodel) {}
void clbkSetClassCaps (FILEHANDLE cfg);
void clbkLoadStateEx (FILEHANDLE scn, void *vs);
void clbkSaveState (FILEHANDLE scn);
void clbkPreStep (double simt, double simdt, double mjd);
void SetDockingLight (bool on);
int lightfront_status;
int clbkConsumeBufferedKey (DWORD key, bool down, char *kstate);
SpotLight *docking_lightfront;
};
And here is my .cpp
Code:
#include "spotlamp.h"
#include "OrbiterSDK.h"
// ==============================================================
// Some vessel parameters
// ==============================================================
const double MASS = 5;
// ==============================================================
// Overloaded callback functions
// ==============================================================
// --------------------------------------------------------------
// Set the capabilities of the vessel class
// --------------------------------------------------------------
void spotlamp::clbkSetClassCaps (FILEHANDLE cfg)
{
COLOUR4 col_a={0,0,0,0};
COLOUR4 col_white={1,1,1,0};
docking_lightfront = (SpotLight*)AddSpotLight(_V(-.441,0,1.582), _V(0,0,1), 150, 1e-3, 0, 1e-3, RAD*25, RAD*60, col_white, col_white, col_a);
docking_lightfront->Activate(true);
SetTouchdownPoints (_V(3.08,-4.5,-.534),_V(3.08,0,-.534),_V(3.08,4.5,-.534));
// visual specs
AddMesh ("spotlamp");
}
// --------------------------------------------------------------
// Save/load vessele state to/from scenario
// --------------------------------------------------------------
void spotlamp::clbkLoadStateEx (FILEHANDLE scn, void *vs)
{ //commented code is for reference only
char *line;
while (oapiReadScenario_nextline (scn, line)) {
//if (!strnicmp (line, "SOMEPARAM", 9)) {
// sscanf (line+9, "%lf", somevar);
//} else {
ParseScenarioLineEx (line, vs);
// unrecognised option - pass to Orbiter's generic parser
//}
}
}
void spotlamp::clbkSaveState (FILEHANDLE scn)
{ //commented code is for reference only
//char cbuf[256];
// default vessel parameters
VESSEL2::clbkSaveState (scn);
// custom parameters
//sprintf (cbuf, "%0.1f", somefloatpara,);
//oapiWriteScenario_string (scn, "SOMEPARAM", cbuf);
}
// --------------------------------------------------------------
// Called at each simulation time step before the state is updated
// --------------------------------------------------------------
void spotlamp::clbkPreStep (double simt, double simdt, double mjd)
{ //do something
}
// --------------------------------------------------------------
//Keyboard state handler. Check OrbiterAPI reference for details
// --------------------------------------------------------------
int spotlamp::clbkConsumeBufferedKey (DWORD key, bool down, char *kstate)
{ return 0;
}
// ==============================================================
// API callback interface
// ==============================================================
// --------------------------------------------------------------
// Vessel initialisation
// --------------------------------------------------------------
DLLCLBK VESSEL *ovcInit (OBJHANDLE hvessel, int flightmodel)
{
return new spotlamp (hvessel, flightmodel);
}
// --------------------------------------------------------------
// Vessel cleanup
// --------------------------------------------------------------
DLLCLBK void ovcExit (VESSEL *vessel)
{
if (vessel) delete (spotlamp*)vessel;
}