Gravity Field
A global gravity field for the whole scene is defined with keyword gravity
s in a Scene. Possible values:
NoGravityField
Modia3D.Composition.NoGravityField
— TypegravityField = NoGravityField()
Generate an instance of type NoGravityField
that defines no gravity.
UniformGravityField
Modia3D.Composition.UniformGravityField
— TypeUniformGravityField(; 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
PointGravityField
Modia3D.Composition.PointGravityField
— TypePointGravityField([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.