Examples of ReadonlyVector3


Examples of com.ardor3d.math.type.ReadOnlyVector3

        switch (light.getType()) {
            case Directional: {
                final DirectionalLight dirLight = (DirectionalLight) light;

                final ReadOnlyVector3 direction = dirLight.getDirection();
                setPosition(index, record, -direction.getXf(), -direction.getYf(), -direction.getZf(), 0, lr);
                break;
            }
            case Point:
            case Spot: {
                final PointLight pointLight = (PointLight) light;
                final ReadOnlyVector3 location = pointLight.getLocation();
                setPosition(index, record, location.getXf(), location.getYf(), location.getZf(), 1, lr);
                break;
            }
        }

        if (light.getType() == Light.Type.Spot) {
            final SpotLight spot = (SpotLight) light;
            final ReadOnlyVector3 direction = spot.getDirection();
            setSpotCutoff(index, record, spot.getAngle(), lr);
            setSpotDirection(index, record, direction.getXf(), direction.getYf(), direction.getZf(), 0);
            setSpotExponent(index, record, spot.getExponent(), lr);
        } else {
            // set the cutoff to 180, which causes the other spot params to be
            // ignored.
            setSpotCutoff(index, record, 180, lr);
View Full Code Here

Examples of com.ardor3d.math.type.ReadOnlyVector3

        _zAxis = zAxis;
    }

    @Override
    public void applyFilter(final InteractManager manager) {
        final ReadOnlyVector3 oldScale = manager.getSpatialTarget().getScale();
        final SpatialState state = manager.getSpatialState();
        final ReadOnlyVector3 scale = state.getTransform().getScale();

        state.getTransform().setScale( //
                _xAxis ? scale.getX() : oldScale.getX(), //
                _yAxis ? scale.getY() : oldScale.getY(), //
                _zAxis ? scale.getZ() : oldScale.getZ());
    }
View Full Code Here

Examples of com.ardor3d.math.type.ReadOnlyVector3

    }

    @Override
    public void applyFilter(final InteractManager manager) {
        final SpatialState state = manager.getSpatialState();
        final ReadOnlyVector3 scale = state.getTransform().getScale();
        final double x = MathUtils.clamp(scale.getX(), _minScale.getX(), _maxScale.getX());
        final double y = MathUtils.clamp(scale.getY(), _minScale.getY(), _maxScale.getY());
        final double z = MathUtils.clamp(scale.getZ(), _minScale.getZ(), _maxScale.getZ());

        state.getTransform().setScale(x, y, z);
    }
View Full Code Here

Examples of com.ardor3d.math.type.ReadOnlyVector3

        torus.addController(new SpatialController<PQTorus>() {
            private double currentTime;

            public void update(final double time, final PQTorus caller) {
                currentTime += time * 0.2;
                final ReadOnlyVector3 t = caller.getTranslation();
                caller.setTranslation(Math.sin(currentTime) * 10.0, t.getY(), t.getZ());
            }
        });

        final FloatBuffer color1 = torus.getMeshData().getColorBuffer();
        color1.clear();
View Full Code Here

Examples of com.ardor3d.math.type.ReadOnlyVector3

    }

    @Override
    public void applyFilter(final InteractManager manager) {
        final SpatialState state = manager.getSpatialState();
        final ReadOnlyVector3 trans = state.getTransform().getTranslation();
        final double height = _terrain.getHeightAt(trans.getX(), trans.getZ());
        if (height != trans.getY()) {
            state.getTransform().translate(0, _offsetHeight + height - trans.getY(), 0);
        }
    }
View Full Code Here

Examples of com.ardor3d.math.type.ReadOnlyVector3

            // Add colladaNode to root
            _root.attachChild(colladaNode);

            // Setup camera
            ReadOnlyVector3 upAxis = Vector3.UNIT_Y;
            if (storage.getAssetData().getUpAxis() != null) {
                upAxis = storage.getAssetData().getUpAxis();
            }

            positionCamera(upAxis);
View Full Code Here

Examples of com.ardor3d.math.type.ReadOnlyVector3

    private void positionCamera(final ReadOnlyVector3 upAxis) {
        colladaNode.updateGeometricState(0.0);
        final BoundingVolume bounding = colladaNode.getWorldBound();
        if (bounding != null) {
            final ReadOnlyVector3 center = bounding.getCenter();
            double radius = 0;
            if (bounding instanceof BoundingSphere) {
                radius = ((BoundingSphere) bounding).getRadius();
            } else if (bounding instanceof BoundingBox) {
                final BoundingBox boundingBox = (BoundingBox) bounding;
View Full Code Here

Examples of libshapedraw.primitive.ReadonlyVector3

        curDimension = null;
    }

    @Override
    public boolean onTickInGame(float partialTick, Minecraft minecraft) {
        ReadonlyVector3 playerCoords = getPlayerCoords();

        // obf: Minecraft.theWorld, Minecraft.thePlayer
        if (curWorld != minecraft.theWorld || curPlayer != minecraft.thePlayer) {
            // obf: Minecraft.theWorld
            curWorld = minecraft.theWorld;
View Full Code Here

Examples of libshapedraw.primitive.ReadonlyVector3

        }
        final float blendEndpoint = getBlendEndpoint();

        // We can't use GL_LINE_STRIP in a single drawing session because each
        // line segment has its own style.
        ReadonlyVector3 pointA = it.next();
        ReadonlyVector3 pointB;
        int lineNum = 0;
        while (it.hasNext() && (renderCap < 0 || lineNum < renderCap)) {
            pointB = it.next();
            float percent = lineNum / blendEndpoint;
View Full Code Here

Examples of libshapedraw.primitive.ReadonlyVector3

        onPreRender(mc);
        final boolean absolute = !isRelativeToOrigin();
        if (absolute && transforms == null) {
            renderShape(mc);
        } else {
            final ReadonlyVector3 origin = getOriginReadonly();
            if (origin == null) {
                return;
            }
            GL11.glPushMatrix();
            GL11.glTranslated(origin.getX(), origin.getY(), origin.getZ());
            if (transforms != null) {
                for (ShapeTransform t : transforms) {
                    if (t != null) {
                        t.preRender();
                    }
                }
            }
            if (absolute) {
                GL11.glTranslated(-origin.getX(), -origin.getY(), -origin.getZ());
            }
            renderShape(mc);
            GL11.glPopMatrix();
        }
        onPostRender(mc);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.