Gravity Field

A global gravity field for the whole scene is defined with keyword gravitys in a Scene. Possible values:

NoGravityField

UniformGravityField

Modia3D.Composition.UniformGravityFieldType
UniformGravityField(; g = 9.81,
                      n = [0,-1,0])

Generate an instance of type UniformGravityField that defines a uniform gravity field with gravitational acceleration g in direction n. The default value is a gravity of 9.81 m/s^2 in negative direction of the y-axis of the root (world) Object3D.

Arguments

  • g::Float64: Gravitational acceleration in m/s^2.
  • n::AbstractVector: Direction of gravitational acceleration

Example

using Modia3D

grav = UniformGravityField()
   r = Modia3D.EarthRadius
   g = gravityAcceleration(grav,r)  # g is independent of r
source

PointGravityField

Modia3D.Composition.PointGravityFieldType
PointGravityField([mass|; mue = G*EarthMass])

Generate an instance of type PointGravityField that defines a point gravity field of mass or gravity field constant mue. The gravity center is located at the world origin, i.e. the gravitational acceleration decreases quadratically with distance from world.

Example

using Modia3D

grav = PointGravityField()   # Gravity field of earth
   r = Modia3D.EarthRadius
   g = gravityAcceleration(grav,r)  # g is a function of r.
source