Here is the send message function. Maybe what I am asking is how do I get the mouse event data from the various parameters passed into SendMessage? I read the API and it says the parameter block will contain parameters passed, but params is always null:
bool TerraBehavePlayer::SendMessage (csStringID msg_id,
iCelPropertyClass* pc,
celData& ret, iCelParameterBlock* params,
va_list arg)
{
GetActorMove ();
if(params)
TerraDebug::terraDebugf("Got %d! parameters!\n", params->GetParameterCount());
if (msg_id == id_pccommandinput_forward1)
pcactormove->Forward (true);
else if (msg_id == id_pccommandinput_forward0)
pcactormove->Forward (false);
else if (msg_id == id_pccommandinput_backward1)
pcactormove->Backward (true);
else if (msg_id == id_pccommandinput_backward0)
pcactormove->Backward (false);
else if (msg_id == id_pccommandinput_rotateleft1)
pcactormove->RotateLeft (true);
else if (msg_id == id_pccommandinput_rotateleft0)
pcactormove->RotateLeft (false);
else if (msg_id == id_pccommandinput_rotateright1)
pcactormove->RotateRight (true);
else if (msg_id == id_pccommandinput_rotateright0)
pcactormove->RotateRight (false);
else if (msg_id == id_pccommandinput_strafeleft0)
pcactormove->StrafeLeft (false);
else if (msg_id == id_pccommandinput_straferight0)
pcactormove->StrafeRight (false);
else if (msg_id == id_pccommandinput_strafeleft1)
pcactormove->StrafeLeft (true);
else if (msg_id == id_pccommandinput_straferight1)
pcactormove->StrafeRight (true);
else if (msg_id == id_pccommandinput_run0)
pcactormove->Run (false);
else if (msg_id == id_pccommandinput_run1)
pcactormove->Run (true);
else if (msg_id == id_pccommandinput_jump1)
pcactormove->Jump();
else if (msg_id == id_pccommandinput_cammode1)
pcactormove->ToggleCameraMode ();
else if (msg_id == id_pccommandinput_yaw)
{
TerraDebug::terraDebug("Mouse movement x...");
}
else if (msg_id == id_pccommandinput_pitch)
{
TerraDebug::terraDebug("Mouse movement y...");
}
else {
TerraDebug::terraDebugf("%d\n", msg_id);
return TerraBehaveCommon::SendMessage (msg_id, pc, ret, params, arg);;
}
return true;
}
Thanks.