# rmp::behavior::Orbit

> Circles a handle or a point: a shield of blades, a moon, a fairy.

Source: https://omardev29.github.io/rmp-docs/reference/behaviors/Orbit.html

behavior `#include <rmp/behavior.h>` [include/rmp/behavior.h:917](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/behavior.h#L917-L932)

struct Orbit

Circles a handle or a point: a shield of blades, a moon, a fairy. Several on one centre spread around it evenly with `index` and `of`.

From the editor: "radius" (Float), "speed" (Float, degrees_per_second), "angle" (Float).

Added to an object with `add<rmp::behavior::Orbit>()`; the framework calls its `_late_update` with the object it is on.

## Fields

| Field | Type | Default | What it is |
|---|---|---|---|
| `centre` | `Handle<Object>` |  | What it circles, while it is there |
| `point` | `Vector2` | `{}` | What it circles without a centre |
| `radius` | `float` | `48` | Units from the centre |
| `degrees_per_second` | `float` | `90` | Negative turns the other way |
| `angle` | `float` | `0` | Degrees, where it is now; it is where it starts too |
| `face` | `Face` | `Face::NONE` | Which way it turns its object as it goes round |
| `index` | `int` | `0` | This one's place among `of` on the same centre |
| `of` | `int` | `1` | How many share the centre, spread evenly |

### `from`

static Orbit from(const MapObject &object)

static function [include/rmp/behavior.h:929](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/include/rmp/behavior.h#L929)

A Orbit with the fields the map's entity has by these names — radius, speed, angle — and the defaults for the rest. See "FROM THE EDITOR" at the top of this file.
