constructor(props) { super(props); const { width, height } = Dimensions.get('window'); this.x1 = new Animated.Value(randomNumber(0, width)); this.y1 = new Animated.Value(randomNumber(0, height)); this.x2 = new Animated.Value(randomNumber(0, width)); this.y2 = new Animated.Value(randomNumber(0, height)); this.x3 = new Animated.Value(randomNumber(0, width)); this.y3 = new Animated.Value(randomNumber(0, height)); }
function intersectObjects({ locationX, locationY }, objects) { const { width, height } = Dimensions.get('window'); pointerVector.set( locationX / width * 2 - 1, -(locationY / height * 2) + 1 ); ray.setFromCamera(pointerVector, camera); var intersections = ray.intersectObjects(objects, true); return intersections[0] ? intersections[0] : false; }
constructor(props) { super(props); const { width, height } = Dimensions.get('window'); this.source = [ new Animated.Value(randomNumber(0, width)), new Animated.Value(randomNumber(0, height)) ]; this.target = [ new Animated.Value(randomNumber(0, width)), new Animated.Value(randomNumber(0, height)) ]; }
constructor(props) { super(props); const { width, height } = Dimensions.get('window'); this.x1 = new Animated.Value(randomNumber(0, width)); this.y1 = new Animated.Value(randomNumber(0, height)); this.x2 = new Animated.Value(randomNumber(0, width)); this.y2 = new Animated.Value(randomNumber(0, height)); this.x3 = new Animated.Value(randomNumber(0, width)); this.y3 = new Animated.Value(randomNumber(0, height)); }
function intersectObjects({ locationX, locationY }, objects) { const { width, height } = Dimensions.get('window'); pointerVector.set( locationX / width * 2 - 1, -(locationY / height * 2) + 1 ); ray.setFromCamera(pointerVector, camera); var intersections = ray.intersectObjects(objects, true); return intersections[0] ? intersections[0] : false; }