Documentation
¶
Index ¶
- type ContactBeginEvent
- func (c ContactBeginEvent) AppendWire(b []byte) []byte
- func (c ContactBeginEvent) FromProto(p *pbevent.ContactBeginEvent) ContactBeginEvent
- func (c ContactBeginEvent) MarshalWire() []byte
- func (ContactBeginEvent) Name() string
- func (c ContactBeginEvent) ProtoDescriptor() protoreflect.MessageDescriptor
- func (c ContactBeginEvent) SizeWire() int
- func (c ContactBeginEvent) ToProto() *pbevent.ContactBeginEvent
- func (c ContactBeginEvent) UnmarshalWire(data []byte) (any, error)
- type ContactEndEvent
- func (c ContactEndEvent) AppendWire(b []byte) []byte
- func (c ContactEndEvent) FromProto(p *pbevent.ContactEndEvent) ContactEndEvent
- func (c ContactEndEvent) MarshalWire() []byte
- func (ContactEndEvent) Name() string
- func (c ContactEndEvent) ProtoDescriptor() protoreflect.MessageDescriptor
- func (c ContactEndEvent) SizeWire() int
- func (c ContactEndEvent) ToProto() *pbevent.ContactEndEvent
- func (c ContactEndEvent) UnmarshalWire(data []byte) (any, error)
- type ContactEventEmitter
- type ContactEventPayload
- type FixtureFilterBits
- type TriggerBeginEvent
- func (c TriggerBeginEvent) AppendWire(b []byte) []byte
- func (c TriggerBeginEvent) FromProto(p *pbevent.TriggerBeginEvent) TriggerBeginEvent
- func (c TriggerBeginEvent) MarshalWire() []byte
- func (TriggerBeginEvent) Name() string
- func (c TriggerBeginEvent) ProtoDescriptor() protoreflect.MessageDescriptor
- func (c TriggerBeginEvent) SizeWire() int
- func (c TriggerBeginEvent) ToProto() *pbevent.TriggerBeginEvent
- func (c TriggerBeginEvent) UnmarshalWire(data []byte) (any, error)
- type TriggerEndEvent
- func (c TriggerEndEvent) AppendWire(b []byte) []byte
- func (c TriggerEndEvent) FromProto(p *pbevent.TriggerEndEvent) TriggerEndEvent
- func (c TriggerEndEvent) MarshalWire() []byte
- func (TriggerEndEvent) Name() string
- func (c TriggerEndEvent) ProtoDescriptor() protoreflect.MessageDescriptor
- func (c TriggerEndEvent) SizeWire() int
- func (c TriggerEndEvent) ToProto() *pbevent.TriggerEndEvent
- func (c TriggerEndEvent) UnmarshalWire(data []byte) (any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContactBeginEvent ¶
type ContactBeginEvent struct {
ContactEventPayload
}
ContactBeginEvent is emitted after the physics step when two non-sensor fixtures begin touching. Normal and Point are populated when the collision manifold has at least one point (see NormalValid / PointValid).
func (ContactBeginEvent) AppendWire ¶ added in v0.16.9
func (c ContactBeginEvent) AppendWire(b []byte) []byte
func (ContactBeginEvent) FromProto ¶ added in v0.15.0
func (c ContactBeginEvent) FromProto(p *pbevent.ContactBeginEvent) ContactBeginEvent
func (ContactBeginEvent) MarshalWire ¶ added in v0.15.0
func (c ContactBeginEvent) MarshalWire() []byte
func (ContactBeginEvent) Name ¶
func (ContactBeginEvent) Name() string
func (ContactBeginEvent) ProtoDescriptor ¶ added in v0.16.4
func (c ContactBeginEvent) ProtoDescriptor() protoreflect.MessageDescriptor
func (ContactBeginEvent) SizeWire ¶ added in v0.16.9
func (c ContactBeginEvent) SizeWire() int
func (ContactBeginEvent) ToProto ¶ added in v0.15.0
func (c ContactBeginEvent) ToProto() *pbevent.ContactBeginEvent
func (ContactBeginEvent) UnmarshalWire ¶ added in v0.15.0
func (c ContactBeginEvent) UnmarshalWire(data []byte) (any, error)
type ContactEndEvent ¶
type ContactEndEvent struct {
ContactEventPayload
}
ContactEndEvent is emitted after the physics step when two non-sensor fixtures stop touching. Manifold data is usually unavailable for EndContact; NormalValid/PointValid are typically false.
func (ContactEndEvent) AppendWire ¶ added in v0.16.9
func (c ContactEndEvent) AppendWire(b []byte) []byte
func (ContactEndEvent) FromProto ¶ added in v0.15.0
func (c ContactEndEvent) FromProto(p *pbevent.ContactEndEvent) ContactEndEvent
func (ContactEndEvent) MarshalWire ¶ added in v0.15.0
func (c ContactEndEvent) MarshalWire() []byte
func (ContactEndEvent) Name ¶
func (ContactEndEvent) Name() string
func (ContactEndEvent) ProtoDescriptor ¶ added in v0.16.4
func (c ContactEndEvent) ProtoDescriptor() protoreflect.MessageDescriptor
func (ContactEndEvent) SizeWire ¶ added in v0.16.9
func (c ContactEndEvent) SizeWire() int
func (ContactEndEvent) ToProto ¶ added in v0.15.0
func (c ContactEndEvent) ToProto() *pbevent.ContactEndEvent
func (ContactEndEvent) UnmarshalWire ¶ added in v0.15.0
func (c ContactEndEvent) UnmarshalWire(data []byte) (any, error)
type ContactEventEmitter ¶
type ContactEventEmitter interface {
EmitContactBegin(ContactBeginEvent)
EmitContactEnd(ContactEndEvent)
EmitTriggerBegin(TriggerBeginEvent)
EmitTriggerEnd(TriggerEndEvent)
}
ContactEventEmitter is the per-step sink for flushed physics contact/trigger events. The physics step driver assigns an implementation (PhysicsRuntime.Emitter) before World.Step and calls FlushBufferedContacts after the step.
type ContactEventPayload ¶
type ContactEventPayload struct {
FilterA FixtureFilterBits `json:"filter_a"`
FilterB FixtureFilterBits `json:"filter_b"`
EntityA cardinal.EntityID `json:"entity_a"`
EntityB cardinal.EntityID `json:"entity_b"`
ShapeIndexA int `json:"shape_index_a"`
ShapeIndexB int `json:"shape_index_b"`
Normal component.Vec2 `json:"normal"`
NormalValid bool `json:"normal_valid"`
Point component.Vec2 `json:"point"`
PointValid bool `json:"point_valid"`
}
ContactEventPayload is shared data for all flushed contact/trigger events. Entity/fixture ordering and how filter/manifold fields are filled can differ between a normal step (live Box2D callbacks) and recovery after a world rebuild; see internal/contact_flush.go.
func (ContactEventPayload) AppendWire ¶ added in v0.16.9
func (c ContactEventPayload) AppendWire(b []byte) []byte
func (ContactEventPayload) FromProto ¶ added in v0.15.0
func (c ContactEventPayload) FromProto(p *pbevent.ContactEventPayload) ContactEventPayload
func (ContactEventPayload) SizeWire ¶ added in v0.16.9
func (c ContactEventPayload) SizeWire() int
func (ContactEventPayload) ToProto ¶ added in v0.15.0
func (c ContactEventPayload) ToProto() *pbevent.ContactEventPayload
type FixtureFilterBits ¶
type FixtureFilterBits struct {
CategoryBits uint64 `json:"category_bits"`
MaskBits uint64 `json:"mask_bits"`
GroupIndex int32 `json:"group_index"`
}
FixtureFilterBits is the Box2D collision filter for one fixture at contact time. It matches ECS ColliderShape CategoryBits/MaskBits and the fixture’s GroupIndex (non-zero group rules override category/mask in Box2D).
func (FixtureFilterBits) AppendWire ¶ added in v0.16.9
func (c FixtureFilterBits) AppendWire(b []byte) []byte
func (FixtureFilterBits) FromProto ¶ added in v0.15.0
func (c FixtureFilterBits) FromProto(p *pbevent.FixtureFilterBits) FixtureFilterBits
func (FixtureFilterBits) SizeWire ¶ added in v0.16.9
func (c FixtureFilterBits) SizeWire() int
func (FixtureFilterBits) ToProto ¶ added in v0.15.0
func (c FixtureFilterBits) ToProto() *pbevent.FixtureFilterBits
type TriggerBeginEvent ¶
type TriggerBeginEvent struct {
ContactEventPayload
}
TriggerBeginEvent is emitted after the physics step when an overlap involving at least one sensor begins.
func (TriggerBeginEvent) AppendWire ¶ added in v0.16.9
func (c TriggerBeginEvent) AppendWire(b []byte) []byte
func (TriggerBeginEvent) FromProto ¶ added in v0.15.0
func (c TriggerBeginEvent) FromProto(p *pbevent.TriggerBeginEvent) TriggerBeginEvent
func (TriggerBeginEvent) MarshalWire ¶ added in v0.15.0
func (c TriggerBeginEvent) MarshalWire() []byte
func (TriggerBeginEvent) Name ¶
func (TriggerBeginEvent) Name() string
func (TriggerBeginEvent) ProtoDescriptor ¶ added in v0.16.4
func (c TriggerBeginEvent) ProtoDescriptor() protoreflect.MessageDescriptor
func (TriggerBeginEvent) SizeWire ¶ added in v0.16.9
func (c TriggerBeginEvent) SizeWire() int
func (TriggerBeginEvent) ToProto ¶ added in v0.15.0
func (c TriggerBeginEvent) ToProto() *pbevent.TriggerBeginEvent
func (TriggerBeginEvent) UnmarshalWire ¶ added in v0.15.0
func (c TriggerBeginEvent) UnmarshalWire(data []byte) (any, error)
type TriggerEndEvent ¶
type TriggerEndEvent struct {
ContactEventPayload
}
TriggerEndEvent is emitted after the physics step when an overlap involving at least one sensor ends.
func (TriggerEndEvent) AppendWire ¶ added in v0.16.9
func (c TriggerEndEvent) AppendWire(b []byte) []byte
func (TriggerEndEvent) FromProto ¶ added in v0.15.0
func (c TriggerEndEvent) FromProto(p *pbevent.TriggerEndEvent) TriggerEndEvent
func (TriggerEndEvent) MarshalWire ¶ added in v0.15.0
func (c TriggerEndEvent) MarshalWire() []byte
func (TriggerEndEvent) Name ¶
func (TriggerEndEvent) Name() string
func (TriggerEndEvent) ProtoDescriptor ¶ added in v0.16.4
func (c TriggerEndEvent) ProtoDescriptor() protoreflect.MessageDescriptor
func (TriggerEndEvent) SizeWire ¶ added in v0.16.9
func (c TriggerEndEvent) SizeWire() int
func (TriggerEndEvent) ToProto ¶ added in v0.15.0
func (c TriggerEndEvent) ToProto() *pbevent.TriggerEndEvent
func (TriggerEndEvent) UnmarshalWire ¶ added in v0.15.0
func (c TriggerEndEvent) UnmarshalWire(data []byte) (any, error)