m3gl

package
v0.0.0-...-a2bc2c8 Latest Latest
Warning

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

Go to latest
Published: May 3, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FloatSize = 4
	IntSize   = 2

	FloatPerVertices = 6 // PPPNNN
	IntPerVertices   = 1 // C

)

OpenGL const

View Source
const (
	AxeExtraLength = 3
)

QSM DrawingElementsMap const

Variables

View Source
var CircleForLine = make([]mgl64.Vec2, circlePartsLine)
View Source
var CircleForSphere = make([]mgl64.Vec2, circlePartsSphere)
View Source
var LineWidth = SizeVar{0.05, 0.5, 0.1}
View Source
var Log = m3util.NewLogger("m3gl", m3util.INFO)
View Source
var Origin = mgl64.Vec3{0.0, 0.0, 0.0}
View Source
var SphereRadius = SizeVar{0.1, 0.8, 0.4}
View Source
var XH = mgl64.Vec3{1.0, 0.0, 0.0}
View Source
var XYZ = [3]mgl64.Vec3{XH, YH, ZH}
View Source
var YH = mgl64.Vec3{0.0, 1.0, 0.0}
View Source
var ZH = mgl64.Vec3{0.0, 0.0, 1.0}

Functions

This section is empty.

Types

type AxeDrawingElement

type AxeDrawingElement struct {
	// contains filtered or unexported fields
}

func (AxeDrawingElement) Color

func (a AxeDrawingElement) Color(blinkValue float64) int32

func (AxeDrawingElement) Dimmer

func (a AxeDrawingElement) Dimmer(blinkValue float64) float32

func (AxeDrawingElement) Display

func (a AxeDrawingElement) Display(filter SpaceDrawingFilter) bool

func (AxeDrawingElement) Key

func (a AxeDrawingElement) Key() ObjectType

AxeDrawingElement functions

func (AxeDrawingElement) Pos

func (a AxeDrawingElement) Pos() *m3point.Point

type ConnectionDrawingElement

type ConnectionDrawingElement struct {
	// contains filtered or unexported fields
}

func MakeConnectionDrawingElement

func MakeConnectionDrawingElement(space *m3space.Space, point m3point.Point, connId m3point.ConnectionId) *ConnectionDrawingElement

func (ConnectionDrawingElement) Color

func (c ConnectionDrawingElement) Color(blinkValue float64) int32

func (ConnectionDrawingElement) Dimmer

func (c ConnectionDrawingElement) Dimmer(blinkValue float64) float32

func (ConnectionDrawingElement) Display

func (ConnectionDrawingElement) Key

ConnectionDrawingElement functions

func (ConnectionDrawingElement) Pos

type DisplayWorld

type DisplayWorld struct {
	Max        m3point.CInt
	WorldSpace *m3space.Space
	Filter     SpaceDrawingFilter
	Elements   []SpaceDrawingElement

	NbVertices         int
	OpenGLBuffer       []float32
	DrawingElementsMap map[ObjectType]OpenGLDrawingElement

	TopCornerDist  float64
	Width, Height  int
	EyeDist        SizeVar
	FovAngle       SizeVar
	LightDirection mgl32.Vec3
	LightColor     mgl32.Vec3
	Projection     mgl32.Mat4
	Camera         mgl32.Mat4
	Model          mgl32.Mat4

	Angle   TimeAutoVar
	Blinker TimeAutoVar
	// contains filtered or unexported fields
}

func MakeWorld

func MakeWorld(env *m3db.QsmEnvironment, Max int64, glfwTime float64) DisplayWorld

func (*DisplayWorld) CheckMax

func (world *DisplayWorld) CheckMax() bool

func (*DisplayWorld) CreateDrawingElements

func (world *DisplayWorld) CreateDrawingElements()

func (*DisplayWorld) CreateDrawingElementsMap

func (world *DisplayWorld) CreateDrawingElementsMap() int

func (DisplayWorld) DisplaySettings

func (world DisplayWorld) DisplaySettings()

func (*DisplayWorld) EventOutgrowthThresholdDecrease

func (world *DisplayWorld) EventOutgrowthThresholdDecrease()

func (*DisplayWorld) EventOutgrowthThresholdIncrease

func (world *DisplayWorld) EventOutgrowthThresholdIncrease()

func (*DisplayWorld) ForwardTime

func (world *DisplayWorld) ForwardTime()

func (*DisplayWorld) RedrawAxesElementsMap

func (world *DisplayWorld) RedrawAxesElementsMap()

func (*DisplayWorld) RedrawConnectionsElementsMap

func (world *DisplayWorld) RedrawConnectionsElementsMap()

func (*DisplayWorld) RedrawNodesElementsMap

func (world *DisplayWorld) RedrawNodesElementsMap()

func (*DisplayWorld) SetMatrices

func (world *DisplayWorld) SetMatrices()

func (*DisplayWorld) Tick

func (world *DisplayWorld) Tick(glfwTime float64)

type DrawingElementsCreator

type DrawingElementsCreator struct {
	// contains filtered or unexported fields
}
func (creator *DrawingElementsCreator) VisitLink(space *m3space.Space, srcPoint m3point.Point, connId m3point.ConnectionId)

func (*DrawingElementsCreator) VisitNode

func (creator *DrawingElementsCreator) VisitNode(space *m3space.Space, node m3space.Node)

type GLObject

type GLObject interface {
	Key() ObjectType
	NumberOfVertices() int
	ExtractTriangles() []Triangle
}

type NodeDrawingElement

type NodeDrawingElement struct {
	// contains filtered or unexported fields
}

func MakeNodeDrawingElement

func MakeNodeDrawingElement(space *m3space.Space, node m3space.Node) *NodeDrawingElement

func (NodeDrawingElement) Color

func (n NodeDrawingElement) Color(blinkValue float64) int32

func (NodeDrawingElement) Dimmer

func (n NodeDrawingElement) Dimmer(blinkValue float64) float32

func (NodeDrawingElement) Display

func (n NodeDrawingElement) Display(filter SpaceDrawingFilter) bool

func (NodeDrawingElement) Key

NodeDrawingElement functions

func (NodeDrawingElement) Pos

func (n NodeDrawingElement) Pos() *m3point.Point

type ObjectType

type ObjectType uint8
const (
	AxeX ObjectType = iota
	AxeY
	AxeZ
	NodeEmpty
	NodeActive
	Connection00
)

func (ObjectType) IsAxe

func (ot ObjectType) IsAxe() bool

func (ObjectType) IsConnection

func (ot ObjectType) IsConnection() bool

func (ObjectType) IsNode

func (ot ObjectType) IsNode() bool

type OpenGLDrawingElement

type OpenGLDrawingElement struct {
	OpenGLOffset int32
	NbVertices   int32
	// contains filtered or unexported fields
}

type Segment

type Segment struct {
	A, B mgl64.Vec3
	T    ObjectType
}

func MakeSegment

func MakeSegment(p1, p2 m3point.Point, t ObjectType) Segment

func (Segment) ExtractTriangles

func (s Segment) ExtractTriangles() []Triangle

func (Segment) Key

func (s Segment) Key() ObjectType

func (Segment) NumberOfVertices

func (s Segment) NumberOfVertices() int

type SizeVar

type SizeVar struct {
	Min float64
	Max float64
	Val float64
}

func (*SizeVar) Decrease

func (v *SizeVar) Decrease()

func (*SizeVar) Increase

func (v *SizeVar) Increase()

type SpaceDrawingColor

type SpaceDrawingColor struct {
	// contains filtered or unexported fields
}

type SpaceDrawingElement

type SpaceDrawingElement interface {
	// Key of the drawing element to point to the OpenGL buffer to render
	Key() ObjectType
	// The translation point to apply to the OpenGL model, since all the above are drawn at the origin
	Pos() *m3point.Point
	// Return the obj_color int for the shader program
	Color(blinkValue float64) int32
	// Return the obj_dimmer int for the shader program
	Dimmer(blinkValue float64) float32
	// Display flag
	Display(filter SpaceDrawingFilter) bool
}

type SpaceDrawingFilter

type SpaceDrawingFilter struct {
	// Display grey empty nodes or not
	DisplayEmptyNodes bool
	// Display grey empty connections or not
	DisplayEmptyConnections bool
	// The events of certain colors to display. This is a mask.
	EventColorMask uint8
	// The outgrowth events with how many colors to display.
	EventOutgrowthManyColorsThreshold uint8
	// The space the filter apply to
	Space *m3space.Space
}

func (*SpaceDrawingFilter) ColorMaskSwitch

func (filter *SpaceDrawingFilter) ColorMaskSwitch(color m3space.EventColor)

func (*SpaceDrawingFilter) DisplaySettings

func (filter *SpaceDrawingFilter) DisplaySettings()

func (*SpaceDrawingFilter) EventOutgrowthColorsDecrease

func (filter *SpaceDrawingFilter) EventOutgrowthColorsDecrease()

func (*SpaceDrawingFilter) EventOutgrowthColorsIncrease

func (filter *SpaceDrawingFilter) EventOutgrowthColorsIncrease()

type Sphere

type Sphere struct {
	C mgl64.Vec3
	R float64
	T ObjectType
}

func MakeSphere

func MakeSphere(t ObjectType) Sphere

func (Sphere) ExtractTriangles

func (s Sphere) ExtractTriangles() []Triangle

func (Sphere) Key

func (s Sphere) Key() ObjectType

func (Sphere) NumberOfVertices

func (s Sphere) NumberOfVertices() int

type TimeAutoVar

type TimeAutoVar struct {
	Enabled   bool
	Threshold float64
	Ratio     float64

	Value float64
	// contains filtered or unexported fields
}

func (*TimeAutoVar) Tick

func (t *TimeAutoVar) Tick(glfwTime float64)

type Triangle

type Triangle struct {
	// contains filtered or unexported fields
}

func MakeTriangle

func MakeTriangle(vert [3]mgl64.Vec3) Triangle

func MakeTriangleWithNorm

func MakeTriangleWithNorm(vert [3]mgl64.Vec3, norm mgl64.Vec3) Triangle

type TriangleFiller

type TriangleFiller struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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