SetVertex

Category: Objects / Vertices
Since engine version: 4.6.5.0 CP (extended in 4.9.5.0 CE)

Description

Sets the offset coordinates of a given object vertex (seeDefCore.txt). Coordinates are relative to the object center.

Syntax

int SetVertex (int iIndex, int iValueToSet, int iValue, object pObj, int iSetCustomPermanent);

Parameters

iIndex:
Index of the vertex to be changed.
iValueToSet:
Determines which vertex data is to be changed. 0=VTX_X, 1=VTX_Y, 2=VTX_CNAT, 3=VTX_Friction. Extended since CE.
iValue:
Coordinate value to be set.
pObj:
[opt] Object the vertices of which you want to change. Can be 0 in local calls.
iSetCustomPermanent:
[opt] Special vertex mode. If 1 or 2 the new value will be stored in the last 25 vertices and copied from there during the next shape update. Using this parameter, script changed vertices will be kept during stretch or rotation operations. With value 2, vertices will be updated immediately, not only with the next shape update. Since CE.

Remark

Notice: with any vertex updated caused by stretching or rotation of the object (e.g. building or growth) the vertices will be reset to their original defined position unless a special vertex mode is selected using the iSetCustomPermanent parameter.
See also: AddVertex, GetVertex, GetVertexNum, RemoveVertex
jwk, August 2002
Sven2, Juni 2004