Class TSpecialCollisionManager

DescriptionHierarchyFieldsMethodsProperties

Unit

Collisions

Declaration

type TSpecialCollisionManager = class(TUMCollisionManager)

Description

A collision manager used for simplified 2D collision detection in the XY-plane. This collision manager is the only one currently in use by TRobotSimulation and uses a 2D slice of the arena for intersection testing between arena objects and the robot's body (see TRobotSimulation.SetupCollisionManager).

Hierarchy

TSpecialCollisionManager > TUMCollisionManager > TObject

Methods

Overview

Public constructor Create;
Public destructor Destroy; override;
Public procedure AddSlice(List: TSliceList);
Public procedure SetRobotShape(Shape: TShape);
Public function TestCollisions: Boolean; override;

Description

Public constructor Create;

Constructor

Public destructor Destroy; override;

Destructor

Public procedure AddSlice(List: TSliceList);

Adds an owned slice of the arena. See also TArena.GetSliceAtHeight. Note that the computational complexity increases with each added slice of the arena. Try to use a few slices as possible. In TRobotSimulation.SetupCollisionManager a single arena slice is added by default (taken at half the height of the robot's body).

Public procedure SetRobotShape(Shape: TShape);

Sets a reference to the collision shape of the robot (the use of multiple robots is not supported). The parameter Shape is not considered to be owned by TSpecialCollisionManager and it is the user's responsibility to free the memory allocated by Shape.

parameters
Shape
is the robot's collision geometry (see TBody.CollisionGeometry).
Public function TestCollisions: Boolean; override;

Test for collisions (intersections). See also TRobotSimulation.CheckForCollisions.

returns

True if there is an intersection between the lines in arena slice(s) and the shape of the robot. Otherwise False is returned.


Generated by PasDoc 0.8.8.3 on 2005-05-28 08:13:49