Unit phxShape

DescriptionUsesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

Convex shapes and collision testing

Uses the separating Axis Theorem (SAT) for testing for collisions

Overview

Classes, Interfaces, Objects and Records

Name Description
record TPHXShapeHeader The shape file header.
Class TPHXShape Abstract shape class
Class TPHXPoint A point shape
Class TPHXBox Box shape
Class TPHXPolygon Convex polygon shape
Class TPHXLine Line shape
Class TPHXCircle Circle shape
Class TPHXShapeList List of shapes

Functions and Procedures

function CreateShape(Kind: TPHXShapeKind): TPHXShape;
function LoadShape(const FileName: String): TPHXShape; overload;
function LoadShape(Stream: TStream): TPHXShape; overload;

Types

TPHXShapeKind = (...);
PShapeList = ˆTShapeList;
TShapeList = array[0..$00FFFFFF] of TPHXShape;

Constants

PHXSHAPE_EXT = '.phxshp';
PHXSHAPE_VERSION = 6;
PHXSHAPE_CONTACT_THRESHOLD = 1.0E-3;

Description

Functions and Procedures

function CreateShape(Kind: TPHXShapeKind): TPHXShape;

Create the shape fir a kind

function LoadShape(const FileName: String): TPHXShape; overload;

Create and load a shape from a file

function LoadShape(Stream: TStream): TPHXShape; overload;

Create and load a shape from a stream

Types

TPHXShapeKind = (...);

The supported shape types

Values
  • PHX_SHAPE_POINT: Point shape
  • PHX_SHAPE_BOX: Box shape
  • PHX_SHAPE_POLYGON: Convex polygon shape
  • PHX_SHAPE_CIRCLE: Circle shape
  • PHX_SHAPE_LINE: Line shape
PShapeList = ˆTShapeList;
 
TShapeList = array[0..$00FFFFFF] of TPHXShape;
 

Constants

PHXSHAPE_EXT = '.phxshp';

File extension for the shape files

PHXSHAPE_VERSION = 6;

Version

PHXSHAPE_CONTACT_THRESHOLD = 1.0E-3;

Constant determining if two contacts are parallel to the current axis


Generated by PasDoc 0.13.0 on 2013-08-26 11:02:42