VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Joystick Controller

The Joystick Controller demonstrates the following

Since this example is loaded as a plugin, it can be used in conjunction with the released VR-Forces application

In the Launcher, click the Plug-ins button to bring up the Plug-ins Selection dialog. Enable the joystick plugin. Then launch VR-Forces.

When creating a new scenario you will also need to use the Joystick simulation model set from the developer examples simulation model sets and create the Joystick Example entity to show the new Joystick Example function group and function. This shows how to implement a button and axis function

JoystickControllerThis subclass of DtControllerComponent prints out a message when the function group and function are enabled and used.

/*******************************************************************************
** Copyright (c) 2017 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
#include "vrfcgf/cgf.h"
extern "C" {
{
info.pluginName = "Joystick Controller";
info.pluginVersion = "1.00";
info.pluginCreator = "MAK Technologies";
info.pluginCreatorEmail = "sales@mak.com";
info.pluginContactWebPage = "www.mak.com";
info.pluginContactMailingAddress = "150 Cambridge Park Drive 3rd Floor - Cambridge, MA 02140 USA";
info.pluginContactPhone = "(617) 876 8085";
}
DT_VRF_DLL_PLUGIN bool DtInitializeVrfPlugin(DtCgf* cgf)
{
//Register the creation function for our derived controller with the
//DtSimComponentFactory.
return true;
}
}
/*******************************************************************************
** Copyright (c) 2017 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
//constructor
: DtControllerComponent(name, owner, simManager, desc, parentRegistry),
DtJoystickControllerInterface(owner, simManager, desc)
{
}
//destructor
{
}
// This returns a string from compTypes.h, and identifies the
// type of component
{
}
{
}
{
}
void MyJoystickControllerComponenet::calcAndSetPortValues(const DtString& functionGroup, const DtString& function, double value, bool repeat)
{
objectConsoleWarn() << "Received " << functionGroup << " and " << function << " with value " << value << std::endl;
}
{
return new MyJoystickControllerComponenet(name, owner, simManager, desc,
parentRegistry);
}

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)