pngdebug

package
v0.0.0-...-cf82ea8 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WorldRect

func WorldRect(hw, hh, decToPix float32) image.Rectangle

Types

type PngDebugDraw

type PngDebugDraw struct {
	// Folder to store the frames
	OutputFolder string
	// Decimal to Pixel conversion factor
	//
	// The engine works on decimal, so 1 means 1 meter
	// this is used to convert 1 meter to N pixels
	DecToPix float32
	// If the next frame should be saved to disk when
	// EndFrame is called
	//
	// Usefull to skip frames where the visual change is
	// small
	SaveToDisk bool
	// Total time from the simulation (fixed time step) that
	// should be waited to save a new frame.
	//
	// If dt = 1/60, and you want to save at a 1/30 fps you should
	// set this to 1/30 then the simulation will be saved every 2 frames
	//
	// A value of 0 means save every frame
	TimeBetweenFrames float32
	// contains filtered or unexported fields
}

Implement the debugdraw interface from figo and save the output to a gif file

func (*PngDebugDraw) BeginFrame

func (f *PngDebugDraw) BeginFrame(info figo.FrameData)

func (*PngDebugDraw) DrawShape

func (s *PngDebugDraw) DrawShape(shape *figo.Shape, mass, vel, acc float32)

func (*PngDebugDraw) EndFrame

func (s *PngDebugDraw) EndFrame()

Jump to

Keyboard shortcuts

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