Documentation ¶
Index ¶
- type Chandelier
- func (c *Chandelier) BodyAnchor() sprec.Vec3
- func (c *Chandelier) Fixture() sprec.Vec3
- func (c *Chandelier) Length() float32
- func (c *Chandelier) SetBodyAnchor(anchor sprec.Vec3) *Chandelier
- func (c *Chandelier) SetFixture(fixture sprec.Vec3) *Chandelier
- func (c *Chandelier) SetLength(length float32) *Chandelier
- type Coilover
- type FixedTranslation
- type HingedRod
- func (r *HingedRod) Length() float32
- func (r *HingedRod) PrimaryAnchor() sprec.Vec3
- func (r *HingedRod) SecondaryAnchor() sprec.Vec3
- func (r *HingedRod) SetLength(length float32) *HingedRod
- func (r *HingedRod) SetPrimaryAnchor(anchor sprec.Vec3) *HingedRod
- func (r *HingedRod) SetSecondaryAnchor(anchor sprec.Vec3) *HingedRod
- type LimitTranslation
- type MatchAxis
- type MatchRotation
- type MatchTranslation
- func (t *MatchTranslation) IgnoreX() bool
- func (t *MatchTranslation) IgnoreY() bool
- func (t *MatchTranslation) IgnoreZ() bool
- func (t *MatchTranslation) PrimaryAnchor() sprec.Vec3
- func (t *MatchTranslation) SetIgnoreX(ignore bool) *MatchTranslation
- func (t *MatchTranslation) SetIgnoreY(ignore bool) *MatchTranslation
- func (t *MatchTranslation) SetIgnoreZ(ignore bool) *MatchTranslation
- func (t *MatchTranslation) SetPrimaryAnchor(anchor sprec.Vec3) *MatchTranslation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chandelier ¶
type Chandelier struct { *physics.SBJacobianConstraintSolver // contains filtered or unexported fields }
Chandelier represents the solution for a constraint that keeps a body hanging off of a fixture location similar to a chandelier.
func NewChandelier ¶
func NewChandelier() *Chandelier
NewChandelier creates a new Chandelier constraint solver.
func (*Chandelier) BodyAnchor ¶
func (c *Chandelier) BodyAnchor() sprec.Vec3
BodyAnchor returns the offset from the center of mass of the body that it is wired to the chandelier.
func (*Chandelier) Fixture ¶
func (c *Chandelier) Fixture() sprec.Vec3
Fixture returns the fixture location for the chandelier hook.
func (*Chandelier) Length ¶
func (c *Chandelier) Length() float32
Length returns the chandelier length.
func (*Chandelier) SetBodyAnchor ¶
func (c *Chandelier) SetBodyAnchor(anchor sprec.Vec3) *Chandelier
SetBodyAnchor changes the offset at which the body is attached to the chandelier wiring.
func (*Chandelier) SetFixture ¶
func (c *Chandelier) SetFixture(fixture sprec.Vec3) *Chandelier
SetFixture changes the fixture location for the chandelier hook.
func (*Chandelier) SetLength ¶
func (c *Chandelier) SetLength(length float32) *Chandelier
SetLength changes the chandelier length.
type Coilover ¶
type Coilover struct { physics.NilDBConstraintSolver PrimaryAnchor sprec.Vec3 FrequencyHz float32 DampingRatio float32 // contains filtered or unexported fields }
func (*Coilover) CalculateImpulses ¶
func (c *Coilover) CalculateImpulses(ctx physics.DBSolverContext) physics.DBImpulseSolution
func (*Coilover) Reset ¶
func (c *Coilover) Reset(physics.DBSolverContext)
type FixedTranslation ¶
type FixedTranslation struct { *physics.SBJacobianConstraintSolver // contains filtered or unexported fields }
FixedTranslation represents the solution for a constraint that keeps a body positioned at the specified fixture location.
func NewFixedTranslation ¶
func NewFixedTranslation() *FixedTranslation
NewFixedTranslation creates a new FixedTranslation constraint solver.
func (*FixedTranslation) Fixture ¶
func (t *FixedTranslation) Fixture() sprec.Vec3
Fixture returns the location that the body will be tied to.
func (*FixedTranslation) SetFixture ¶
func (t *FixedTranslation) SetFixture(fixture sprec.Vec3) *FixedTranslation
SetFixture changes the location to which the body will be constrained.
type HingedRod ¶
type HingedRod struct { *physics.DBJacobianConstraintSolver // contains filtered or unexported fields }
HingedRod represents the solution for a constraint that keeps two bodies tied together with a hard link of specific length.
func NewHingedRod ¶
func NewHingedRod() *HingedRod
NewHingedRod creates a new HingedRod constraint solution.
func (*HingedRod) PrimaryAnchor ¶
PrimaryAnchor returns the attachment point of the link on the primary body.
func (*HingedRod) SecondaryAnchor ¶
SecondaryAnchor returns the attachment point of the link on the secondary body.
func (*HingedRod) SetPrimaryAnchor ¶
SetPrimaryAnchor changes the attachment point of the link on the primary body.
type LimitTranslation ¶
type LimitTranslation struct { physics.NilDBConstraintSolver MinY float32 MaxY float32 }
func (*LimitTranslation) CalculateImpulses ¶
func (t *LimitTranslation) CalculateImpulses(ctx physics.DBSolverContext) physics.DBImpulseSolution
type MatchAxis ¶
type MatchAxis struct { *physics.DBJacobianConstraintSolver // contains filtered or unexported fields }
MatchAxis represents the solution for a constraint that keeps the axis of two bodies pointing in the same direction.
func NewMatchAxis ¶
func NewMatchAxis() *MatchAxis
NewMatchAxis creates a new MatchAxis constraint solver.
func (*MatchAxis) PrimaryAxis ¶
PrimaryAxis returns the axis of the primary body that will be used in the alignment.
func (*MatchAxis) SecondaryAxis ¶
SecondaryAxis returns the axis of the secondary body that will be used in the alignment.
func (*MatchAxis) SetPrimaryAxis ¶
SetPrimaryAxis changes the axis of the primary body to be used in alignments.
type MatchRotation ¶
type MatchRotation struct {
// contains filtered or unexported fields
}
NewMatchRotation represents the solution for a constraint that keeps two bodies oriented in the same direction on all axis.
func NewMatchRotation ¶
func NewMatchRotation() *MatchRotation
NewMatchRotation creates a new MatchRotation constraint solver.
func (*MatchRotation) CalculateImpulses ¶
func (r *MatchRotation) CalculateImpulses(ctx physics.DBSolverContext) physics.DBImpulseSolution
func (*MatchRotation) CalculateNudges ¶
func (r *MatchRotation) CalculateNudges(ctx physics.DBSolverContext) physics.DBNudgeSolution
func (*MatchRotation) Reset ¶
func (r *MatchRotation) Reset(ctx physics.DBSolverContext)
type MatchTranslation ¶
type MatchTranslation struct { *physics.DBJacobianConstraintSolver // contains filtered or unexported fields }
MatchTranslation represents the solution for a constraint that keeps a secondary body attached to an offset of the primary body. It is possible to disable the constraint for certain axis of the primary body.
func NewMatchTranslation ¶
func NewMatchTranslation() *MatchTranslation
NewMatchTranslation creates a new MatchTranslation constraint solver.
func (*MatchTranslation) IgnoreX ¶
func (t *MatchTranslation) IgnoreX() bool
IgnoreX returns whether the X dimension, relative to the primary body, will be matched.
func (*MatchTranslation) IgnoreY ¶
func (t *MatchTranslation) IgnoreY() bool
IgnoreY returns whether the Y dimension, relative to the primary body, will be matched.
func (*MatchTranslation) IgnoreZ ¶
func (t *MatchTranslation) IgnoreZ() bool
IgnoreZ returns whether the Z dimension, relative to the primary body, will be matched.
func (*MatchTranslation) PrimaryAnchor ¶
func (t *MatchTranslation) PrimaryAnchor() sprec.Vec3
PrimaryAnchor returns the attachment point on the primary body to which the secondary will match.
func (*MatchTranslation) SetIgnoreX ¶
func (t *MatchTranslation) SetIgnoreX(ignore bool) *MatchTranslation
SetIgnoreX changes whether the X dimension, relative to the primary body, will be considered.
func (*MatchTranslation) SetIgnoreY ¶
func (t *MatchTranslation) SetIgnoreY(ignore bool) *MatchTranslation
SetIgnoreY changes whether the Y dimension, relative to the primary body, will be considered.
func (*MatchTranslation) SetIgnoreZ ¶
func (t *MatchTranslation) SetIgnoreZ(ignore bool) *MatchTranslation
SetIgnoreZ changes whether the Z dimension, relative to the primary body, will be considered.
func (*MatchTranslation) SetPrimaryAnchor ¶
func (t *MatchTranslation) SetPrimaryAnchor(anchor sprec.Vec3) *MatchTranslation
SetPrimaryAnchor changes the attachment point on the primary body.