Skip to content

atl/sm/areatrigger

import "atl/sm/areatrigger"

Area triggers (sm.areaTrigger): volumes that report what enters, stays in and leaves them.

func Filter(name string) int

A trigger filter value by name (sm.areaTrigger.filter[name]).

func CreateBox(size, position sm.Vec3, o Options) sm.AreaTrigger
func CreateSphere(radius float64, position sm.Vec3, o Options) sm.AreaTrigger
func CreateCylinder(radius, halfLength float64, position sm.Vec3, o Options) sm.AreaTrigger

A box, sphere or cylinder at a world position.

func AttachedBox(host atl.Wrapper, size, offset sm.Vec3, o Options) sm.AreaTrigger
func AttachedSphere(host atl.Wrapper, radius float64, offset sm.Vec3, o Options) sm.AreaTrigger
func AttachedCylinder(host atl.Wrapper, radius, halfLength float64, offset sm.Vec3, o Options) sm.AreaTrigger

A box, sphere or cylinder attached to a shape, character, harvestable or other host, moving with it.

func CreateHull(hull string, position sm.Vec3, o Options, world sm.World, proxyType *int) sm.AreaTrigger

A trigger shaped like a collision hull (hull is a mesh path); proxyType is sm.areaTrigger's proxy type.

func AttachedHull(host atl.Wrapper, hull string, offset sm.Vec3, o Options, proxyType *int,
bone string) sm.AreaTrigger

A hull trigger attached to a host, optionally to one of its bones.

type Options struct {
Rotation sm.Quat
Filter *int
UserData atl.Value
IgnoreCharacters bool
IgnoreShapes bool
IgnoreHarvestables bool
}

Creation options shared by every trigger shape. Triggers detect characters, shapes and harvestables unless the matching Ignore* is set.