Basic geometry data structures and services.

Points and Lines

The very basics of geometry needs, for two and three-dimensional space.

Boxes and detection collision

Boxes module introduces Bounding boxes for Points and Lines and services to detect collision or inclusion between boxes. It means a simple and fast way to test collision but not really accurate since it uses bounding boxes.


A QuadTree is a tree data structure in which each internal node has exactly four children They're most often used to partition two-dimensional space by recursively subdividing it into four quadrants or regions.

  • They decompose space into adaptable cells
  • Each cell has a maximum capacity. When maximum is reached, the cell splits.

Quadtrees are using Boxed objects to determine their distribution in the 2D space.

This API provides two different types of Quadtree : Static and Dynamic (respectively SQuadTree and DQuadTree).

  • Static: When you create the QuadTree, you need to specify the region that it will cover

  • Dynamic: You just need to fill the quadtree with objects, and when the threshold is reached, it will automatically divide the current region, depending on the distribution of objects already in the region.


Some basic polygon services.

This module contains interesting algorithms for ConvexPolygononly at the moment. A Convex polygon can be defined as follow :

  • All its interior angles are less than 180°. this means that all the vertices of the polygon will point outwards, away from the interior of the shape.

  • Every point on every line segment between two points inside or on the boundary of the polygon remains inside or on the boundary.

  • The polygon is entirely contained in a closed half-plane defined by each of its edges.

  • For each edge, the interior points are all on the same side of the line that the edge defines.

  • The angle at each vertex contains all other vertices in its edges and interior.

A polygon which is not convex is called concave. Convex polygon are used because most geometric problems are simpler and faster on convex objects than on non-convex ones.

Services provided :

  • Point in convex polygon
  • Intersection of convex polygon
  • Convex hull of a set of points
  • Triangulation of polygon

All groups and modules

module angles

geometry :: angles

Angle related service using Float to represent an angle in radians
module boxes

geometry :: boxes

Provides interfaces and classes to represent basic geometry needs.
module geometry

geometry :: geometry

Provides interfaces and classes to represent basic geometry needs.
module points_and_lines

geometry :: points_and_lines

Interfaces and classes to represent basic geometry needs.
module polygon

geometry :: polygon

Convex Polygons manipulations
module quadtree

geometry :: quadtree

QuadTree API mostly used for 2 dimensional collision detection
package_diagram geometry geometry serialization serialization geometry->serialization pipeline pipeline geometry->pipeline poset poset serialization->poset meta meta serialization->meta json json serialization->json core core pipeline->core ...poset ... ...poset->poset ...meta ... ...meta->meta ...json ... ...json->json ...core ... ...core->core gamnit gamnit gamnit->geometry android android android->gamnit android... ... android...->android


package core


Nit common library of core classes and methods
package json


read and write JSON formatted text
package meta


Simple user-defined meta-level to manipulate types of instances as object.
package parser_base


Simple base for hand-made parsers of all kinds
package poset


Pre order sets and partial order set (ie hierarchies)


package pipeline


Pipelined filters and operations on iterators.
package serialization


Abstract serialization services


package gamnit


Portable game and multimedia framework for Nit


package android


Android platform support and APIs
package app


app.nit, a framework for portable applications
package egl


Interface between rendering APIs (OpenGL, OpenGL ES, etc.) and the native windowing system.
package glesv2


OpenGL graphics rendering library for embedded systems, version 2.0
package ios


iOS support for app.nit
package linux


Implementation of app.nit for the Linux platform