...
 
Commits (7)
......@@ -2,9 +2,6 @@ material BasicSurface/Diffuse
{
technique
{
pass
{
lighting off
}
pass { lighting off }
}
}
......@@ -23,6 +23,7 @@ void CCommandShipControl::execute(int iButton, int iState)
case 2:
l_poShooterApplication->getShip()->rotate(6);
break;
default: break;
}
}
......
......@@ -14,4 +14,4 @@ namespace OpenViBESSVEP
void execute(int iButton, int iState) override;
};
}
} // namespace OpenViBESSVEP
......@@ -19,4 +19,4 @@ namespace OpenViBESSVEP
private:
CVRPNServer* m_poVRPNServer = nullptr;
};
}
} // namespace OpenViBESSVEP
......@@ -19,23 +19,17 @@ namespace OpenViBESSVEP
~CShooterApplication() override;
bool setup(OpenViBE::Kernel::IKernelContext* poKernelContext) override;
CStarShip* getShip() { return m_poShip; }
void startExperiment() override;
void addTarget(uint32_t ui32TargetPosition);
bool m_bTargetRequest = false;
private:
bool m_bActive = false;
void processFrame(uint32_t ui32CurrentFrame) override;
CEGUI::Window* m_poInstructionsReady = nullptr;
CStarShip* m_poShip = nullptr;
CStarShip* m_poShip = nullptr;
std::vector<CShooterTarget*> m_oTargets;
};
}
} // namespace OpenViBESSVEP
......@@ -26,4 +26,4 @@ namespace OpenViBESSVEP
CShooterTarget(Ogre::Radian rAngle);
};
}
} // namespace OpenViBESSVEP
......@@ -23,16 +23,16 @@ namespace OpenViBESSVEP
private:
Ogre::SceneNode* m_poShipNode = nullptr;
CSSVEPFlickeringObject* m_poShipCannon = nullptr;
CSSVEPFlickeringObject* m_poShipLeftWing = nullptr;
CSSVEPFlickeringObject* m_poShipCannon = nullptr;
CSSVEPFlickeringObject* m_poShipLeftWing = nullptr;
CSSVEPFlickeringObject* m_poShipRightWing = nullptr;
Ogre::Real m_rAngularSpeed;
Ogre::Radian m_rCurrentAngle = 0;
int m_iCurrentRotationCount = 0;
int m_iCurrentRotationCount = 0;
Ogre::SceneNode* m_poShotNode = nullptr;
bool m_bIsShooting = false;
bool m_bIsShooting = false;
Ogre::Real m_rShotDistance;
};
}
} // namespace OpenViBESSVEP
......@@ -14,4 +14,4 @@ namespace OpenViBESSVEP
void execute(int iButton, int iState) override;
};
}
} // namespace OpenViBESSVEP
......@@ -32,12 +32,9 @@ bool CTrainerApplication::setup(IKernelContext* poKernelContext)
// paint targets
uint32_t l_ui32TargetCount = (uint32_t)(l_poConfigurationManager->expandAsUInteger("${SSVEP_TargetCount}"));
uint32_t l_ui32TargetCount = uint32_t(l_poConfigurationManager->expandAsUInteger("${SSVEP_TargetCount}"));
for (uint32_t i = 0; i < l_ui32TargetCount; i++)
{
this->addObject(CTrainerFlickeringObject::createTrainerFlickeringObject(i));
}
for (uint32_t i = 0; i < l_ui32TargetCount; i++) { this->addObject(CTrainerFlickeringObject::createTrainerFlickeringObject(i)); }
// draw the initial text
m_poInstructionsReady = m_poGUIWindowManager->createWindow("TaharezLook/StaticImage", "InstructionsReady");
......@@ -91,12 +88,12 @@ void CTrainerApplication::addObject(CTrainerFlickeringObject* poObject)
poObject->setVisible(true);
}
void CTrainerApplication::setTarget(int32_t i32Target)
void CTrainerApplication::setTarget(int i32Target)
{
uint32_t l_ui32CurrentTime = (int32_t)(time(nullptr) - m_ttStartTime);
uint32_t l_ui32CurrentTime = int(time(nullptr) - m_ttStartTime);
(*m_poLogManager) << LogLevel_Info << l_ui32CurrentTime << " > Target set to " << i32Target << "\n";
for (int32_t i = 0; i < int(m_oObjects.size()); i++) { m_oObjects[i]->setTarget(i32Target == i); }
for (int i = 0; i < int(m_oObjects.size()); i++) { m_oObjects[i]->setTarget(i32Target == i); }
}
void CTrainerApplication::startExperiment()
......@@ -111,14 +108,14 @@ void CTrainerApplication::startExperiment()
void CTrainerApplication::startFlickering()
{
uint32_t l_ui32CurrentTime = (uint32_t)(time(nullptr) - m_ttStartTime);
uint32_t l_ui32CurrentTime = uint32_t(time(nullptr) - m_ttStartTime);
(*m_poLogManager) << LogLevel_Info << l_ui32CurrentTime << " > Starting Visual Stimulation\n";
m_bActive = true;
}
void CTrainerApplication::stopFlickering()
{
uint32_t l_ui32CurrentTime = (uint32_t)(time(nullptr) - m_ttStartTime);
uint32_t l_ui32CurrentTime = uint32_t(time(nullptr) - m_ttStartTime);
(*m_poLogManager) << LogLevel_Info << l_ui32CurrentTime << " > Stopping Visual Stimulation\n";
m_bActive = false;
......
......@@ -15,7 +15,7 @@ namespace OpenViBESSVEP
~CTrainerApplication() override {}
bool setup(OpenViBE::Kernel::IKernelContext* poKernelContext) override;
void setTarget(int32_t i32Target);
void setTarget(int i32Target);
void startExperiment() override;
void startFlickering() override;
......@@ -33,4 +33,4 @@ namespace OpenViBESSVEP
CEGUI::Window* m_poInstructionsReady = nullptr;
};
}
} // namespace OpenViBESSVEP
......@@ -64,8 +64,8 @@ CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObjec
CTrainerFlickeringObject::CTrainerFlickeringObject(float f32PosX, float f32PosY, ColourValue oColour, uint8_t ui8LitFrames, uint8_t ui8DarkFrames) : CSSVEPFlickeringObject(nullptr, ui8LitFrames, ui8DarkFrames)
{
m_poElementNode = m_parentNode->createChildSceneNode();
m_poObjectNode = m_poElementNode->createChildSceneNode();
m_poElementNode = m_parentNode->createChildSceneNode();
m_poObjectNode = m_poElementNode->createChildSceneNode();
SceneNode* l_poPointerNode = m_poElementNode->createChildSceneNode();
RealRect l_oRectangle(f32PosX - m_targetWidth / 2, f32PosY + m_targetHeight / 2, f32PosX + m_targetWidth / 2, f32PosY - m_targetHeight / 2);
......@@ -85,10 +85,7 @@ CTrainerFlickeringObject::CTrainerFlickeringObject(float f32PosX, float f32PosY,
m_poPointer->setVisible(false);
}
void CTrainerFlickeringObject::setTarget(bool bIsTarget)
{
m_poPointer->setVisible(bIsTarget);
}
void CTrainerFlickeringObject::setTarget(bool bIsTarget) { m_poPointer->setVisible(bIsTarget); }
#endif
......@@ -22,10 +22,7 @@ namespace OpenViBESSVEP
void connectToNode(Ogre::SceneNode* poSceneNode);
void setTarget(bool bIsTarget);
bool isTarget()
{
return m_poPointer->getVisible();
}
bool isTarget() { return m_poPointer->getVisible(); }
private:
static CTrainerApplication* m_application;
......@@ -42,4 +39,4 @@ namespace OpenViBESSVEP
Ogre::SceneNode* m_poElementNode = nullptr;
Ogre::MovableObject* m_poPointer = nullptr;
};
}
} // namespace OpenViBESSVEP
......@@ -118,7 +118,7 @@ bool CApplication::setup(IKernelContext* poKernelContext)
// create the vector of stimulation frequencies
m_f64ScreenRefreshRate = (uint32_t)(l_poConfigurationManager->expandAsUInteger("${SSVEP_ScreenRefreshRate}"));
m_f64ScreenRefreshRate = uint32_t(l_poConfigurationManager->expandAsUInteger("${SSVEP_ScreenRefreshRate}"));
(*m_poLogManager) << LogLevel_Info << "Specified screen refresh rate :" << m_f64ScreenRefreshRate << "Hz\n";
......@@ -136,7 +136,7 @@ bool CApplication::setup(IKernelContext* poKernelContext)
double l_f64CurrentFrequency;
l_f64CurrentFrequency = (double)(l_poConfigurationManager->expandAsFloat("${SSVEP_Frequency_${SSVEP_FrequencyId}}"));
l_f64CurrentFrequency = double(l_poConfigurationManager->expandAsFloat("${SSVEP_Frequency_${SSVEP_FrequencyId}}"));
double l_f64ApproximatedFrameCount = m_f64ScreenRefreshRate / l_f64CurrentFrequency;
......@@ -281,10 +281,7 @@ void CApplication::go()
(*m_poLogManager) << LogLevel_Debug << "Ogre rendering loop finished ... exiting\n";
}
void CApplication::addCommand(ICommand* pCommand)
{
m_oCommands.push_back(pCommand);
}
void CApplication::addCommand(ICommand* pCommand) { m_oCommands.push_back(pCommand); }
void CApplication::startExperiment()
{
......
......@@ -46,24 +46,24 @@ namespace OpenViBESSVEP
protected:
OpenViBE::Kernel::IKernelContext* m_poKernelContext = nullptr;
OpenViBE::Kernel::ILogManager* m_poLogManager = nullptr;
OpenViBE::Kernel::ILogManager* m_poLogManager = nullptr;
double m_f64ScreenRefreshRate = 0;
CBasicPainter* m_poPainter = nullptr;
CBasicPainter* m_poPainter = nullptr;
bool m_bContinueRendering = true;
bool m_bContinueRendering = true;
uint32_t m_ui32CurrentFrame = 0;
Ogre::Root* m_poRoot = nullptr;
Ogre::Root* m_poRoot = nullptr;
Ogre::SceneManager* m_poSceneManager = nullptr;
Ogre::Camera* m_poCamera = nullptr;
Ogre::RenderWindow* m_poWindow = nullptr;
Ogre::Viewport* m_poViewport = nullptr;
Ogre::SceneNode* m_poSceneNode = nullptr;
Ogre::Camera* m_poCamera = nullptr;
Ogre::RenderWindow* m_poWindow = nullptr;
Ogre::Viewport* m_poViewport = nullptr;
Ogre::SceneNode* m_poSceneNode = nullptr;
CEGUI::OgreRenderer* m_roGUIRenderer = nullptr;
CEGUI::OgreRenderer* m_roGUIRenderer = nullptr;
CEGUI::WindowManager* m_poGUIWindowManager = nullptr;
CEGUI::Window* m_poSheet = nullptr;
CEGUI::Window* m_poSheet = nullptr;
std::vector<std::pair<uint32_t, uint32_t>> m_oFrequencies;
......@@ -83,4 +83,4 @@ namespace OpenViBESSVEP
Ogre::uint32 m_ui32WindowWidth;
Ogre::uint32 m_ui32WindowHeight;
};
}
} // namespace OpenViBESSVEP
......@@ -34,10 +34,10 @@ namespace OpenViBESSVEP
void paintText(const std::string& sID, const std::string& sText, Ogre::Real rX, Ogre::Real rY, Ogre::Real rWidth, Ogre::Real rHeight, const Ogre::ColourValue& oColour);
protected:
CApplication* m_poApplication = nullptr;
Ogre::OverlayManager* m_poOverlayManager = nullptr;
CApplication* m_poApplication = nullptr;
Ogre::OverlayManager* m_poOverlayManager = nullptr;
Ogre::OverlayContainer* m_poOverlayContainer = nullptr;
Ogre::SceneManager* m_poSceneManager = nullptr;
Ogre::SceneManager* m_poSceneManager = nullptr;
Ogre::AxisAlignedBox m_oAABInf;
};
}
} // namespace OpenViBESSVEP
......@@ -20,4 +20,4 @@ namespace OpenViBESSVEP
private:
CVRPNServer* m_poVRPNServer = nullptr;
};
}
} // namespace OpenViBESSVEP
......@@ -12,4 +12,4 @@ namespace OpenViBESSVEP
void execute(int iButton, int iState) override;
};
}
} // namespace OpenViBESSVEP
......@@ -5,7 +5,7 @@
using namespace OpenViBESSVEP;
CSSVEPFlickeringObject::CSSVEPFlickeringObject(Ogre::SceneNode* poObjectNode, uint32_t ui32LitFrames, uint32_t ui32DarkFrames)
CSSVEPFlickeringObject::CSSVEPFlickeringObject(Ogre::SceneNode* poObjectNode, uint32_t ui32LitFrames, uint32_t ui32DarkFrames)
: m_poObjectNode(poObjectNode), m_ui32LitFrames(ui32LitFrames), m_ui32DarkFrames(ui32DarkFrames) {}
void CSSVEPFlickeringObject::setVisible(bool bVisibility)
......
......@@ -17,12 +17,12 @@ namespace OpenViBESSVEP
protected:
Ogre::SceneNode* m_poObjectNode = nullptr;
uint32_t m_ui32CurrentFrame = 0;
uint32_t m_ui32LitFrames = 0;
uint32_t m_ui32DarkFrames = 0;
uint32_t m_ui32CurrentFrame = 0;
uint32_t m_ui32LitFrames = 0;
uint32_t m_ui32DarkFrames = 0;
private:
bool m_bVisible = true;
};
}
} // namespace OpenViBESSVEP
......@@ -16,10 +16,10 @@ CVRPNServer::CVRPNServer(CApplication* poApplication)
{
m_poApplication = poApplication;
int l_iPort = (int32_t)(m_poApplication->getConfigurationManager()->expandAsInteger("${VRPN_ExternalServerPort}"));
int port = int(m_poApplication->getConfigurationManager()->expandAsInteger("${VRPN_ExternalServerPort}"));
m_poApplication->getLogManager() << LogLevel_Debug << "VRPN SERVER PORT :" << l_iPort << "\n";
m_poConnection = vrpn_create_server_connection(l_iPort);
m_poApplication->getLogManager() << LogLevel_Debug << "VRPN SERVER PORT :" << port << "\n";
m_poConnection = vrpn_create_server_connection(port);
}
CVRPNServer* CVRPNServer::getInstance(CApplication* poApplication)
......@@ -52,10 +52,7 @@ void CVRPNServer::changeButtonState(std::string sName, int iIndex, int iState)
m_oButtonCache[sName][iIndex] = iState;
}
int CVRPNServer::getButtonState(std::string sName, int iIndex)
{
return m_oButtonCache[sName][iIndex];
}
int CVRPNServer::getButtonState(std::string sName, int iIndex) { return m_oButtonCache[sName][iIndex]; }
#endif
......@@ -36,4 +36,4 @@ namespace OpenViBESSVEP
std::map<std::string, vrpn_Button_Server*> m_oButtonServer;
std::map<std::string, std::vector<int>> m_oButtonCache;
};
}
} // namespace OpenViBESSVEP
......@@ -19,4 +19,4 @@ namespace OpenViBESSVEP
protected:
CApplication* m_poApplication = nullptr;
};
}
} // namespace OpenViBESSVEP
......@@ -62,28 +62,19 @@ ICommandOIS::~ICommandOIS()
}
}
void ICommandOIS::processFrame()
{
m_poKeyboard->capture();
}
void ICommandOIS::processFrame() { m_poKeyboard->capture(); }
bool ICommandOIS::keyPressed(const KeyEvent& oEvent)
{
for (uint32_t i = 0; i < m_oInstances.size(); i++)
{
m_oInstances[i]->receiveKeyPressedEvent(oEvent.key);
}
for (uint32_t i = 0; i < m_oInstances.size(); i++) { m_oInstances[i]->receiveKeyPressedEvent(oEvent.key); }
return true;
}
bool ICommandOIS::keyReleased(const KeyEvent& oEvent)
{
for (uint32_t i = 0; i < m_oInstances.size(); i++)
{
m_oInstances[i]->receiveKeyReleasedEvent(oEvent.key);
}
for (uint32_t i = 0; i < m_oInstances.size(); i++) { m_oInstances[i]->receiveKeyReleasedEvent(oEvent.key); }
return true;
}
......
......@@ -31,4 +31,4 @@ namespace OpenViBESSVEP
bool keyPressed(const OIS::KeyEvent& oEvent) override;
bool keyReleased(const OIS::KeyEvent& oEvent) override;
};
}
} // namespace OpenViBESSVEP
......@@ -14,7 +14,7 @@ namespace
{
void VRPN_CALLBACK ssvep_vrpn_callback_button(void* command, vrpn_BUTTONCB button)
{
((ICommandVRPNButton*)command)->execute(button.button, button.state);
static_cast<ICommandVRPNButton*>(command)->execute(button.button, button.state);
}
}
......@@ -41,9 +41,6 @@ ICommandVRPNButton::~ICommandVRPNButton()
delete m_poVRPNButton;
}
void ICommandVRPNButton::processFrame()
{
m_poVRPNButton->mainloop();
}
void ICommandVRPNButton::processFrame() { m_poVRPNButton->mainloop(); }
#endif
......@@ -18,4 +18,4 @@ namespace OpenViBESSVEP
protected:
vrpn_Button_Remote* m_poVRPNButton = nullptr;
};
}
} // namespace OpenViBESSVEP
......@@ -16,17 +16,14 @@ int main(int argc, char** argv)
{
if (argc != 2)
{
printf("Usage : %s [trainer|shooter]\n", argv[0]);
std::cout << "Usage: " << argv[0] << " [trainer|shooter]\n";
exit(1);
}
// initialize the OpenViBE kernel
CKernelLoader l_oKernelLoader;
Kernel::IKernelDesc* l_poKernelDesc = nullptr;
Kernel::IKernelContext* l_poKernelContext = nullptr;
Kernel::ILogManager* l_poLogManager = nullptr;
Kernel::IConfigurationManager* l_poConfigurationManager = nullptr;
Kernel::IKernelDesc* l_poKernelDesc = nullptr;
CString l_sError;
#if defined TARGET_OS_Windows
......@@ -51,7 +48,7 @@ int main(int argc, char** argv)
}
std::cout << "[ INF ] Got kernel descriptor, trying to create kernel\n";
l_poKernelContext = l_poKernelDesc->createKernel("ssvep-demo", Directories::getDataDir() + "/kernel/openvibe.conf");
Kernel::IKernelContext* l_poKernelContext = l_poKernelDesc->createKernel("ssvep-demo", Directories::getDataDir() + "/kernel/openvibe.conf");
if (!l_poKernelContext)
{
......@@ -62,13 +59,13 @@ int main(int argc, char** argv)
OpenViBEToolkit::initialize(*l_poKernelContext);
l_poConfigurationManager = &(l_poKernelContext->getConfigurationManager());
Kernel::IConfigurationManager* l_poConfigurationManager = &(l_poKernelContext->getConfigurationManager());
l_poConfigurationManager->createConfigurationToken("SSVEP_ApplicationDescriptor", CString(argv[1]));
CString l_sConfigFile = l_poConfigurationManager->expand("${Path_Data}/applications/ssvep-demo/openvibe-ssvep-demo.conf");
l_poConfigurationManager->addConfigurationFromFile(l_sConfigFile);
l_poLogManager = &(l_poKernelContext->getLogManager());
Kernel::ILogManager* l_poLogManager = &(l_poKernelContext->getLogManager());
if (l_poConfigurationManager->expand("$Env{OGRE_HOME}").length() == 0)
{
......@@ -83,10 +80,9 @@ int main(int argc, char** argv)
l_poConfigurationManager->addOrReplaceConfigurationToken("BuildType", "Release");
#endif
OpenViBESSVEP::CApplication* app = nullptr;
CString l_sApplicationType = l_poConfigurationManager->expand("${SSVEP_ApplicationType}");
OpenViBESSVEP::CApplication* app;
const CString l_sApplicationType = l_poConfigurationManager->expand("${SSVEP_ApplicationType}");
(*l_poLogManager) << Kernel::LogLevel_Info << "Selected Application : '" << l_sApplicationType.toASCIIString() << "'\n";
......@@ -128,7 +124,7 @@ int main(int argc, char** argv)
int main(int argc, char** argv)
{
printf("SSVEP demo has not been compiled as it depends on Ogre (missing/disabled)\n");
std::cout << "SSVEP demo has not been compiled as it depends on Ogre (missing/disabled)\n";
return -1;
}
......
......@@ -2,10 +2,7 @@ material BasicSurface/Diffuse
{
technique
{
pass
{
lighting off
}
pass { lighting off }
}
}
......@@ -43,12 +43,9 @@ bool CGenericStimulatorApplication::setup(IKernelContext* poKernelContext)
// paint targets
uint32_t l_ui32TargetCount = (uint32_t)(l_poConfigurationManager->expandAsUInteger("${SSVEP_TargetCount}"));
uint32_t l_ui32TargetCount = uint32_t(l_poConfigurationManager->expandAsUInteger("${SSVEP_TargetCount}"));
for (uint32_t i = 0; i < l_ui32TargetCount; i++)
{
this->addObject(CGenericStimulatorFlickeringObject::createGenericFlickeringObject(i));
}
for (uint32_t i = 0; i < l_ui32TargetCount; i++) { this->addObject(CGenericStimulatorFlickeringObject::createGenericFlickeringObject(i)); }
// draw the initial text
m_poInstructionsReady = m_guiWindowManager->createWindow("TaharezLook/StaticImage", "InstructionsReady");
......@@ -101,12 +98,12 @@ void CGenericStimulatorApplication::addObject(CGenericStimulatorFlickeringObject
poObject->setVisible(true);
}
void CGenericStimulatorApplication::setTarget(int32_t i32Target)
void CGenericStimulatorApplication::setTarget(int i32Target)
{
uint32_t l_ui32CurrentTime = (int32_t)(time(nullptr) - m_ttStartTime);
uint32_t l_ui32CurrentTime = int(time(nullptr) - m_ttStartTime);
(*m_logManager) << LogLevel_Info << l_ui32CurrentTime << " > Target set to " << i32Target << "\n";
for (int32_t i = 0; i < int(m_oObjects.size()); i++) { m_oObjects[i]->setTarget(i32Target == i); }
for (int i = 0; i < int(m_oObjects.size()); i++) { m_oObjects[i]->setTarget(i32Target == i); }
}
void CGenericStimulatorApplication::startExperiment()
......@@ -121,14 +118,14 @@ void CGenericStimulatorApplication::startExperiment()
void CGenericStimulatorApplication::startFlickering()
{
uint32_t l_ui32CurrentTime = (uint32_t)(time(nullptr) - m_ttStartTime);
uint32_t l_ui32CurrentTime = uint32_t(time(nullptr) - m_ttStartTime);
(*m_logManager) << LogLevel_Info << l_ui32CurrentTime << " > Starting Visual Stimulation\n";
m_bActive = true;
}
void CGenericStimulatorApplication::stopFlickering()
{
uint32_t l_ui32CurrentTime = (uint32_t)(time(nullptr) - m_ttStartTime);
uint32_t l_ui32CurrentTime = uint32_t(time(nullptr) - m_ttStartTime);
(*m_logManager) << LogLevel_Info << l_ui32CurrentTime << " > Stopping Visual Stimulation\n";
m_bActive = false;
......
......@@ -15,7 +15,7 @@ namespace OpenViBESSVEPMindShooter
~CGenericStimulatorApplication() override {}
bool setup(OpenViBE::Kernel::IKernelContext* poKernelContext) override;
void setTarget(int32_t i32Target) override;
void setTarget(int i32Target) override;
void startExperiment() override;
void startFlickering() override;
......@@ -33,4 +33,4 @@ namespace OpenViBESSVEPMindShooter
CEGUI::Window* m_poInstructionsReady = nullptr;
};
}
} // namespace OpenViBESSVEPMindShooter
......@@ -91,8 +91,8 @@ CGenericStimulatorFlickeringObject::CGenericStimulatorFlickeringObject(float pos
MovableObject* l_poLitObject;
MovableObject* l_poDarkObject;
m_elementNode = m_parentNode->createChildSceneNode();
m_poObjectNode = m_elementNode->createChildSceneNode();
m_elementNode = m_parentNode->createChildSceneNode();
m_poObjectNode = m_elementNode->createChildSceneNode();
SceneNode* l_poPointerNode = m_elementNode->createChildSceneNode();
RealRect l_oRectangle(posX - m_targetWidth / 2, posY + m_targetHeight / 2, posX + m_targetWidth / 2, posY - m_targetHeight / 2);
......@@ -120,10 +120,7 @@ CGenericStimulatorFlickeringObject::CGenericStimulatorFlickeringObject(float pos
m_pointer->setVisible(false);
}
void CGenericStimulatorFlickeringObject::setTarget(bool bIsTarget)
{
m_pointer->setVisible(bIsTarget);
}
void CGenericStimulatorFlickeringObject::setTarget(bool bIsTarget) { m_pointer->setVisible(bIsTarget); }
#endif
......@@ -39,4 +39,4 @@ namespace OpenViBESSVEPMindShooter
Ogre::SceneNode* m_elementNode = nullptr;
Ogre::MovableObject* m_pointer = nullptr;
};
}
} // namespace OpenViBESSVEPMindShooter
......@@ -116,7 +116,7 @@ protected:
Ogre::SceneManager* m_pSceneMgr = nullptr;
Ogre::SceneNode* m_pAttachNode = nullptr;
Ogre::SceneNode* m_pAttachNode = nullptr;
Ogre::String m_sGroupName;
Ogre::String m_sPrependNode;
// Ogre::TerrainGroup* mTerrainGroup = nullptr;
......
......@@ -180,6 +180,7 @@ void CCommandControlAnalog::commandeerShip(const double* pProbs)
}
if (l_f64Sum <= 0) { l_f64Sum = 1; }
/*
const bool l_bParalyzed = false;
if (l_bParalyzed)
{
......@@ -196,6 +197,7 @@ void CCommandControlAnalog::commandeerShip(const double* pProbs)
return;
}
*/
// In principle here we could do different things with the probabilities. If we predict just the
// maximum, this can be expected to be identical to the Classifier Processor box label output,
......@@ -223,12 +225,12 @@ void CCommandControlAnalog::commandeerShip(const double* pProbs)
else if (l_ui32MaxIdx == MOVE_LEFT && m_poApplication->getShip()->getTargetState(1) != CImpactShip::TS_OFF)
{
m_vCommandStates[1] = 1;
l_poShip->move(static_cast<int>(-6 * l_f64Strength));
l_poShip->move(int(-6 * l_f64Strength));
}
else if (l_ui32MaxIdx == MOVE_RIGHT && m_poApplication->getShip()->getTargetState(2) != CImpactShip::TS_OFF)
{
m_vCommandStates[2] = 1;
l_poShip->move(static_cast<int>(6 * l_f64Strength));
l_poShip->move(int(6 * l_f64Strength));
}
/*
......
......@@ -30,4 +30,4 @@ namespace OpenViBESSVEPMindShooter
bool m_bInControl = false;
};
}
} // namespace OpenViBESSVEPMindShooter
......@@ -23,6 +23,7 @@ void CCommandControlDiscrete::execute(int iButton, int iState)
CImpactApplication* l_poImpactApplication = dynamic_cast<CImpactApplication*>(m_poApplication);
/*
const bool l_bParalyzed = false;
if (l_bParalyzed)
{
......@@ -39,6 +40,7 @@ void CCommandControlDiscrete::execute(int iButton, int iState)
return;
}
*/
switch (iButton)
{
......
......@@ -19,4 +19,4 @@ namespace OpenViBESSVEPMindShooter
protected:
bool m_bInControl = false;
};
}
} // namespace OpenViBESSVEPMindShooter
......@@ -14,20 +14,11 @@ void CCommandControlDiscreteOIS::processFrame()
CImpactApplication* l_poShooterApplication = dynamic_cast<CImpactApplication*>(m_poApplication);
if (m_vKeyPressed[OIS::KC_UP] || m_vKeyPressed[OIS::KC_DOWN])
{
l_poShooterApplication->getShip()->shoot();
}
if (m_vKeyPressed[OIS::KC_LEFT])
{
l_poShooterApplication->getShip()->move(-6);
}
if (m_vKeyPressed[OIS::KC_RIGHT])
{
l_poShooterApplication->getShip()->move(6);
}
if (m_vKeyPressed[OIS::KC_UP] || m_vKeyPressed[OIS::KC_DOWN]) { l_poShooterApplication->getShip()->shoot(); }
if (m_vKeyPressed[OIS::KC_LEFT]) { l_poShooterApplication->getShip()->move(-6); }
if (m_vKeyPressed[OIS::KC_RIGHT]) { l_poShooterApplication->getShip()->move(6); }
}
void CCommandControlDiscreteOIS::receiveKeyPressedEvent(const OIS::KeyCode oKey)
......
......@@ -23,4 +23,4 @@ namespace OpenViBESSVEPMindShooter
private:
std::map<OIS::KeyCode, bool> m_vKeyPressed;
};
}
} // namespace OpenViBESSVEPMindShooter
......@@ -20,4 +20,4 @@ namespace OpenViBESSVEPMindShooter
private:
CVRPNServer* m_poVRPNServer = nullptr;
};
}
} // namespace OpenViBESSVEPMindShooter
......@@ -19,4 +19,4 @@ namespace OpenViBESSVEPMindShooter
private:
CVRPNServer* m_poVRPNServer = nullptr;
};
}
} // namespace OpenViBESSVEPMindShooter
......@@ -64,8 +64,8 @@ namespace OpenViBESSVEPMindShooter
CEGUI::Window* getInstructionWindow() { return m_poInstructionWindow; }
CImpactEnemyShip* m_poCurrentEnemy = nullptr;
bool m_bTargetRequest = false;
Ogre::Real m_rNextOrigin = 0.0;
bool m_bTargetRequest = false;
Ogre::Real m_rNextOrigin = 0.0;
private: