> For the complete documentation index, see [llms.txt](https://tfg-bravoperezrubio.gitbook.io/cosmicarchitectdocumentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tfg-bravoperezrubio.gitbook.io/cosmicarchitectdocumentation/explanation-of-classes-and-components/gravity.md).

# Gravity

### Gravity Component

Stores information about the gravitational physical interactions that the planet or object has with the environment, and the Gravity Subsystem updates the position and velocity of the planets based on this information. Cosmic Planets do not have this component by default, and it must be added if gravitational interactions are desired.

* **Gravity Mode:**
  * **Nearest Planet:** The body will be attracted by the nearest planet.
  * **Specific Planet:** It will be attracted to a designated body. Checking this option displays a new setting to assign the target object of attraction.
  * **All Planets:** Influence from all planets in the system.
  * **N-body:** Simulation of mutual attraction among multiple bodies.
* **Is Planet:** If True, it calculates gravitational force using the planet's Radius and surface Acceleration. If False, it calculates gravitational force using Mass.
* **Affects Others:** Determina si el objeto ejerce fuerza de gravedad sobre otros.
* **Is Affected by Others:** Determina si el objeto responde a la gravedad externa.

### Orbit Component

Allows adding an orbit to an object. It controls the orbital movement of an object around a reference point.

* **Semi Major Axis (Km):** The semi-major axis of the orbital ellipse.
* **Eccentricity:** The level of deformation of the orbit (0 is circular, higher values stretch the ellipse).
* **Initial Position:** The starting point of the object within its trajectory.
* **Orbital Period:** The time in seconds required to complete one full revolution.
* **Inclination XYZ:** The orientation of the orbital plane across the three spatial axes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://tfg-bravoperezrubio.gitbook.io/cosmicarchitectdocumentation/explanation-of-classes-and-components/gravity.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
