Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gophys

A simple physics engine written in Go

Features

  • ability to create and manipulate physics data structures of different types and Set or increment their attributes as you please
  • create randomized RigidBody and particles
  • Run a simulation of random particles or random rigid bodies

Types

Vector2:

type Vector2 struct {
	x, y float64
}

Particle:

type Particle struct {
	position vector.Vector2
	velocity vector.Vector2
	mass     float64
}

RigidBody (+ BoxShape):

type BoxShape struct {
	width           float64
	height          float64
	mass            float64
	momentOfInertia float64
}

type RigidBody struct {
	shape           *BoxShape
	position        *vector.Vector2
	linearVelocity  *vector.Vector2
	force           *vector.Vector2
	angle           float64
	angularVelocity float64
	torque          float64
}

About

A simple physics engine written in Go

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages