Skip to content

Spacetime Class

Ludicrous edited this page Aug 9, 2022 · 1 revision

The spacetime class in G.R.M encapsulates all there is to a universe/spacetime.

All custom spacetimes must inherit from Spacetime, and must implement the following methods:

  1. ToCoordSystem(Vector4 spaceTime) => The coordinate transform from unity cartesian coordinates to your desired spacetime coordinates.
  2. ToCoordSystemVelocity(Vector4 spaceTimeVel, Vector4 cartesian) => The coordinate transform from cartesian velocity and position coordinates to your desired spacetime coordinates.
  3. GetMetric(Vector4 spaceTime) => The spacetime metric at a given spacetime coordinate, used to calculate all further properties and forms the foundation of your spacetime - your metre-stick and unit clock.
  4. FromCoordSystem(Vector4 coordSpace) => The coordinate transform to cartesian coordinates from your spacetime coordinates. Includes the temporal component.
  5. FromCoordSystemCart(Vector4 coordSpace) => The coordinate transform to unity cartesian coordinates from your spacetime coordinates.

Spacetimes should override DelPositionCoords(Vector4 del) when using periodic coordinates (implemented to loop all values of a vector to reasonable values, illustrated below). image

Note for all coordinate transformations: All coordinate systems are arbitrary, unity cartesian coordinates are used merely for simplicity and visualisation as Unity relies on cartesian coordinates for rendering.

Important notes:

Methods that when overriden should call base.InsertMethodName():

  • LateUpdate() => Implements pausing functionality.

Recommended settings:

  • banParadoxes = true => Bans all causality paradoxes from happening by enforcing forward time progression, hence not recommended to turn off.
  • tickmark = null => Used mostly for visualising an object's proper time. See here:
  • speedOfLight = 30f => The global speed of light and causality. By convention, 1 time unit = i space units (c == 1) and this merely rescales space for a desired speed of light. Setting this too high results in çürséd newtonian mechanics.
  • timestep = 1f => The global timestep used, inches all objects forward by a specified number of time units forwards in time, except in strange cases such as CTCs in Misner space.
  • paused = false => Whether the simulation is paused or not.