Hi,
I want to bind the entity position to the mouse cursor position:
_cursoreEntity = null;
handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler.setInputAction(function (movement) {
var cartesian = viewer.camera.pickEllipsoid(movement.endPosition, viewer.scene.globe.ellipsoid);
if (_cursoreEntity == null) {
_cursoreEntity = _viever.entities.add({
position: cartesian,
ellipsoid: {
radii: new Cesium.Cartesian3(0.5, 0.5, 0.5),
material: Cesium.Color.RED
}
});
} else {
_cursoreEntity.position = cartesian;
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
But, the entity position is updated only when the mouse movement stops. How update position of entity during mouse movement?
Cesium 1.35, Chrome