types

package
v0.0.0-...-57fb5ef Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface {
	Type() string
	Update(dt float64) error
	GetPlanformArea() float64
}

Component represents a generic ECS component

type System

type System interface {
	Update(dt float32) error
	Priority() int
}

System represents a generic ECS system

type Vector3

type Vector3 struct {
	X, Y, Z float64
}

Vector3 represents a 3D vector

func (Vector3) Add

func (v Vector3) Add(other Vector3) Vector3

Add returns the sum of two vectors INFO: Adding two vectors component-wise.

func (Vector3) DivideScalar

func (v Vector3) DivideScalar(scalar float64) Vector3

DivideScalar returns the vector divided by a scalar INFO: Ensure the scalar is not zero to avoid division by zero.

func (Vector3) Magnitude

func (v Vector3) Magnitude() float64

Magnitude returns the length of the vector INFO: Calculating the magnitude as the Euclidean norm.

func (Vector3) MultiplyScalar

func (v Vector3) MultiplyScalar(scalar float64) Vector3

MultiplyScalar returns the vector multiplied by a scalar INFO: Scaling the vector components by the given scalar.

func (Vector3) Round

func (v Vector3) Round(precision int) Vector3

Round returns the vector with each component rounded to the given precision INFO: Rounding the vector components to the supplied precision.

func (Vector3) String

func (v Vector3) String() string

String returns a string representation of the vector INFO: Format the vector components to two decimal places for readability.

func (Vector3) Subtract

func (v Vector3) Subtract(other Vector3) Vector3

Subtract returns the difference of two vectors INFO: Subtracting other vector from this vector component-wise.

Jump to

Keyboard shortcuts

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