MCPcopy
hub / github.com/g3n/engine / AttractorForceField

Struct AttractorForceField

experimental/physics/forcefield.go:53–56  ·  view source on GitHub ↗

AttractorForceField is a force field where all forces point to a single point. The force strength changes with the inverse distance squared. This can be used to model planetary attractions.

Source from the content-addressed store, hash-verified

51// This can be used to model planetary attractions.
52//
53type AttractorForceField struct {
54 position math32.Vector3
55 mass float32
56}
57
58// NewAttractorForceField creates and returns a pointer to a new AttractorForceField.
59func NewAttractorForceField(position *math32.Vector3, mass float32) *AttractorForceField {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected