MCPcopy Index your code
hub / github.com/EngoEngine/engo / AddShape

Method AddShape

common/collision.go:111–113  ·  view source on GitHub ↗

AddShape adds a shape to the SpaceComponent for use as a hitbox. A SpaceComponent can have any number of shapes attached to it. The shapes are made up of a []engo.Line, with each line defining a face of the shape. The coordinates are such that (0,0) is the upper left corner of the SpaceComponent. If

(shape Shape)

Source from the content-addressed store, hash-verified

109// such that (0,0) is the upper left corner of the SpaceComponent. If no shapes
110// are added, the SpaceComponent is treated as an AABB.
111func (sc *SpaceComponent) AddShape(shape Shape) {
112 sc.hitboxes = append(sc.hitboxes, shape)
113}
114
115// SetCenter positions the space component according to its center instead of its
116// top-left point (this avoids doing the same math each time in your systems)

Callers 5

NewRockFunction · 0.80
SetupMethod · 0.80

Calls

no outgoing calls