Regular API function

simSetShapeTexture / sim.setShapeTexture

Description Applies (or removes) a texture to a shape. See also sim.getTextureId, sim.getShapeTextureId, sim.createTexture and simApplyTexture.
C synopsis simInt simSetShapeTexture(simInt shapeHandle,simInt textureId,simInt mappingMode,simInt options,const simFloat* uvScaling,const simFloat* position,const simFloat* orientation
C parameters
shapeHandle: the handle of the shape.
textureId: the ID of the texture or -1 to remove any existing texture. See also simGetTextureId, simGetShapeTextureId and simCreateTexture.
mappingMode: the texture mapping mode.
options: bit-coded:
bit0: if set (1), then adjacent texture pixels are not interpolated.
bit1: if set (2), then the texture is applied as a decal (its appearance won't be influenced by light conditions).
bit2: if set (4), then the texture will be repeated along the U direction.
bit3: if set (8), then the texture will be repeated along the V direction.
uvScaling: a pointer to 2 values that indicate the texture scaling factors along the U and V directions.
position: a pointer to 3 values (x,y,z) that indicate the texture position on the shape. Can be nullptr for default values.
orientation: a pointer to 3 values (Euler angles) that indicate the texture orientation on the shape. Can be nullptr for default values.
C return value
-1 in case of an error.
Lua synopsis sim.setShapeTexture(int shapeHandle,int textureId,int mappingMode,int options,table[2] uvScaling,table[3] position=nil,table[3] orientation=nil)
Lua parameters
Similar to the C-function counterpart
Lua return values
none