/** * Copy this wheel's physics-space location to the specified vector. * * @param store storage for the result (not null, modified) */ public void getWheelWorldLocation(final Vector3f store) { store.set(this.wheelWorldLocation); }
/** * Creates an EnvironmentCamera with the given size, and the given position * * @param size the size of the resulting texture. * @param position the position of the camera. */ public EnvironmentCamera(int size, Vector3f position) { this.size = size; this.position.set(position); }
/** * only applies for AXIS_SWEEP broadphase * * @param worldMax */ public void setWorldMax(Vector3f worldMax) { this.worldMax.set(worldMax); }
/** * Sets the position of the bone in object space. * Warning: you need to call {@link #setUserControl(boolean)} with true to be able to do that operation * @param pos */ public void setLocalTranslation(Vector3f pos){ if (!userControl) { throw new IllegalStateException("User control must be on bone to allow user transforms"); } this.localPos.set(pos); }
/** * Sets the scale of the bone in object space. * Warning: you need to call {@link #setUserControl(boolean)} with true to be able to do that operation * @param scale the scale to apply */ public void setLocalScale(Vector3f scale){ if (!userControl) { throw new IllegalStateException("User control must be on bone to allow user transforms"); } this.localScale.set(scale); }
/** * Alter the character's view direction. Note this only defines the * orientation in the local X-Z plane. * * @param vec a direction vector (not null, unaffected) */ public void setViewDirection(Vector3f vec) { viewDirection.set(vec); updateLocalViewDirection(); }
/** * Sets the position of the LightProbe in world space * @param position the wolrd space position */ public void setPosition(Vector3f position) { this.position.set(position); area.setCenter(position); }
@Override protected Vector3f deserialize(int i, Vector3f store) { int j = i*getTupleSize(); store.set(array[j], array[j+1], array[j+2]); return store; } }
void set(float x, float y, float z) { float[] a = {x, y, z}; rotation.fromAngles(a); eulerAngles.set(x, y, z); } }
public void setVelocity(Vector3f velocity) { this.velocity.set(velocity); if (renderer != null) renderer.updateListenerParam(this, ListenerParam.Velocity); } }
private boolean pointsOnSameSide(Vector3f p1, Vector3f p2, Vector3f line1, Vector3f line2) { // V1 = (line2 - line1) x (p1 - line1) // V2 = (p2 - line1) x (line2 - line1) temp1.set(line2).subtractLocal(line1); temp3.set(temp1); temp2.set(p1).subtractLocal(line1); temp1.crossLocal(temp2); temp2.set(p2).subtractLocal(line1); temp3.crossLocal(temp2); // V1 . V2 >= 0 return temp1.dot(temp3) >= 0; }
public EmitterBoxShape(Vector3f min, Vector3f max) { if (min == null || max == null) { throw new IllegalArgumentException("min or max cannot be null"); } this.min = min; this.len = new Vector3f(); this.len.set(max).subtractLocal(min); }
public static void methodThatUsesAllocation(){ Vector3f vector = new Vector3f(); vector.set(0.1f, 0.2f, 0.3f); sumCompute.addLocal(vector); }
void set(Quaternion rot) { rotation.set(rot); float[] a = new float[3]; rotation.toAngles(a); eulerAngles.set(a[0], a[1], a[2]); }
/** * Updates the local X-Z view direction and the corresponding rotation * quaternion for the spatial. */ protected void updateLocalViewDirection() { //update local rotation quaternion to use for view rotation localForwardRotation.multLocal(rotatedViewDirection.set(viewDirection)); calculateNewForward(rotation, rotatedViewDirection, localUp); }
/** * Set the velocity of the audio node. The velocity is expected * to be in meters. Does nothing if the audio node is not positional. * * @param velocity The velocity to set. * @see AudioNode#setPositional(boolean) */ public void setVelocity(Vector3f velocity) { this.velocity.set(velocity); if (channel >= 0) getRenderer().updateSourceParam(this, AudioParam.Velocity); }
/** * Projects this vector onto another vector, stores the result in this * vector * * @param other The vector to project this vector onto * @return This Vector3f, set to the projection result */ public Vector3f projectLocal(Vector3f other){ float n = this.dot(other); // A . B float d = other.lengthSquared(); // |B|^2 return set(other).multLocal(n/d); }
public static void recursiveMethod(int recurse) { TempVars vars = TempVars.get(); { vars.vect1.set(0.1f, 0.2f, 0.3f); if (recurse < 4) { recursiveMethod(recurse + 1); } sumCompute.addLocal(vars.vect1); } vars.release(); }
public void setMinMax(Vector3f min, Vector3f max) { this.center.set(max).addLocal(min).multLocal(0.5f); xExtent = FastMath.abs(max.x - center.x); yExtent = FastMath.abs(max.y - center.y); zExtent = FastMath.abs(max.z - center.z); }
protected void computePosition() { float hDistance = (distance) * FastMath.sin((FastMath.PI / 2) - vRotation); pos.set(hDistance * FastMath.cos(rotation), (distance) * FastMath.sin(vRotation), hDistance * FastMath.sin(rotation)); pos.addLocal(target.getWorldTranslation()); }