Game Development Community

Help Placing Motion Simulator Code

by Mark Barry · in Torque Game Engine · 09/16/2003 (11:18 pm) · 2 replies

I'm using the TGE for a motion simulator project and need some advice...

I have a few lines of C++ Winsock code that I have used on other simulator projects that sends a few packets of telemetry data (pitch, roll, yaw, etc) through the UDP port. I then have another application reading that port constantly and then takes that data and sends it to our motion controllers to move a motion simulator. My question is, where would be the best place to put that Winsock code in TGE? In the engine or in a script? I'm assuming the engine would be the best place, but then where? I need to constantly send out the data at a rate of at least 30 Hz (or about 30 ms).

Thanks,
Mark Barry

#1
09/17/2003 (5:17 am)
You're in luck; Torque's internal simulation runs at 32Hz. I would suggest looking in the class whose motion you want to track and in that object's processTick (or maybe updateForces), add the code to send UDP packets. Torque already has networking code, so you might try to use that and make your app crossplatform. :)

Be sure to add a way to toggle updates from the object, so that you can choose the right one. I would suggest doing this via a ConsoleMethod.
#2
09/17/2003 (7:47 am)
Hi Ben,

Thanks for the reply and information. I'll research your advice more.

Thanks,
Mark Barry