Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelDataMessage ¶
type ChannelId ¶
type ChannelId uint32
Each channel uses a goroutine and we can have at most millions of goroutines at the same time. So we won't use 64-bit channel ID unless we use a distributed architecture for channeld itself.
type SpatialInfo ¶
channeldpb.SpatialInfo is heavy with mutex lock and other allocations. We need a light struct for frequent value copy.
func (*SpatialInfo) Dist2D ¶
func (info1 *SpatialInfo) Dist2D(info2 *SpatialInfo) float64
func (*SpatialInfo) Dot2D ¶
func (info1 *SpatialInfo) Dot2D(info2 *SpatialInfo) float64
func (*SpatialInfo) Magnitude2D ¶
func (info1 *SpatialInfo) Magnitude2D() float64
func (*SpatialInfo) Normalize2D ¶
func (info *SpatialInfo) Normalize2D()
func (*SpatialInfo) String ¶
func (s *SpatialInfo) String() string
func (*SpatialInfo) Unit2D ¶
func (info *SpatialInfo) Unit2D() SpatialInfo
type SpatialInfoChangedNotifier ¶
type SpatialInfoChangedNotifier interface { // The handover data provider has three parameters: // - srcChannelId: the channel that an object is handed over from. // - dstChannelId: the channel that an object is handed over to. // - handoverData: // if use group-based handover, the data should be the id of the migrating entity; // if use the query-context handover, the data should be the message wrapped in ChannelDataHandoverMessage; // if nil, no handover will happend. Notify(oldInfo SpatialInfo, newInfo SpatialInfo, handoverDataProvider func(ChannelId, ChannelId, interface{})) }
Notifies the spatial/entity channel from the ChannelDataUpdate that the spatial info of an entity has changed, so the channel's SpatialController will check the handover. If the handover happpens, `handoverDataProvider` will be called to provide the data for the ChannelDataHandoverMessage.
Click to show internal directories.
Click to hide internal directories.