![]() |
![]() ![]() |
get or set a floating-point array
int GDget_newfloat_array ( parent_id , elem_name , seq, int * size , float ** array );
int GDget_updfloat_array ( parent_id , elem_name , seq, int * size , float ** array );
void GDset_float_array ( parent_id , elem_name , int size , float * array );
OMobj_id parent_id ;
char * elem_name ;
int * seq ;
GDget_float_array gets a floating-point array and places the array's elements into array . The return value is 1 if successful, 0 if a failure.
GDget_newfloat_array gets a floating-point array, placing the array's elements into array . The routine also returns the array's updated sequence number. The return value is 1 if the data has changed, 0 if it has not.
GDget_updfloat_array gets a floating-point array, placing the array's elements into array . The return value is 1 if the data has changed, 0 if it has not.
GDset_float_array sets a floating-point array.
The id of the target subobject's parent.
The name of the target subobject.
In the GDget_xxxx routines, an output argument set to the number of values in the array.
In GDset_float_array, an input argument indicating the number of values in the array.
(GDget_newfloat_array only) An input/output argument. It is used to compare against the array's current sequence number to determine if the array has changed. It is then updated with the current sequence number.
(GDget_updfloat_array only) An input argument. It is used to compare against the array's current sequence number to determine if the array has changed.
In the GDget_xxxx routines, a pointer to the address where the routine places the array.
In GDset_float_array, the address of the source array.
/* Get, then set, the value of a camera's from subobject*/
OMobj_id mycamera_id; /* Assume this has been set. */
int size
float from[3];
int status;
...
status = GDget_float_array(mycamera_id, "from", &size, &from);
if (status == 0) {
printf("Error getting the camera's from subobject\n");
return(1);
};
/* Modify the array, then set the object. */
from[2] *= 1.1;
GDset_float_array(mycamera_id, "from", size, from);
![]() |
![]() ![]() |