Regular API function

simModifyGhost

Description Modifies or removes a ghost object previously added with simAddGhost.
C synopsis simInt simModifyGhost(simInt ghostGroup,simInt ghostId,simInt operation,simFloat floatValue,simInt options,simInt optionsMask,const simFloat* colorOrTransformation)
C parameters
ghostGroup: an identifier that allows, together with ghostId, identifying which ghosts to modify.
ghostId: an identifier that allows, together with ghostGroup, identifying which ghosts to modify. If -1, then all ghosts that match ghostGroup will be modified.
operation: a value indicating the operation to perform:
0: no operation is performed, and the return value indicates the number of ghosts that match the identifiers.
1: removes the specified ghosts. The return value indicates the number of removed ghosts.
2: sets the start time (via floatValue) of the specified ghosts. The return value indicates the number of modified ghosts.
3: sets the end time (via floatValue) of the specified ghosts. The return value indicates the number of modified ghosts.
4: shifts the start time (via floatValue) of the specified ghosts. The return value indicates the number of modified ghosts.
5: shifts the end time (via floatValue) of the specified ghosts. The return value indicates the number of modified ghosts.
6: shifts the start and end times (via floatValue) of the specified ghosts. The return value indicates the number of modified ghosts.
7: scales the start time (via floatValue) of the specified ghosts. The return value indicates the number of modified ghosts.
8: scales the end time (via floatValue) of the specified ghosts. The return value indicates the number of modified ghosts.
9: scales the start and end times (via floatValue) of the specified ghosts. The return value indicates the number of modified ghosts.
10: modifies the attributes (via options and optionsMask) of the specified ghosts. The return value indicates the number of modified ghosts.
11: pre-multiplies (via colorOrTransformation) the transformations of the specified ghosts. The return value indicates the number of modified ghosts.
12: post-multiplies (via colorOrTransformation) the transformations of the specified ghosts. The return value indicates the number of modified ghosts.
13: modifies (via colorOrTransformation) the color of the specified ghosts. The return value indicates the number of modified ghosts.
14: sets the transparency factor (via floatValue) of the specified ghosts. Only ghosts with custom colors will be influenced. The return value indicates the number of modified ghosts.
floatValue: a floating point value that is used to modify the specified ghosts. See operation here above.
options: the attributes used to modify the specified ghosts (see operation here above). Attributes are bit-coded:
bit0 reserved
bit1 set (2)=the provided start- and end-times will be played-back in real-time
bit2 set (4)=preserve the original colors
bit3 reserved
bit4 set (16)=create an invisible ghost
bit5 set (32)=backface culling for the ghost (only when using custom colors)
optionsMask: a mask allowing to select options to set.
colorOrTransformation: a pointer to 7 or 12 float values: when operation is 11 or 12, 7 values indicating a transformation should be provided (x,y,z,qx,qy,qz,qw). when operation is 13, 12 values indicating a color should be provided (ambient_diffuse RGB, 3 reserved values (set to zero), specular RGB and emissive RGB). Can be NULL when operation is different from 11, 12 or 13.
C return value
-1 if operation was not successful, otherwise a value depending on the operation performed.
Lua synopsis number result=simModifyGhost(number ghostGroup,number ghostId,number operation,number floatValue,number options=nil,number optionsMask=nil,table colorOrTransformation=nil)
Lua parameters
Same as C-function
Lua return values
Same as C-function

All regular API functions on one page