Codota Logo
Vector3.<init>
Code IndexAdd Codota to your IDE (free)

How to use
com.google.ar.sceneform.math.Vector3
constructor

Best Java code snippets using com.google.ar.sceneform.math.Vector3.<init> (Showing top 18 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

public Vector3 getPosition() {
 return new Vector3(position);
}
origin: google-ar/sceneform-android-sdk

public Vector3 getDelta() {
 return new Vector3(delta);
}
origin: google-ar/sceneform-android-sdk

 public static Vector3 motionEventToPosition(MotionEvent me, int pointerId) {
  int index = me.findPointerIndex(pointerId);
  return new Vector3(me.getX(index), me.getY(index), 0.0f);
 }
}
origin: google-ar/sceneform-android-sdk

public TwistGesture(
  GesturePointersUtility gesturePointersUtility, MotionEvent motionEvent, int pointerId2) {
 super(gesturePointersUtility);
 pointerId1 = motionEvent.getPointerId(motionEvent.getActionIndex());
 this.pointerId2 = pointerId2;
 startPosition1 = GesturePointersUtility.motionEventToPosition(motionEvent, pointerId1);
 startPosition2 = GesturePointersUtility.motionEventToPosition(motionEvent, pointerId2);
 previousPosition1 = new Vector3(startPosition1);
 previousPosition2 = new Vector3(startPosition2);
 debugLog("Created");
}
origin: google-ar/sceneform-android-sdk

public PinchGesture(
  GesturePointersUtility gesturePointersUtility, MotionEvent motionEvent, int pointerId2) {
 super(gesturePointersUtility);
 pointerId1 = motionEvent.getPointerId(motionEvent.getActionIndex());
 this.pointerId2 = pointerId2;
 startPosition1 = GesturePointersUtility.motionEventToPosition(motionEvent, pointerId1);
 startPosition2 = GesturePointersUtility.motionEventToPosition(motionEvent, pointerId2);
 previousPosition1 = new Vector3(startPosition1);
 previousPosition2 = new Vector3(startPosition2);
 debugLog("Created");
}
origin: google-ar/sceneform-android-sdk

public DragGesture(
  GesturePointersUtility gesturePointersUtility,
  HitTestResult hitTestResult,
  MotionEvent motionEvent) {
 super(gesturePointersUtility);
 pointerId = motionEvent.getPointerId(motionEvent.getActionIndex());
 startPosition = GesturePointersUtility.motionEventToPosition(motionEvent, pointerId);
 position = new Vector3(startPosition);
 delta = Vector3.zero();
 targetNode = hitTestResult.getNode();
 debugLog("Created: " + pointerId);
}
origin: google-ar/sceneform-android-sdk

 /** Returns an ObjectAnimator that makes this node rotate. */
 private static ObjectAnimator createAnimator() {
  // Node's setLocalRotation method accepts Quaternions as parameters.
  // First, set up orientations that will animate a circle.
  Quaternion orientation1 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 0);
  Quaternion orientation2 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 120);
  Quaternion orientation3 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 240);
  Quaternion orientation4 = Quaternion.axisAngle(new Vector3(0.0f, 1.0f, 0.0f), 360);

  ObjectAnimator orbitAnimation = new ObjectAnimator();
  orbitAnimation.setObjectValues(orientation1, orientation2, orientation3, orientation4);

  // Next, give it the localRotation property.
  orbitAnimation.setPropertyName("localRotation");

  // Use Sceneform's QuaternionEvaluator.
  orbitAnimation.setEvaluator(new QuaternionEvaluator());

  //  Allow orbitAnimation to repeat forever
  orbitAnimation.setRepeatCount(ObjectAnimator.INFINITE);
  orbitAnimation.setRepeatMode(ObjectAnimator.RESTART);
  orbitAnimation.setInterpolator(new LinearInterpolator());
  orbitAnimation.setAutoCancel(true);

  return orbitAnimation;
 }
}
origin: google-ar/sceneform-android-sdk

@Override
public void onContinueTransformation(PinchGesture gesture) {
 currentScaleRatio += gesture.gapDeltaInches() * sensitivity;
 float finalScaleValue = getFinalScale();
 Vector3 finalScale = new Vector3(finalScaleValue, finalScaleValue, finalScaleValue);
 getTransformableNode().setLocalScale(finalScale);
 if (currentScaleRatio < -ELASTIC_RATIO_LIMIT
   || currentScaleRatio > (1.0f + ELASTIC_RATIO_LIMIT)) {
  gesture.cancel();
 }
}
origin: google-ar/sceneform-android-sdk

infoCard.setParent(this);
infoCard.setEnabled(false);
infoCard.setLocalPosition(new Vector3(0.0f, planetScale * INFO_CARD_Y_POS_COEFF, 0.0f));
planetVisual.setParent(this);
planetVisual.setRenderable(planetRenderable);
planetVisual.setLocalScale(new Vector3(planetScale, planetScale, planetScale));
origin: googlesamples/sceneform-samples

@SuppressWarnings("FutureReturnValueIgnored")
private void addMenuToNode(Node node, Vector3 localPosition) {
 ViewRenderable.builder()
   .setView(this, R.layout.material_options_view)
   .build()
   .thenAccept(
     viewRenderable -> {
      node.setRenderable(viewRenderable);
      node.setEnabled(false);
      node.setLocalPosition(localPosition);
      node.setWorldScale(new Vector3(.65f, .65f, .5f));
      setupMaterialMenu(viewRenderable, node);
     })
   .exceptionally(
     throwable -> {
      displayError(throwable);
      throw new CompletionException(throwable);
     });
}
origin: google-ar/sceneform-android-sdk

private Node createPlanet(
  String name,
  Node parent,
  float auFromParent,
  float orbitDegreesPerSecond,
  ModelRenderable renderable,
  float planetScale) {
 // Orbit is a rotating node with no renderable positioned at the sun.
 // The planet is positioned relative to the orbit so that it appears to rotate around the sun.
 // This is done instead of making the sun rotate so each planet can orbit at its own speed.
 RotatingNode orbit = new RotatingNode(solarSettings, true);
 orbit.setDegreesPerSecond(orbitDegreesPerSecond);
 orbit.setParent(parent);
 // Create the planet and position it relative to the sun.
 Planet planet = new Planet(this, name, planetScale, renderable, solarSettings);
 planet.setParent(orbit);
 planet.setLocalPosition(new Vector3(auFromParent * AU_TO_METERS, 0.0f, 0.0f));
 return planet;
}
origin: google-ar/sceneform-android-sdk

@Override
public void onUpdated(Node node, FrameTime frameTime) {
 if (isTransforming()) {
  return;
 }
 float t = MathHelper.clamp(frameTime.getDeltaSeconds() * LERP_SPEED, 0, 1);
 currentScaleRatio = MathHelper.lerp(currentScaleRatio, getClampedScaleRatio(), t);
 float finalScaleValue = getFinalScale();
 Vector3 finalScale = new Vector3(finalScaleValue, finalScaleValue, finalScaleValue);
 getTransformableNode().setLocalScale(finalScale);
}
origin: googlesamples/sceneform-samples

   boxRenderable =
     ShapeFactory.makeCube(
       CUBE_SIZE_METERS, new Vector3(0, CUBE_SIZE_METERS.y / 2, 0), boxMaterial);
  })
.exceptionally(
      anchorNode,
      shaderModel1,
      new Vector3(0.2f, MODEL_CUBE_HEIGHT_OFFSET_METERS, 0.0f));
  modelNode1.setLocalRotation(ROTATION_180_DEGREES);
      anchorNode,
      shaderModel2,
      new Vector3(-0.2f, MODEL_CUBE_HEIGHT_OFFSET_METERS, 0.0f));
  modelNode2.setLocalRotation(ROTATION_180_DEGREES);
  createMenuNode(modelNode1, new Vector3(0.0f, 0.35f, 0.0f));
  createMenuNode(modelNode2, new Vector3(0.0f, 0.35f, 0.0f));
  createShapeNode(anchorNode, boxRenderable, new Vector3(0.0f, 0.0f, 0.0f));
origin: google-ar/sceneform-android-sdk

sun.setLocalPosition(new Vector3(0.0f, 0.5f, 0.0f));
sunVisual.setLocalScale(new Vector3(0.5f, 0.5f, 0.5f));
solarControls.setLocalPosition(new Vector3(0.0f, 0.25f, 0.0f));
origin: googlesamples/sceneform-samples

private void setUpLights() {
 Light.Builder lightBuilder =
   Light.builder(Type.POINT)
     .setFalloffRadius(LIGHT_FALLOFF_RADIUS)
     .setShadowCastingEnabled(false)
     .setIntensity(intensityBar.getProgress());
 for (int i = 0; i < 4; i++) {
  // Sets the color of and creates the light.
  lightBuilder.setColor(ColorConfig.getColor(pointlightColorConfig, i));
  Light light = lightBuilder.build();
  // Create node and set its light.
  Vector3 localPosition =
    new Vector3(-0.4f + (i * .2f), POINTLIGHT_CUBE_HEIGHT_OFFSET_METERS, 0.0f);
  RotatingNode orbit = new RotatingNode();
  orbit.setParent(anchorNode);
  Node lightNode = new Node();
  lightNode.setParent(orbit);
  lightNode.setLocalPosition(localPosition);
  lightNode.setLight(light);
  //  Check if lights are currently switched on or off, and update accordingly.
  lightNode.setEnabled(toggleLights.isChecked());
  pointlightNodes.add(lightNode);
 }
 isLightingInitialized = true;
}
origin: google-ar/sceneform-android-sdk

float videoHeight = mediaPlayer.getVideoHeight();
videoNode.setLocalScale(
  new Vector3(
    VIDEO_HEIGHT_METERS * (videoWidth / videoHeight), VIDEO_HEIGHT_METERS, 1.0f));
origin: google-ar/sceneform-android-sdk

Vector3 localPosition = new Vector3();
Node cornerNode;
origin: google-ar/sceneform-android-sdk

Plane plane = (Plane) trackable;
if (plane.isPoseInPolygon(pose) && allowedPlaneTypes.contains(plane.getType())) {
 desiredLocalPosition = new Vector3(pose.tx(), pose.ty(), pose.tz());
 desiredLocalRotation = new Quaternion(pose.qx(), pose.qy(), pose.qz(), pose.qw());
 Node parent = getTransformableNode().getParent();
com.google.ar.sceneform.mathVector3<init>

Popular methods of Vector3

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

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
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