Class

GKSphereObstacle

A spherical impassable volume to be avoided by agents.

Declaration

@interface GKSphereObstacle : GKObstacle

Overview

To make agents (GKAgent objects) avoid obstacles, create a goal with the goalToAvoidObstacles:maxPredictionTime: method. Agents affected by an avoid-obstacles goal will attempt to move such that their radius never overlaps that of a spherical obstacle.

To learn more about using goals and agents, see Agents, Goals, and Behaviors in GameplayKit Programming Guide.

Topics

Creating an Obstacle

- initWithRadius:

Initializes a spherical obstacle with the specified radius.

+ obstacleWithRadius:

Creates a spherical obstacle with the specified radius.

Placing an Obstacle

position

The position of the obstacle.

radius

The radius of the obstacle.

Relationships

Inherits From

See Also

Obstacles

GKObstacle

The abstract base class for objects representing impassable areas in a game world.

GKCircleObstacle

A circular impassable area to be avoided by agents.

GKPolygonObstacle

A polygon-shaped impassable area in a 2D game world.