Package javax.vecmath

Examples of javax.vecmath.Quat4f.inverse()


        LocationComponent parentLoc = parent.getComponent(LocationComponent.class);
        if (parentLoc != null) {
            this.position.sub(parentLoc.getWorldPosition());
            this.position.scale(1f / parentLoc.getWorldScale());
            Quat4f rot = new Quat4f(0, 0, 0, 1);
            rot.inverse(parentLoc.getWorldRotation());
            QuaternionUtil.quatRotate(rot, this.position, this.position);
        }
    }

    public void setWorldRotation(Quat4f value) {
View Full Code Here


    public void setWorldRotation(Quat4f value) {
        this.rotation.set(value);
        LocationComponent parentLoc = parent.getComponent(LocationComponent.class);
        if (parentLoc != null) {
            Quat4f worldRot = parentLoc.getWorldRotation();
            worldRot.inverse();
            this.rotation.mul(worldRot, this.rotation);
        }
    }

    public void setWorldScale(float value) {
View Full Code Here

        Quat4f inverseRot = new Quat4f();
        for (int vertIndex = 0; vertIndex < vertices.size(); ++vertIndex) {
            Vector3f normal = normals.get(vertIndex);
            for (int weightIndex = 0; weightIndex < vertexWeightCounts.get(vertIndex); ++weightIndex) {
                BoneWeight weight = weights.get(weightIndex + vertexStartWeights.get(vertIndex));
                inverseRot.inverse(bones.get(weight.getBoneIndex()).getObjectRotation());
                QuaternionUtil.quatRotate(inverseRot, normal, norm);
                weight.setNormal(norm);
            }
        }
    }
View Full Code Here

    public Vector3f getLocalPosition() {
        Vector3f pos = new Vector3f(objectSpacePos);
        if (parent != null) {
            pos.sub(parent.getObjectPosition());
            Quat4f inverseParentRot = new Quat4f();
            inverseParentRot.inverse(parent.getObjectRotation());
            QuaternionUtil.quatRotate(inverseParentRot, pos, pos);
        }
        return pos;
    }
View Full Code Here

    public Quat4f getLocalRotation() {
        Quat4f rot = new Quat4f(rotation);
        if (parent != null) {
            Quat4f inverseParentRot = new Quat4f();
            inverseParentRot.inverse(parent.getObjectRotation());
            rot.mul(inverseParentRot, rot);
        }
        return rot;
    }
View Full Code Here

            skeletalMesh.material.bindTextures();

            LocationComponent location = entity.getComponent(LocationComponent.class);

            location.getWorldRotation(worldRot);
            inverseWorldRot.inverse(worldRot);
            location.getWorldPosition(worldPos);

            Vector3f worldPositionCameraSpace = new Vector3f();
            worldPositionCameraSpace.sub(worldPos, cameraPosition);
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.