Skip to main content
Skip to main content

shallowWaterSimulationPaintCustomObstacle

shallowWaterSimulationPaintCustomObstacle

Description

Paints a custom solid obstacle in the shape of a rotated rectangle into the simulation. You have to set the number of active obstacles with shallowWaterSimulationSetNumCustomObstacles first.

Definition

shallowWaterSimulationPaintCustomObstacle(entityId shallowWaterSimulation, integer obstacleIndex, float x, float z, float width, float height, float angle, float velocityX, float velocityY, float yPosition)

Arguments

entityIdshallowWaterSimulationid of the shallow water simulation
integerobstacleIndexindex of the obstacle, starting at 0
floatxx position of the rectangle center (world coordinates)
floatzz position of the rectangle center (world coordinates)
floatwidthwidth (x scale) of the rectangle (world size)
floatheightheight (z scale) of the rectangle (world size)
floatanglerotation angle of the rectangle (counter clock wise, in radians).
floatvelocityXx velocity component of the obstacle (0 for a static, non-moving obstacle)
floatvelocityYz velocity component of the obstacle (0 for a static, non-moving obstacle)
floatyPositiony position of the obstacle in world coords (where the obstacle begins, not necessarily the center of whatever object you use to represent the obstacle. in the simulation the obstacle is two dimensional). makes it so the obstacle only applies when it touches below the water surface. so for a wavey surface, waves can flow under the obstacle if they go low enough.