Tabnine Logo
Vector3.set
Code IndexAdd Tabnine to your IDE (free)

How to use
set
method
in
com.google.ar.sceneform.math.Vector3

Best Java code snippets using com.google.ar.sceneform.math.Vector3.set (Showing top 10 results out of 315)

origin: google-ar/sceneform-android-sdk

@Override
protected void onStart(HitTestResult hitTestResult, MotionEvent motionEvent) {
 debugLog("Started: " + pointerId);
 position.set(GesturePointersUtility.motionEventToPosition(motionEvent, pointerId));
 gesturePointersUtility.retainPointerId(pointerId);
}
origin: google-ar/sceneform-android-sdk

@Override
protected boolean updateGesture(HitTestResult hitTestResult, MotionEvent motionEvent) {
 int actionId = motionEvent.getPointerId(motionEvent.getActionIndex());
 int action = motionEvent.getActionMasked();
 if (action == MotionEvent.ACTION_MOVE) {
  Vector3 newPosition = GesturePointersUtility.motionEventToPosition(motionEvent, pointerId);
  if (!Vector3.equals(newPosition, position)) {
   delta.set(Vector3.subtract(newPosition, position));
   position.set(newPosition);
   debugLog("Updated: " + pointerId + " : " + position);
   return true;
  }
 } else if (actionId == pointerId
   && (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_POINTER_UP)) {
  complete();
 } else if (action == MotionEvent.ACTION_CANCEL) {
  cancel();
 }
 return false;
}
origin: google-ar/sceneform-android-sdk

@Override
protected boolean updateGesture(HitTestResult hitTestResult, MotionEvent motionEvent) {
 int actionId = motionEvent.getPointerId(motionEvent.getActionIndex());
 int action = motionEvent.getActionMasked();
 if (action == MotionEvent.ACTION_CANCEL) {
  cancel();
  return false;
 }
 boolean touchEnded = action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_POINTER_UP;
 if (touchEnded && (actionId == pointerId1 || actionId == pointerId2)) {
  complete();
  return false;
 }
 if (action != MotionEvent.ACTION_MOVE) {
  return false;
 }
 Vector3 newPosition1 = GesturePointersUtility.motionEventToPosition(motionEvent, pointerId1);
 Vector3 newPosition2 = GesturePointersUtility.motionEventToPosition(motionEvent, pointerId2);
 deltaRotationDegrees =
   calculateDeltaRotation(newPosition1, newPosition2, previousPosition1, previousPosition2);
 previousPosition1.set(newPosition1);
 previousPosition2.set(newPosition2);
 debugLog("Update: " + deltaRotationDegrees);
 return true;
}
origin: google-ar/sceneform-android-sdk

@Override
public boolean canStartTransformation(DragGesture gesture) {
 Node targetNode = gesture.getTargetNode();
 if (targetNode == null) {
  return false;
 }
 BaseTransformableNode transformableNode = getTransformableNode();
 if (targetNode != transformableNode && !targetNode.isDescendantOf(transformableNode)) {
  return false;
 }
 if (!transformableNode.isSelected() && !transformableNode.select()) {
  return false;
 }
 Vector3 initialForwardInWorld = transformableNode.getForward();
 Node parent = transformableNode.getParent();
 if (parent != null) {
  initialForwardInLocal.set(parent.worldToLocalDirection(initialForwardInWorld));
 } else {
  initialForwardInLocal.set(initialForwardInWorld);
 }
 return true;
}
origin: google-ar/sceneform-android-sdk

Vector3 deltaPosition1 = Vector3.subtract(newPosition1, previousPosition1);
Vector3 deltaPosition2 = Vector3.subtract(newPosition2, previousPosition2);
previousPosition1.set(newPosition1);
previousPosition2.set(newPosition2);
origin: googlesamples/sceneform-samples

    rightDirection.scaled(radius * cosTheta), upDirection.scaled(radius * sinTheta));
Vector3 normal = position.normalized();
position.set(Vector3.add(position, influencePoint));
origin: google-ar/sceneform-android-sdk

localPosition.set(-0.5f * image.getExtentX(), 0.0f, -0.5f * image.getExtentZ());
cornerNode = new Node();
cornerNode.setParent(this);
localPosition.set(0.5f * image.getExtentX(), 0.0f, -0.5f * image.getExtentZ());
cornerNode = new Node();
cornerNode.setParent(this);
localPosition.set(0.5f * image.getExtentX(), 0.0f, 0.5f * image.getExtentZ());
cornerNode = new Node();
cornerNode.setParent(this);
localPosition.set(-0.5f * image.getExtentX(), 0.0f, 0.5f * image.getExtentZ());
cornerNode = new Node();
cornerNode.setParent(this);
origin: google-ar/sceneform-android-sdk

Vector3 deltaPosition1 = Vector3.subtract(newPosition1, previousPosition1);
Vector3 deltaPosition2 = Vector3.subtract(newPosition2, previousPosition2);
previousPosition1.set(newPosition1);
previousPosition2.set(newPosition2);
origin: googlesamples/sceneform-samples

  Quaternion.rotateVector(rotationFromAToB, Vector3.right()).normalized();
Vector3 upDirection = Quaternion.rotateVector(rotationFromAToB, Vector3.up()).normalized();
desiredUp.set(upDirection);
origin: google-ar/sceneform-android-sdk

initialForwardInLocal.set(anchorNode.worldToLocalDirection(initialForwardInWorld));
com.google.ar.sceneform.mathVector3set

Popular methods of Vector3

  • <init>
  • up
  • subtract
  • forward
  • length
  • normalized
  • add
  • angleBetweenVectors
  • cross
  • dot
  • equals
  • lerp
  • equals,
  • lerp,
  • negated,
  • right,
  • scaled,
  • zero

Popular in Java

  • Running tasks concurrently on multiple threads
  • notifyDataSetChanged (ArrayAdapter)
  • requestLocationUpdates (LocationManager)
  • compareTo (BigDecimal)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • JButton (javax.swing)
  • JComboBox (javax.swing)
  • JFileChooser (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now