Hi everyone,
I'm fairly new to C++ programming and I need to try and figure out a bunch of code that someone who worked here previously wrote. Right now I am trying to figure out this one function that I'll paste below:
Code:
void InitCustomNode(void *custom)
{
//Called only once when the plugin is first initialized
//The text between the quotations gets printed in vizard's output
strcpy(((VizCustomNodeObj*)custom)->version,"BMLNetWalker v2.0 (WinSock2)");
//You can set the size of the data field to any value.
//After this function is called, Vizard will allocate the
//data field of the plugin to the size given here. Then you
//can put any values you want in the data field and the user
//can get those values by calling the "get" command on the custom
//child object in the script
((VizCustomNodeObj*)custom)->dataSize = 1;
//Return whether the plugin initialized successfully
((VizCustomNodeObj*)custom)->status = 1;
}
I'm particularly interested in trying to put stuff in the data field like it says above but I have no idea how to do that...Can anyone tell me what the "->" does? VizCustomNodeObj* is in a header file that looks like this:
Code:
#include <osg/Node>
#define MAX_CUSTOM_NODE_NAME 32
#define MAX_CUSTOM_NODE_MESSAGE 100
#define MAX_CUSTOM_NODE_DATA 3
typedef void (CUSTOMNODE_PROC)(void *);
typedef struct VizCustomNodeObj {
char name[MAX_CUSTOM_NODE_NAME];
char version[MAX_CUSTOM_NODE_NAME];
char status;
short user[MAX_CUSTOM_NODE_DATA];
int command;
char mesg[MAX_CUSTOM_NODE_MESSAGE];
float x, y, z, w;
float *data;
int dataSize;
osg::ref_ptr<osg::Node> node;
CUSTOMNODE_PROC *initProc;
CUSTOMNODE_PROC *addProc;
CUSTOMNODE_PROC *closeProc;
CUSTOMNODE_PROC *commandProc;
} VizCustomNodeObj;
So I'm pretty lost with this whole thing, if anyone can point me somewhere in the right direction I'd really appreciate it. Thanks!