Polyart 2D Physics Engine

Section 1: The Interface


Location: programming\c++\cvs\polylib
Files: Sim2D.cpp -
Body2D.cpp -
Geometry2D.cpp -
Contact2D.cpp -
CheckSegmentCollision2D.cpp -
Status: Design, Partial Implementation
Todo Checklist
Algorithms Also see Shipgame specific Physics
Physics Documentation Index



What does this physics engine do?




Generic collision detection and response

The engine is implemented as a hierarchy of collision detection types and responses. Since bodies have a bounding box which is tested for collision before the internal segments, a detector could detect bounding box collisions then respond with a new detector detecting the segment collisions.

Collision detection is handled similarly regardless of object type. Similarly meaning having the same function names to perform the same operations. The classes might not be derived from each other. It is implemented as 3 classes.

Object Type: The type of object to detect collisions Detection : This class will hold Objects. A CollideWith(Object) function will enumerate all collisions with the object and call the response class for each. Response : Derive a response class from this to handle the detected collisions in different ways General Detection Procedure
  1. Add all collidable objects to a collider
  2. Derive a class from the response class. Set the response type to that class.
  3. Call collide with on an object. All collisions with that object will be enumerated though the response class.

User Classes

Goals of the physics engine

Usage

Physics classes

CSim2D

CBodySet2D

CBody2D

Copyright 2004 © Polyart. All rights reserved.
Designed by Kenneth Manta