‹›
Cloth

Grid and Coordinates

Grid indices identify particles; getters return their current world-space state.

Grid indices identify particles; getters return their current world-space state.

QuantityValue
Points per rowsegments_x + 1
Rowssegments_y + 1
Particles(segments_x + 1) * (segments_y + 1)
Triangles2 * segments_x * segments_y
GML
var position = cloth.get_point_position(0, 0);
var velocity = cloth.get_point_velocity(0, 0);

Indices range inclusively from 0 to segments_x/y. Point (0,0) starts at local (-width/2,+height/2,0), with UV (0,0). The bottom-right corner has UV (1,1). Read after physics updates; do not apply the creation transform again.

BBMOD rendering uses packed particle snapshots. Avoid thousands of individual getters for rendering. Imported cloth models use vertex indices and spatial/named attachments instead of rectangular grid coordinates.

Verified operation contracts#

These contracts distinguish units, return values, errors and lifetime according to the current implementation. Check results: false, 0 and undefined can mean different things for different methods.

Symbol / ownerSignatureOperation contract
JoltBBMODCloth.get_point_positionJoltBBMODCloth.get_point_position(x,y)Integer grid point including boundaries. World {x, y, z}, position in m / velocity in m/s; undefined for invalid point/wrapper. Inspect native errors separately.
JoltBBMODCloth.get_point_velocityJoltBBMODCloth.get_point_velocity(x,y)Integer grid point including boundaries. World {x, y, z}, position in m / velocity in m/s; undefined for invalid point/wrapper. Inspect native errors separately.