1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
#include "swserv.h"
int NetHandleObjectForcePose(int condescriptor, char *arg)
{
return(0);
}
int NetSendObjectForcePose(int condescriptor, long object_num)
{
char sndbuf[CS_DATA_MAX_LEN];
xsw_object_struct *obj_ptr;
if(DBIsObjectGarbage(object_num))
return(-1);
else
obj_ptr = xsw_object[object_num];
/*
* CS_CODE_FORCEPOSEOBJ format:
*
* object_num,
* type, imageset, size,
* x, y, z,
* heading, pitch, bank,
* velocity,
* velocity_heading, velocity_pitch, velocity_bank,
* current_frame
*/
sprintf(sndbuf,
"%i %ld\
%i %i %ld\
%.4lf %.4lf %.4lf\
%.4lf %.4lf %.4lf\
%.4lf\
%.4lf %.4lf %.4lf\
%i\n",
CS_CODE_FORCEPOSEOBJ,
object_num,
obj_ptr->type,
obj_ptr->imageset,
obj_ptr->size,
obj_ptr->x,
obj_ptr->y,
obj_ptr->z,
obj_ptr->heading,
obj_ptr->pitch,
obj_ptr->bank,
obj_ptr->velocity,
obj_ptr->velocity_heading,
0.0000,
0.0000,
obj_ptr->animation.current_frame
);
NetDoSend(condescriptor, sndbuf);
return(0);
}
|