Documentation ¶
Overview ¶
This package provides some common functions and structs used in other packages.
Index ¶
- func ClampFloat32(x, min, max float32) float32
- func ClampFloat64(x, min, max float64) float64
- func ClampInt(x, min, max int) int
- func GoroutineId() int
- type Boundary
- type DeviceInfo
- type Equatable
- type FloatRange
- type IdGenerator
- type Identifiable
- type IntHashable
- type Platform
- type RectBoundary
- func (b *RectBoundary) GetMax() a.Vector3
- func (b *RectBoundary) GetMin() a.Vector3
- func (b *RectBoundary) GetSize() a.Vector3
- func (b *RectBoundary) IsPointInside(v a.Vector3) bool
- func (b *RectBoundary) IsPointInside2D(v a.Vector3) bool
- func (b *RectBoundary) IsRectInside(rect *RectBoundary) bool
- func (b *RectBoundary) Move(by a.Vector3)
- func (b *RectBoundary) ToString() string
- type ScreenInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClampFloat32 ¶ added in v0.1.1
Limits the x value between min and max values.
func ClampFloat64 ¶ added in v0.1.1
Limits the x value between min and max values.
func GoroutineId ¶
func GoroutineId() int
Types ¶
type Boundary ¶
type Boundary interface { IsPointInside(point a.Vector3) bool IsPointInside2D(point a.Vector3) bool }
Represents the boundaries of an object, like collider in unity
type DeviceInfo ¶
type DeviceInfo struct { }
func (DeviceInfo) FromMap ¶
func (i DeviceInfo) FromMap(m map[string]interface{})
type Equatable ¶
type Equatable interface {
Equals(other interface{}) bool
}
Interface for making two values comparable.
type FloatRange ¶
type FloatRange struct {
Min, Max float32
}
Represents a range of values between min and max inclusive
func NewFloatRange ¶
func NewFloatRange(min, max float32) FloatRange
NewFloatRange creates a new FloatRange with the given min and max values.
func (*FloatRange) GetLength ¶
func (r *FloatRange) GetLength() float32
Gets the length of the range
func (*FloatRange) IsRangeInside ¶ added in v0.1.11
func (r *FloatRange) IsRangeInside(r2 FloatRange) bool
IsRangeInside checks if the given range is inside this range.
func (*FloatRange) IsValueInside ¶
func (r *FloatRange) IsValueInside(value float32) bool
Checks if specific value falls inside the range
func (*FloatRange) Move ¶ added in v0.1.11
func (r *FloatRange) Move(d float32)
Move shifts the range's min and max values by the given value.
func (*FloatRange) ToString ¶
func (r *FloatRange) ToString() string
type IdGenerator ¶
type IdGenerator struct {
// contains filtered or unexported fields
}
func NewIdGenerator ¶
func NewIdGenerator() *IdGenerator
func (*IdGenerator) NextId ¶
func (g *IdGenerator) NextId() int
type Identifiable ¶
type Identifiable interface {
GetId() int64
}
type IntHashable ¶
type IntHashable interface {
GetHash() int64
}
type Platform ¶
type Platform struct {
// contains filtered or unexported fields
}
func PlatformFromString ¶
type RectBoundary ¶
type RectBoundary struct {
X, Y, Z FloatRange
}
Represents a boundary in 3D space
func NewRectBoundary ¶
func NewRectBoundary(minX, maxX, minY, maxY, minZ, maxZ float32) *RectBoundary
func (*RectBoundary) GetMax ¶ added in v0.1.11
func (b *RectBoundary) GetMax() a.Vector3
func (*RectBoundary) GetMin ¶ added in v0.1.11
func (b *RectBoundary) GetMin() a.Vector3
func (*RectBoundary) GetSize ¶ added in v0.1.11
func (b *RectBoundary) GetSize() a.Vector3
func (*RectBoundary) IsPointInside ¶
func (b *RectBoundary) IsPointInside(v a.Vector3) bool
Checks if specific point is inside the boundary
func (*RectBoundary) IsPointInside2D ¶
func (b *RectBoundary) IsPointInside2D(v a.Vector3) bool
Checks if specific point is inside the boundary ignoring z position
func (*RectBoundary) IsRectInside ¶ added in v0.1.11
func (b *RectBoundary) IsRectInside(rect *RectBoundary) bool
IsRectInside checks if another rect is fully inside this rect.
func (*RectBoundary) Move ¶ added in v0.1.11
func (b *RectBoundary) Move(by a.Vector3)
Move shifts all coordinates of the rect by the given vector.
func (*RectBoundary) ToString ¶
func (b *RectBoundary) ToString() string
type ScreenInfo ¶
type ScreenInfo struct {
// contains filtered or unexported fields
}
func NewScreenInfo ¶
func NewScreenInfo(width, height int) ScreenInfo
func (ScreenInfo) FromMap ¶
func (s ScreenInfo) FromMap(m map[string]interface{})
func (ScreenInfo) GetHeight ¶
func (s ScreenInfo) GetHeight() int
func (ScreenInfo) GetWidth ¶
func (s ScreenInfo) GetWidth() int
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
This package provides most commonly used types in Amphion.
|
This package provides most commonly used types in Amphion. |
This package is used to manage and load fonts, layout and draw text.
|
This package is used to manage and load fonts, layout and draw text. |
Provides convenient types conversion functions.
|
Provides convenient types conversion functions. |