26AnalogNode(
ClientBase *client,
const std::string &device_name) :
29 _xy_output = define_output(
"xy", EventStoreVec2::get_class_type());
32 nassertv(client !=
nullptr);
34 client->get_device(ClientAnalogDevice::get_class_type(), device_name);
36 if (device ==
nullptr) {
38 <<
"Unable to open analog device " << device_name <<
"\n";
42 if (!device->is_of_type(ClientAnalogDevice::get_class_type())) {
44 <<
"Inappropriate device type " << device->get_type()
45 <<
" created; expected a ClientAnalogDevice.\n";
60 _xy_output = define_output(
"xy", EventStoreVec2::get_class_type());
63 nassertv(device !=
nullptr);
80write(std::ostream &out,
int indent_level)
const {
81 DataNode::write(out, indent_level);
83 if (_analog !=
nullptr) {
84 _analog->write_axes(out, indent_level + 2);
102 LPoint2 out(0.0f, 0.0f);
103 for (
int i = 0; i < max_outputs; i++) {
104 if (_outputs[i]._index >= 0) {
107 if (_outputs[i]._flip) {
108 out[i] = -state.value;
110 out[i] = state.value;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool is_valid() const
Returns true if the AnalogNode is valid and connected to a server, false otherwise.
An abstract base class for a family of client device interfaces–including trackers,...
Any of a number of different devices that might be attached to a ClientBase, including trackers,...
This object supervises the traversal of the data graph and the moving of data from one DataNode to it...
Encapsulates the data generated from (or sent into) any particular DataNode.
void set_data(int index, const EventParameter &data)
Sets the data for the indicated parameter.
The fundamental type of node for the data graph.
An optional parameter associated with an event.
A handy class object for storing simple values (like integers or strings) passed along with an Event ...
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.