HoverSim Design

From Hovercraft

(Difference between revisions)
Line 21: Line 21:
* recalcAbsoluteProperties()  
* recalcAbsoluteProperties()  
-
=HoverCraft(CraftComponent)=
+
==HoverCraft(CraftComponent)==
Base class for hovercraft vehicles.
Base class for hovercraft vehicles.
Assumes a circular shape.
Assumes a circular shape.
Line 30: Line 30:
* __init__(weight, radius)
* __init__(weight, radius)
-
=Sensor(CraftComponent)=
+
==Sensor(CraftComponent)==
Base class for sensor components
Base class for sensor components
* read()
* read()
-
=LightSensor(Sensor)=
+
===LightSensor(Sensor)===
Implements a light sensor with the specified range
Implements a light sensor with the specified range
* __init__(range)
* __init__(range)
* read()
* read()
-
=Fan(CraftComponent)=
+
==Fan(CraftComponent)==
* thrust()
* thrust()

Revision as of 14:38, 26 September 2006

Contents

[hide]

Introduction

This design refers to the core classes of the HoverSim API.

CraftComponent

Base class for all craft components.

  • CraftComponent parent

Relative properties

  • Vector2 position
  • float orientation
  • Vector2 velocity

Absolute properties

  • Vector2 absPosition
  • float absOrientation
  • Vector2 absVelocity

Recalculate absolute properties using the parent as a reference

  • recalcAbsoluteProperties()

HoverCraft(CraftComponent)

Base class for hovercraft vehicles. Assumes a circular shape.

  • Vector2 thrust
  • float weight
  • float radius
  • __init__(weight, radius)

Sensor(CraftComponent)

Base class for sensor components

  • read()

LightSensor(Sensor)

Implements a light sensor with the specified range

  • __init__(range)
  • read()

Fan(CraftComponent)

  • thrust()
Personal tools