Documentation
¶
Overview ¶
This code is adapted from https://github.com/m110/airplanes (author: m110)
Index ¶
- Variables
- func AppendChild(parent, child *donburi.Entry, keepWorldPosition bool)
- func ChangeParent(child, parent *donburi.Entry, keepWorldPosition bool)
- func FindChildWithComponent(entry *donburi.Entry, componentType donburi.IComponentType) (*donburi.Entry, bool)
- func GetChildren(entry *donburi.Entry) ([]*donburi.Entry, bool)
- func GetParent(entry *donburi.Entry) (*donburi.Entry, bool)
- func LookAt(entry *donburi.Entry, target dmath.Vec2)
- func RemoveChildrenRecursive(entry *donburi.Entry)
- func RemoveParent(entry *donburi.Entry, keepWorldPosition bool)
- func RemoveRecursive(entry *donburi.Entry)
- func Reset(entry *donburi.Entry)
- func Right(entry *donburi.Entry) dmath.Vec2
- func SetParent(entry, parent *donburi.Entry, keepWorldPosition bool)
- func SetWorldPosition(entry *donburi.Entry, pos dmath.Vec2)
- func SetWorldRotation(entry *donburi.Entry, rotation float64)
- func SetWorldScale(entry *donburi.Entry, scale dmath.Vec2)
- func Up(entry *donburi.Entry) dmath.Vec2
- func WorldPosition(entry *donburi.Entry) dmath.Vec2
- func WorldRotation(entry *donburi.Entry) float64
- func WorldScale(entry *donburi.Entry) dmath.Vec2
- type TransformData
Constants ¶
This section is empty.
Variables ¶
var HierarchySystem = &hierarchySystem{ query: donburi.NewQuery(filter.Contains(hierarchyParentComponent)), }
HierarchySystem is a system that removes children of invalid parents.
var Transform = donburi.NewComponentType[TransformData](defaultValue)
Functions ¶
func AppendChild ¶
AppendChild appends child to the entry.
func ChangeParent ¶ added in v1.3.10
ChangeParent changes parent of the entry.
func FindChildWithComponent ¶
func FindChildWithComponent(entry *donburi.Entry, componentType donburi.IComponentType) (*donburi.Entry, bool)
FindChildWithComponent finds child with specified component.
func GetChildren ¶ added in v1.2.19
GetChildren returns children of the entry.
func RemoveChildrenRecursive ¶ added in v1.2.19
RemoveChildrenRecursive removes children recursively.
func RemoveParent ¶ added in v1.3.10
RemoveParent removes parent of the entry.
func RemoveRecursive ¶ added in v1.2.19
RemoveRecursive removes the entry and its children recursively.
func SetWorldPosition ¶
SetWorldPosition sets world position to the entry.
func SetWorldRotation ¶
SetWorldRotation sets world rotation to the entry.
func SetWorldScale ¶ added in v1.2.18
SetWorldScale sets world scale to the entry.
func WorldPosition ¶
WorldPosition returns world position of the entry.
func WorldRotation ¶
WorldRotation returns world rotation of the entry.
Types ¶
type TransformData ¶
type TransformData struct { LocalPosition dmath.Vec2 LocalRotation float64 LocalScale dmath.Vec2 // contains filtered or unexported fields }
TransformData is a data of transform component.
func GetTransform ¶
func GetTransform(entry *donburi.Entry) *TransformData