/** * Sets the origin, which is used to calculate the distance from. * This method should not be called while sorting. If done anyway, the * contract of compare method will be broken and the sorting results * are undefined, if by chance no Exception is thrown. * * @param newOrigin the new location to calculate distances from. */ public void setOrigin(Vector3f newOrigin) { origin.set(newOrigin); }
public SubSampledNoise(Noise source, Vector3f zoom, int sampleRate) { this.source = source; this.zoom.set(zoom); this.sampleRate = sampleRate; }
public CharacterMoveInputEvent(CharacterMoveInputEvent repeatInput, int withLength) { this.delta = withLength; this.pitch = repeatInput.pitch; this.yaw = repeatInput.yaw; this.running = repeatInput.running; this.crouching = repeatInput.crouching; this.jumpRequested = false; this.movementDirection.set(repeatInput.movementDirection); this.sequenceNumber = repeatInput.sequenceNumber; }
public BoneWeight(Vector3f position, float bias, int boneIndex) { this.position.set(position); this.bias = bias; this.boneIndex = boneIndex; }
public SubSampledNoise3D(Noise3D source, Vector3f zoom, int sampleRate) { this.source = source; this.zoom.set(zoom); this.sampleRate = sampleRate; }
public Bone(int index, String name, Vector3f position, Quat4f rotation) { this.index = index; this.name = name; this.objectSpacePos.set(position); this.rotation.set(rotation); }
@Override public org.terasology.math.geom.Vector3f getLinearVelocity(org.terasology.math.geom.Vector3f out) { Vector3f vm = VecMath.to(out); rb.getLinearVelocity(vm); out.set(vm.x, vm.y, vm.z); return out; }
@Override public org.terasology.math.geom.Vector3f getAngularVelocity(org.terasology.math.geom.Vector3f out) { Vector3f vm = VecMath.to(out); rb.getAngularVelocity(vm); out.set(vm.x, vm.y, vm.z); return out; }
@Override public org.terasology.math.geom.Vector3f getLocation(org.terasology.math.geom.Vector3f out) { Vector3f vm = VecMath.to(out); rb.getCenterOfMassPosition(vm); out.set(vm.x, vm.y, vm.z); return out; }
/** * Randomises a provided Vector3f so its components range from min (inclusive) to max * * @param min * @param max * @param output * @return */ public Vector3f nextVector3f(float min, float max, Vector3f output) { output.set(nextFloat(min, max), nextFloat(min, max), nextFloat(min, max)); return output; }
/** * @return The reflection of direction against normal */ public static Vector3f reflect(Vector3f direction, Vector3f normal, Vector3f out) { out.set(normal); out.scale(-2.0f * direction.dot(normal)); out.add(direction); return out; }
@Override public SoundSource<T> setPosition(Vector3f value) { if (value == null || this.position.equals(value)) { return this; } this.position.set(value); alSource3f(getSourceId(), AL10.AL_POSITION, value.x, value.y, value.z); OpenALException.checkState("Changing sound position"); return this; }
@Override public SoundSource<T> setDirection(Vector3f value) { if (value == null || this.direction.equals(value)) { return this; } AL10.alSource3f(getSourceId(), AL10.AL_DIRECTION, value.x, value.y, value.z); OpenALException.checkState("Setting sound source direction"); this.direction.set(value); return this; }
PlayerStoreInternal(String id, EntityData.PlayerStore store, EngineEntityManager entityManager) { this.id = id; this.entityManager = entityManager; this.entityStore = store.getStore(); this.relevanceLocation.set(store.getCharacterPosX(), store.getCharacterPosY(), store.getCharacterPosZ()); this.hasCharacter = store.getHasCharacter(); }
@Command(shortDescription = "Sets the held item mount point translation for remote characters") public void setRemotePlayersHeldItemMountPointTranslations(@CommandParam("x") float x, @CommandParam("y") float y, @CommandParam("z") float z) { for (EntityRef remotePlayer : entityManager.getEntitiesWith(RemotePersonHeldItemMountPointComponent.class)) { RemotePersonHeldItemMountPointComponent remoteMountPointComponent = remotePlayer.getComponent(RemotePersonHeldItemMountPointComponent.class); remoteMountPointComponent.translate.set(x, y, z); } }
public Vector3f getWorldPosition(Vector3f output) { output.set(position); LocationComponent parentLoc = parent.getComponent(LocationComponent.class); while (parentLoc != null) { output.scale(parentLoc.scale); parentLoc.getLocalRotation().rotate(output, output); output.add(parentLoc.position); parentLoc = parentLoc.parent.getComponent(LocationComponent.class); } return output; }
@Command(shortDescription = "Sets the held item mount point rotation for remote characters") public void setRemotePlayersHeldItemMountPointRotations(@CommandParam("x") float x, @CommandParam("y") float y, @CommandParam("z") float z) { for (EntityRef remotePlayer : entityManager.getEntitiesWith(RemotePersonHeldItemMountPointComponent.class)) { RemotePersonHeldItemMountPointComponent remoteMountPointComponent = remotePlayer.getComponent(RemotePersonHeldItemMountPointComponent.class); remoteMountPointComponent.rotateDegrees.set(x, y, z); } }
@Override public void onEmission(final PositionRangeGeneratorComponent component, final ParticleData particleData, final Random random ) { particleData.position.set( random.nextFloat(component.minPosition.x(), component.maxPosition.x()), random.nextFloat(component.minPosition.y(), component.maxPosition.y()), random.nextFloat(component.minPosition.z(), component.maxPosition.z()) ); } }