Skip to main content
Skip to main content

shallowWaterSimulationPaintCustomObstacleEllipse

shallowWaterSimulationPaintCustomObstacleEllipse

Description

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

Definition

shallowWaterSimulationPaintCustomObstacleEllipse(entityId shallowWaterSimulation, integer obstacleIndex, float x, float z, float width, float height, float angle, float velocityX, float velocityZ, float yPosition)

Arguments

entityIdshallowWaterSimulationid of the shallow water simulation
integerobstacleIndexindex of the obstacle, starting at 0
floatxx position of the ellipse center (world coordinates)
floatzz position of the ellipse center (world coordinates)
floatwidthwidth (x scale) of the ellipse. will become either major or minor axis of the ellipse depending on which is larger between this and the other size.
floatheightheight (z scale) of the ellipse. will become either major or minor axis of the ellipse depending on which is larger between this and the other size.
floatanglerotation angle of the ellipse (counter clock wise, in radians).
floatvelocityXx velocity component of the obstacle (0 for a static, non-moving obstacle)
floatvelocityZz 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.