Java Code Examples for com.jme3.math.Matrix3f#IDENTITY

The following examples show how to use com.jme3.math.Matrix3f#IDENTITY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ParticleEmitter.java    From jmonkeyengine with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * Callback from Control.render(), do not use.
 *
 * @param rm
 * @param vp
 */
private void renderFromControl(RenderManager rm, ViewPort vp) {
    Camera cam = vp.getCamera();

    if (meshType == ParticleMesh.Type.Point) {
        float C = cam.getProjectionMatrix().m00;
        C *= cam.getWidth() * 0.5f;

        // send attenuation params
        this.getMaterial().setFloat("Quadratic", C);
    }

    Matrix3f inverseRotation = Matrix3f.IDENTITY;
    TempVars vars = null;
    if (!worldSpace) {
        vars = TempVars.get();

        inverseRotation = this.getWorldRotation().toRotationMatrix(vars.tempMat3).invertLocal();
    }
    particleMesh.updateParticleData(particles, cam, inverseRotation);
    if (!worldSpace) {
        vars.release();
    }
}
 
Example 2
Source File: MyParticleEmitter.java    From OpenRTS with MIT License 6 votes vote down vote up
/**
 * Callback from Control.render(), do not use.
 * 
 * @param rm
 * @param vp 
 */
private void renderFromControl(RenderManager rm, ViewPort vp) {
    Camera cam = vp.getCamera();

    if (meshType == ParticleMesh.Type.Point) {
        float C = cam.getProjectionMatrix().m00;
        C *= cam.getWidth() * 0.5f;

        // send attenuation params
        this.getMaterial().setFloat("Quadratic", C);
    }

    Matrix3f inverseRotation = Matrix3f.IDENTITY;
    TempVars vars = null;
    if (!worldSpace) {
        vars = TempVars.get();

        inverseRotation = this.getWorldRotation().toRotationMatrix(vars.tempMat3).invertLocal();
    }
    particleMesh.updateParticleData(particles, cam, inverseRotation);
    if (!worldSpace) {
        vars.release();
    }
}
 
Example 3
Source File: ParticleEmitter.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * Callback from Control.render(), do not use.
 * 
 * @param rm
 * @param vp 
 */
private void renderFromControl(RenderManager rm, ViewPort vp) {
    Camera cam = vp.getCamera();

    if (meshType == ParticleMesh.Type.Point) {
        float C = cam.getProjectionMatrix().m00;
        C *= cam.getWidth() * 0.5f;

        // send attenuation params
        this.getMaterial().setFloat("Quadratic", C);
    }

    Matrix3f inverseRotation = Matrix3f.IDENTITY;
    TempVars vars = null;
    if (!worldSpace) {
        vars = TempVars.get();

        inverseRotation = this.getWorldRotation().toRotationMatrix(vars.tempMat3).invertLocal();
    }
    particleMesh.updateParticleData(particles, cam, inverseRotation);
    if (!worldSpace) {
        vars.release();
    }
}