sm.physics.sphereHasContact
Returns true if any collision object is found inside the given sphere.
Kind: Function
Environments: Game
Game
sm.physics.sphereHasContact(
worldPosition,
radius,
includeTerrain,
countWater,
mask
)
Faster than sphereContactCount when only checking for existence.
Parameters:
| Name | Type | Description |
|---|---|---|
worldPosition |
Vec3 | The world position of the sphere. |
radius |
number | The radius of the sphere. |
includeTerrain (optional) |
boolean | True if terrain should be included in the test (Defaults to false) |
countWater (optional) |
boolean | True if water should be included (Defaults to false) |
mask (optional) |
integer | The collision mask. Defaults to sm.physics.filter.default. Using this will override "includeTerrain" and "countWater". (Optional) |
Returns:
| Type | Description |
|---|---|
| boolean | True if any contact was found. |