Skip to content

Object (.cs)

Ludicrous edited this page Aug 9, 2022 · 3 revisions

The Object class is the main class that implements objects moving through curved spacetime.

image

All objects can either follow time-like paths or light-like paths. (Moving through space with dS²/dt < 0 is illegal and can break causality. Enable such paradoxes at your own risk in a Spacetime component.)

All Object components contain the following fields and methods available:

  • spacetimeVel (Vector4) => Coordinate 4-velocity
  • spacetimeAcc (Vector4) => Coordinate 4-acceleration
  • spaceTimePos (Vector4) => Coordinate 4-position
  • properTime (float) => The proper time experienced by the object
  • properTimeStep (float) => The simulation timestep in terms of proper time
  • lightlike (bool) => Force trajectory to be lightlike
  • properTimeClock (float 0-2) => The internal clock of every particle (ticks every 2 proper time units)

Heavier fields. Call and request less frequently for best performance:

  • worldLine (WorldLine) => The history of this object's position and velocity

  • currentSpace (Metric) => The local spacetime metric where this object is inhabiting

  • localChristoffel (ChristoffelSymbols) => The local spacetime coordinate Christoffel Symbols where this object is inhabiting

  • CurrFrame (Tetrad) => The local tetrad frame of this object. Used to convert between coordinate vectors and local minkowskian vectors.

  • ProperTimeTick() (>void) => What should be done per 2 proper time units.

  • GetCurvatureAround() (>RicciTensors) => Calculate the local spatio-temporal curvature of the space inhabited by this object.

  • Instantiate(Object a, Vector4 spacetimePos, Vector4 spacetimeVel, Quaternion rotation) (>void) => Instantiates an object with spacetime-coordinate position spacetimePos, cartesian 4-velocity spacetimeVel and rotation rotation.

Methods that must call base.InsertMethodName() when overriding.

  • Start() (>void) => Initialises the properties of objects. Call before anything else.
  • Update() (>void) => Iterates and calculates the path of objects. Must be called before anything else.