func (e *Entity) OnPositionUpdate(h func(pos r3.Vector)) {
	pos := new(r3.Vector)
	firePosUpdate := func(PropertyValue) {
		newPos := e.Position()
		if *pos != newPos {
			h(newPos)
			*pos = newPos
		}
	}

	if e.isPlayer() {
		e.FindProperty(propVecOriginPlayerXY).OnUpdate(firePosUpdate)
		e.FindProperty(propVecOriginPlayerZ).OnUpdate(firePosUpdate)
	} else {
		e.FindProperty(propCellX).OnUpdate(firePosUpdate)
		e.FindProperty(propCellY).OnUpdate(firePosUpdate)
		e.FindProperty(propCellZ).OnUpdate(firePosUpdate)
		e.FindProperty(propVecOrigin).OnUpdate(firePosUpdate)
	}
}
// OnPositionUpdate registers a handler for the entity's position update.
// The handler is called with the new position every time a position-relevant property is updated.
//
// See also Position()
OnPositionUpdate registers a handler for the entity's position update.
The handler is called with the new position every time a position-relevant property is updated.

See also Position()
// OnPositionUpdate registers a handler for the entity ' s position update . // The handler is called with the new position every time a position - relevant property is updated . // // See also Position ()
func (e *Entity) OnPositionUpdate(h func(pos r3.Vector)) {
	pos := new(r3.Vector)
	firePosUpdate := func(PropertyValue) {
		newPos := e.Position()
		if *pos != newPos {
			h(newPos)
			*pos = newPos
		}
	}
	if e.isPlayer() {
		e.FindProperty(propVecOriginPlayerXY).OnUpdate(firePosUpdate)
		e.FindProperty(propVecOriginPlayerZ).OnUpdate(firePosUpdate)
	} else {
		e.FindProperty(propCellX).OnUpdate(firePosUpdate)
		e.FindProperty(propCellY).OnUpdate(firePosUpdate)
		e.FindProperty(propCellZ).OnUpdate(firePosUpdate)
		e.FindProperty(propVecOrigin).OnUpdate(firePosUpdate)
	}
}
func ( e * Entity ) OnPositionUpdate ( h func ( pos r3 . Vector ) ) { pos := new ( r3 . Vector ) firePosUpdate := func ( PropertyValue ) { newPos := e . Position ( ) if * pos != newPos { h ( newPos ) * pos = newPos } } if e . isPlayer ( ) { e . FindProperty ( propVecOriginPlayerXY ) . OnUpdate ( firePosUpdate ) e . FindProperty ( propVecOriginPlayerZ ) . OnUpdate ( firePosUpdate ) } else { e . FindProperty ( propCellX ) . OnUpdate ( firePosUpdate ) e . FindProperty ( propCellY ) . OnUpdate ( firePosUpdate ) e . FindProperty ( propCellZ ) . OnUpdate ( firePosUpdate ) e . FindProperty ( propVecOrigin ) . OnUpdate ( firePosUpdate ) } }
OnPositionUpdate registers a handler for the entity's position update.
OnPositionUpdate registers a handler for the entity ' s position update .