Codota Logo
Vector3.set
Code IndexAdd Codota 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)

  • Common ways to obtain Vector3
private void myMethod () {
Vector3 v =
  • Codota IconVector3 vector32;Vector3 vector33;Vector3.subtract(vector32, vector33)
  • Smart code suggestions by Codota
}
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

  • Finding current android device location
  • getResourceAsStream (ClassLoader)
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • JOptionPane (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now