Chipmunk - Go Packages
- Why Go Why Go
- Case Studies
- Use Cases
- Security Policy
- Learn
- Docs Docs
- Effective Go
- Go User Manual
- Standard library
- Release Notes
- Packages
- Community Community
- Recorded Talks
- Meetups
- Conferences
- Go blog
- Go project
- Get connected
Details
- Valid go.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
- Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
- Tagged version
Modules with tagged versions give importers more predictable builds.
- Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
github.com/andrebq/expLinks
- Open Source Insights
- Documentation
- Overview
- Index
- Constants
- Variables
- Functions
- MomentForBox(mass, width, height)
- MomentForCircle(mass, innerDiameter, outerDiameter, offset)
- Types
- type Body
- NewBody(mass, moment)
- (b) Free()
- (b) Pos()
- (b) SetPos(p)
- (b) Vel()
- type Layer
- (l) Not()
- type Shape
- NewBoxShape(body, width, height)
- NewCircleShape(body, radius, center)
- NewSegmentShape(body, a, b, radius)
- (s) Free()
- (s) SetElasticity(val)
- (s) SetFriction(val)
- (s) SetLayers(layer)
- type Space
- NewSpace()
- (s) AddBody(body)
- (s) AddShape(shape)
- (s) Free()
- (s) SetCollisionSlop(value)
- (s) SetGravity(g)
- (s) SetIterations(count)
- (s) SetSleepTimeThreshold(value)
- (s) StaticBody()
- (s) Step(timeStep)
- (s) StepSeconds(totalSeconds, timeStep)
- type Vect
- V(x, y)
- VZero()
- type Body
- Source Files
Documentation ¶
Overview ¶
- See chipmunk-physics.net for chipmunk source-code
Chipmunk-GO binding for chipmunk physics engine
See chipmunk-physics.net for chipmunk source-code ¶
Just like the original code, this binding is released under the MIT license. See LICENSE for more details.
IMPORTANT! The current code might leak memory since chipmunk allocated objects need to be manually free'd. You should use defer obj.Free() but the order is important!
* free all shapes * free all bodies * free the space object
This is the opposite of the creation order and therefor you can't use defer the usual way (at least not now).
Index ¶
- Constants
- func MomentForBox(mass, width, height float32) float32
- func MomentForCircle(mass, innerDiameter, outerDiameter float32, offset Vect) float32
- type Body
- func NewBody(mass, moment float32) Body
- func (b *Body) Free()
- func (b *Body) Pos() Vect
- func (b *Body) SetPos(p Vect)
- func (b *Body) Vel() Vect
- type Layer
- func (l Layer) Not() Layer
- type Shape
- func NewBoxShape(body Body, width, height float32) Shape
- func NewCircleShape(body Body, radius float32, center Vect) Shape
- func NewSegmentShape(body Body, a, b Vect, radius float32) Shape
- func (s *Shape) Free()
- func (s *Shape) SetElasticity(val float32)
- func (s *Shape) SetFriction(val float32)
- func (s *Shape) SetLayers(layer Layer)
- type Space
- func NewSpace() Space
- func (s *Space) AddBody(body Body) Body
- func (s *Space) AddShape(shape Shape) Shape
- func (s *Space) Free()
- func (s *Space) SetCollisionSlop(value float32)
- func (s *Space) SetGravity(g Vect)
- func (s *Space) SetIterations(count int)
- func (s *Space) SetSleepTimeThreshold(value float32)
- func (s *Space) StaticBody() Body
- func (s *Space) Step(timeStep float32)
- func (s *Space) StepSeconds(totalSeconds, timeStep float32)
- type Vect
- func V(x, y float32) Vect
- func VZero() Vect
Constants ¶
View Source const ( // NEGATE_LAYER is used to negate a given layer NEGATE_LAYER = Layer(uint(math.MaxUint32)) // ALL_LAYERS indicates that a shape is in every layer ALL_LAYERS = Layer(C.CP_ALL_LAYERS) )Variables ¶
This section is empty.
Functions ¶
func MomentForBox ¶
func MomentForBox(mass, width, height float32) float32func MomentForCircle ¶
func MomentForCircle(mass, innerDiameter, outerDiameter float32, offset Vect) float32Types ¶
type Body ¶
type Body struct { // contains filtered or unexported fields }func NewBody ¶
func NewBody(mass, moment float32) Bodyfunc (*Body) Free ¶
func (b *Body) Free()func (*Body) Pos ¶
func (b *Body) Pos() Vectfunc (*Body) SetPos ¶
func (b *Body) SetPos(p Vect)func (*Body) Vel ¶
func (b *Body) Vel() Vecttype Layer ¶
type Layer uintLayer used by chipmunk
func (Layer) Not ¶
func (l Layer) Not() LayerReturn the negated version of this layer
type Shape ¶
type Shape struct { // contains filtered or unexported fields }func NewBoxShape ¶
func NewBoxShape(body Body, width, height float32) Shapefunc NewCircleShape ¶
func NewCircleShape(body Body, radius float32, center Vect) Shapefunc NewSegmentShape ¶
func NewSegmentShape(body Body, a, b Vect, radius float32) Shapefunc (*Shape) Free ¶
func (s *Shape) Free()func (*Shape) SetElasticity ¶
func (s *Shape) SetElasticity(val float32)func (*Shape) SetFriction ¶
func (s *Shape) SetFriction(val float32)func (*Shape) SetLayers ¶
func (s *Shape) SetLayers(layer Layer)type Space ¶
type Space struct { // contains filtered or unexported fields }func NewSpace ¶
func NewSpace() Spacefunc (*Space) AddBody ¶
func (s *Space) AddBody(body Body) Bodyfunc (*Space) AddShape ¶
func (s *Space) AddShape(shape Shape) Shapefunc (*Space) Free ¶
func (s *Space) Free()func (*Space) SetCollisionSlop ¶
func (s *Space) SetCollisionSlop(value float32)func (*Space) SetGravity ¶
func (s *Space) SetGravity(g Vect)func (*Space) SetIterations ¶
func (s *Space) SetIterations(count int)func (*Space) SetSleepTimeThreshold ¶
func (s *Space) SetSleepTimeThreshold(value float32)func (*Space) StaticBody ¶
func (s *Space) StaticBody() Bodyfunc (*Space) Step ¶
func (s *Space) Step(timeStep float32)func (*Space) StepSeconds ¶
func (s *Space) StepSeconds(totalSeconds, timeStep float32)Run the simulation for at least totalSeconds.
In order to keep the fixed timestep if totalSeconds / timeStep != 0 the total number of seconds simulated might be totalSeconds + timeStep seconds of simulation.
The number of seconds here isn't related to the number of wall clock time, but instead this means how many seconds on the simulation should be consumed
type Vect ¶
type Vect C.cpVectfunc V ¶
func V(x, y float32) Vectfunc VZero ¶
func VZero() VectSource Files ¶
View all Source files- chipmunk.go
- doc.go
Jump to
CloseKeyboard shortcuts
? | : This menu |
/ | : Search site |
f or F | : Jump to |
y or Y | : Canonical URL |
Từ khóa » Chipmunk Github
-
Esrlabs/chipmunk: Log Analysis Tool - GitHub
-
Slembcke/Chipmunk2D: A Fast And Lightweight 2D Game ... - GitHub
-
Chipmunk - GitHub
-
Josephg/Chipmunk-js: Port Of Slembcke/Chipmunk-Physics ... - GitHub
-
Chipmunk/ At Master - GitHub
-
Chipmunk · GitHub Topics
-
Releases · Esrlabs/chipmunk - GitHub
-
Vova616/chipmunk - GitHub
-
Zyedidia/Chipmunk.jl: A Binding Of The Physics Engine ... - GitHub
-
Log Analyzer & Viewer | Chipmunk Site
-
Chipmunk Physics
-
Chipmunk++
-
Issue With Using Git Push In Android Studio Chipmunk 2021.2.1 On ...