shape

package
v0.4.0-preview.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidKindValue

func IsValidKindValue(value Kind) bool

Types

type EllipseShape

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

func NewEllipseShape

func NewEllipseShape(boundary *common.Rect) *EllipseShape

func (*EllipseShape) IsPointInside

func (e *EllipseShape) IsPointInside(point a.Vector3) bool

func (*EllipseShape) IsPointInside2D

func (e *EllipseShape) IsPointInside2D(point a.Vector3) bool

func (*EllipseShape) Kind

func (e *EllipseShape) Kind() Kind

type EmptyShape

type EmptyShape struct {
}

func (EmptyShape) IsPointInside

func (e EmptyShape) IsPointInside(_ a.Vector3) bool

func (EmptyShape) IsPointInside2D

func (e EmptyShape) IsPointInside2D(_ a.Vector3) bool

func (EmptyShape) Kind

func (e EmptyShape) Kind() Kind

type Kind

type Kind int
const (
	Empty Kind = iota
	Rectangle
	RoundedRectangle
	Circle
	Ellipse
	Triangle
)

type RectangleShape

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

func NewRectangleShape

func NewRectangleShape(boundary *common.Rect) *RectangleShape

func (*RectangleShape) IsPointInside

func (r *RectangleShape) IsPointInside(point a.Vector3) bool

func (*RectangleShape) IsPointInside2D

func (r *RectangleShape) IsPointInside2D(point a.Vector3) bool

func (*RectangleShape) Kind

func (r *RectangleShape) Kind() Kind

type Shape

type Shape interface {
	common.Boundary
	Kind() Kind
}

func New

func New(kind Kind, boundary *common.Rect) Shape

type TriangleShape

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

func NewTriangleShape

func NewTriangleShape(boundary *common.Rect) *TriangleShape

func (*TriangleShape) IsPointInside

func (t *TriangleShape) IsPointInside(point a.Vector3) bool

func (*TriangleShape) IsPointInside2D

func (t *TriangleShape) IsPointInside2D(point a.Vector3) bool

func (*TriangleShape) Kind

func (t *TriangleShape) Kind() Kind

Jump to

Keyboard shortcuts

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