shape

package
v0.0.0-...-1050381 Latest Latest
Warning

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

Go to latest
Published: May 7, 2017 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawParallaxBuffers

func DrawParallaxBuffers(numObjects int, camPos mgl32.Vec3, parallaxPositionBuffer, parallaxTranslationBuffer, parallaxTranslationRatioBuffer, parallaxAngleBuffer, parallaxScaleBuffer, parallaxColorBuffer gl.Buffer)

func GetParallaxBuffers

func GetParallaxBuffers(arr []ParallaxRect) (parallaxPositionBuffer, parallaxTranslationBuffer, parallaxTranslationRatioBuffer, parallaxAngleBuffer, parallaxScaleBuffer, parallaxColorBuffer gl.Buffer)

Types

type OrbitingRect

type OrbitingRect struct {
	model.Model
	// contains filtered or unexported fields
}

func NewOrbitingRect

func NewOrbitingRect(rect entity.Entity, c *color.NRGBA, orbitCenter mgl32.Vec2, orbitRadius float32, orbitTarget entity.Target, revolutionSpeed, rotateSpeed int64) *OrbitingRect

func (*OrbitingRect) DrawOrbit

func (r *OrbitingRect) DrawOrbit()

func (*OrbitingRect) Update

func (r *OrbitingRect) Update()

type ParallaxRect

type ParallaxRect struct {
	model.Model
	Target camera.CameraI
	// Essentially, how this object moves in comparison to the camera.
	// 1 is the same speed. 0.2 is 20% of camera speed.
	// The larger the number, the further away the object appears to be. For example, a ratio of 0.95 means the object
	// barely move when the camera moves - just like something that's very far away.
	// Negative numbers will make it move in the opposite direction, which isn't recommended.
	TranslationRatio float32
}

func GenParallaxRects

func GenParallaxRects(target camera.CameraI, count int, minWidth, maxWidth, minSpeedRatio, maxSpeedRatio float32) []ParallaxRect

type Shape

type Shape interface {
	// Draw draws an outline of a Shape using line segments.
	DrawWireframe()
	// DrawFilled draws a filled in Shape using triangles.
	DrawFilled()
	// SetCenter sets the Shape to the specified position.
	SetCenter(x, y float32)
	// ModifyCenter moves the Shape by the specified amount.
	ModifyCenter(x, y float32)
	// Center is a point about which all actions, like rotation, are defined.
	// TODO: Consider the ability to modify the center point for rotating.
	Position() mgl32.Vec3
}

Jump to

Keyboard shortcuts

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