chipmunkPhysics

package
v0.0.0-...-e229e0e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2022 License: GPL-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChipmonkSpace

type ChipmonkSpace struct {
	Space       *chipmunk.Space
	OnCollision func(shapeA, shapeB *chipmunk.Shape)
}

func NewChipmonkSpace

func NewChipmonkSpace() *ChipmonkSpace

func (*ChipmonkSpace) AddBody

func (cSpace *ChipmonkSpace) AddBody(body physicsAPI.PhysicsObject2D)

func (*ChipmonkSpace) GetGravity

func (cSpace *ChipmonkSpace) GetGravity() mgl32.Vec2

func (*ChipmonkSpace) RemoveBody

func (cSpace *ChipmonkSpace) RemoveBody(body physicsAPI.PhysicsObject2D)

func (*ChipmonkSpace) SetGravity

func (cSpace *ChipmonkSpace) SetGravity(gravity mgl32.Vec2)

func (*ChipmonkSpace) SetOnCollision

func (cSpace *ChipmonkSpace) SetOnCollision(onCollision func(shapeA, shapeB *chipmunk.Shape))

func (*ChipmonkSpace) Update

func (cSpace *ChipmonkSpace) Update(dt float64)

type ChipmunkBody

type ChipmunkBody struct {
	Body *chipmunk.Body
}

func NewChipmunkBody

func NewChipmunkBody(mass, i float32) *ChipmunkBody

func NewChipmunkBodyStatic

func NewChipmunkBodyStatic() *ChipmunkBody

func (*ChipmunkBody) AddAngle

func (cBody *ChipmunkBody) AddAngle(angle float32)

func (*ChipmunkBody) AddAngularVelocity

func (cBody *ChipmunkBody) AddAngularVelocity(w float32)

func (*ChipmunkBody) AddForce

func (cBody *ChipmunkBody) AddForce(force mgl32.Vec2)

func (*ChipmunkBody) AddTorque

func (cBody *ChipmunkBody) AddTorque(t float32)

func (*ChipmunkBody) AddVelocity

func (cBody *ChipmunkBody) AddVelocity(velocity mgl32.Vec2)

func (*ChipmunkBody) GetAngle

func (cBody *ChipmunkBody) GetAngle() float32

func (*ChipmunkBody) GetAngularVelocity

func (cBody *ChipmunkBody) GetAngularVelocity() float32

func (*ChipmunkBody) GetMass

func (cBody *ChipmunkBody) GetMass() float32

func (*ChipmunkBody) GetMoment

func (cBody *ChipmunkBody) GetMoment() float32

func (*ChipmunkBody) GetPosition

func (cBody *ChipmunkBody) GetPosition() mgl32.Vec2

func (*ChipmunkBody) GetTorque

func (cBody *ChipmunkBody) GetTorque() float32

func (*ChipmunkBody) GetVelocity

func (cBody *ChipmunkBody) GetVelocity() mgl32.Vec2

func (*ChipmunkBody) KineticEnergy

func (cBody *ChipmunkBody) KineticEnergy() float32

func (*ChipmunkBody) SetAngle

func (cBody *ChipmunkBody) SetAngle(angle float32)

func (*ChipmunkBody) SetAngularVelocity

func (cBody *ChipmunkBody) SetAngularVelocity(w float32)

func (*ChipmunkBody) SetForce

func (cBody *ChipmunkBody) SetForce(force mgl32.Vec2)

func (*ChipmunkBody) SetMass

func (cBody *ChipmunkBody) SetMass(mass float32)

func (*ChipmunkBody) SetMoment

func (cBody *ChipmunkBody) SetMoment(moment float32)

func (*ChipmunkBody) SetPosition

func (cBody *ChipmunkBody) SetPosition(pos mgl32.Vec2)

func (*ChipmunkBody) SetTorque

func (cBody *ChipmunkBody) SetTorque(t float32)

func (*ChipmunkBody) SetVelocity

func (cBody *ChipmunkBody) SetVelocity(velocity mgl32.Vec2)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL