Codota Logo
Vector3.length
Code IndexAdd Codota to your IDE (free)

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

Best Java code snippets using com.google.ar.sceneform.math.Vector3.length (Showing top 9 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: googlesamples/sceneform-samples

private float getPerpendicularDistance(Vector3 start, Vector3 end, Vector3 point) {
 Vector3 crossProduct =
   Vector3.cross(Vector3.subtract(point, start), Vector3.subtract(point, end));
 float result = crossProduct.length() / Vector3.subtract(end, start).length();
 return result;
}
origin: googlesamples/sceneform-samples

private static void updateEndPointUV(List<Vertex> vertices) {
 // Update UV coordinates of ending vertices
 for (int edgeIndex = 0; edgeIndex <= NUMBER_OF_SIDES; edgeIndex++) {
  int vertexIndex = vertices.size() - edgeIndex - 1;
  Vertex currentVertex = vertices.get(vertexIndex);
  currentVertex.setUvCoordinate(
    new UvCoordinate(
      currentVertex.getUvCoordinate().x,
      (Vector3.subtract(
            vertices.get(vertexIndex).getPosition(),
            vertices.get(vertexIndex - NUMBER_OF_SIDES - 1).getPosition())
          .length()
        + vertices.get(vertexIndex - NUMBER_OF_SIDES - 1).getUvCoordinate().y)));
 }
}
origin: google-ar/sceneform-android-sdk

float diff = Vector3.subtract(newPosition, startPosition).length();
float slopPixels = gesturePointersUtility.inchesToPixels(SLOP_INCHES);
if (diff >= slopPixels) {
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);
 float newGap = Vector3.subtract(newPosition1, newPosition2).length();
 if (newGap == gap) {
  return false;
 }
 gapDelta = newGap - gap;
 gap = newGap;
 debugLog("Update: " + gapDelta);
 return true;
}
origin: google-ar/sceneform-android-sdk

private void updatePosition(FrameTime frameTime) {
 // Store in local variable for nullness static analysis.
 Vector3 desiredLocalPosition = this.desiredLocalPosition;
 if (desiredLocalPosition == null) {
  return;
 }
 Vector3 localPosition = getTransformableNode().getLocalPosition();
 float lerpFactor = MathHelper.clamp(frameTime.getDeltaSeconds() * LERP_SPEED, 0, 1);
 localPosition = Vector3.lerp(localPosition, desiredLocalPosition, lerpFactor);
 float lengthDiff = Math.abs(Vector3.subtract(desiredLocalPosition, localPosition).length());
 if (lengthDiff <= POSITION_LENGTH_THRESHOLD) {
  localPosition = desiredLocalPosition;
  this.desiredLocalPosition = null;
 }
 getTransformableNode().setLocalPosition(localPosition);
}
origin: googlesamples/sceneform-samples

public void add(Vector3 pointInWorld) {
 Vector3 pointInLocal = anchorNode.worldToLocalPoint(pointInWorld);
 List<Vector3> points = lineSimplifier.getPoints();
 if (getNumOfPoints() < 1) {
  lineSimplifier.add(pointInLocal);
  return;
 }
 Vector3 prev = points.get(points.size() - 1);
 Vector3 diff = Vector3.subtract(prev, pointInLocal);
 if (diff.length() < MINIMUM_DISTANCE_BETWEEN_POINTS) {
  return;
 }
 lineSimplifier.add(pointInLocal);
 RenderableDefinition renderableDefinition =
   ExtrudedCylinder.makeExtrudedCylinder(CYLINDER_RADIUS, points, material);
 if (shape == null) {
  shape = ModelRenderable.builder().setSource(renderableDefinition).build().join();
  node.setRenderable(shape);
 } else {
  shape.updateFromDefinition(renderableDefinition);
 }
}
origin: googlesamples/sceneform-samples

          position,
          vertices.get(previousSegmentVertexIndex).getPosition())
        .length()
      + vertices.get(previousSegmentVertexIndex).getUvCoordinate().y)))
.build();
origin: google-ar/sceneform-android-sdk

float startGap = firstToSecond.length();
gap = Vector3.subtract(newPosition1, newPosition2).length();
float separation = Math.abs(gap - startGap);
float slopPixels = gesturePointersUtility.inchesToPixels(SLOP_INCHES);
origin: googlesamples/sceneform-samples

final float halfHeight = difference.length() / 2;
final Vector3 center = Vector3.add(firstPoint, secondPoint).scaled(.5f);
com.google.ar.sceneform.mathVector3length

Popular methods of Vector3

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

Popular in Java

  • Start an intent from android
  • findViewById (Activity)
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • ImageIO (javax.imageio)
  • JLabel (javax.swing)
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