Skip to content

Instantly share code, notes, and snippets.

/* The triangle data structure. Each triangle contains three pointers to */
/* adjoining triangles, plus three pointers to vertices, plus three */
/* pointers to subsegments (declared below; these pointers are usually */
/* `dummysub'). It may or may not also contain user-defined attributes */
/* and/or a floating-point "area constraint." It may also contain extra */
/* pointers for nodes, when the user asks for high-order elements. */
/* Because the size and structure of a `triangle' is not decided until */
/* runtime, I haven't simply declared the type `triangle' as a struct. */
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.material.RenderState;
import com.jme3.math.FastMath;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.scene.control.AbstractControl;
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.FastMath;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.BatchNode;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.FastMath;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.BatchNode;
import com.jme3.scene.Geometry;
import com.jme3.scene.Node;
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000053309b00, pid=11588, tid=11248
#
# JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [nvoglv64.DLL+0xa99b00]
#
ShaderId: SimpleQuad{
Type: Executable
Stage: Fragment
Requirements{
TextureRead
NormalTransform
GBufferWrite
}
Parameters{
Attributes{
package com.lfe.engine.core.graphics.extensions;
import com.lfe.core.math.FloatArrayProvider;
import com.lfe.core.math.IntArrayProvider;
import com.lfe.engine.core.graphics.GraphicsContext;
import com.lfe.engine.core.graphics.gpuobjects.ShaderProgram;
import com.lfe.engine.core.graphics.gpuobjects.ShaderUniform;
import java.util.Map;
final Vector3f direction = new Quaternion().fromAngles(90 * FastMath.DEG_TO_RAD, 0, 0).mult(carNormal.clone().setX(0).normalize());
final Quaternion rotation = new Quaternion();
rotation.lookAt(direction, carNormal);
final Quaternion quaternion = new Quaternion().fromAngleAxis(carRotationAngle, Vector3f.UNIT_Y);
quaternion.multLocal(rotation);
carNode.setLocalRotation(rotation);
uniform mat4 g_WorldViewProjectionMatrix;
uniform float g_Time;
uniform int m_Tiles;
uniform int m_TilesPerRow;
attribute vec3 inPosition;
attribute vec2 inTexCoord;
varying vec2 texCoordAni;
private void calcStep(int stepX, int stepY, int stepDepth){
calcStep(stepX, stepY, stepDepth,true);
calcStep(stepX, stepY, stepDepth,false);
}
private void calcStep(int stepX, int stepY, int stepDepth, boolean calc) {
if (calc) {
int xDelta = stepX - xCenter;
int yDelta = stepY - yCenter;