Merge remote-tracking branch 'upstream/master' into issue295
Conflicts: common.gradle
This commit is contained in:
commit
b84bd0d120
14
.gitignore
vendored
14
.gitignore
vendored
@ -5,8 +5,9 @@
|
||||
/dist/
|
||||
/build/
|
||||
/netbeans/
|
||||
/sdk/jdks/local/
|
||||
/jme3-core/build/
|
||||
/jme3-core/src/main/java/com/jme3/system/JmeVersion.java
|
||||
/jme3-core/src/main/resources/com/jme3/system/version.properties
|
||||
/jme3-plugins/build/
|
||||
/jme3-desktop/build/
|
||||
/jme3-android-native/build/
|
||||
@ -81,6 +82,7 @@
|
||||
/sdk/jme3-vehicle-creator/build/
|
||||
/sdk/jme3-welcome-screen/build/
|
||||
/sdk/jme3-glsl-support/build/
|
||||
/sdk/jme3-dark-laf/build/
|
||||
/sdk/nbproject/private/
|
||||
/sdk/jme3-scenecomposer/nbproject/private/
|
||||
/sdk/jme3-core/nbproject/private/
|
||||
@ -134,3 +136,13 @@
|
||||
!/jme3-bullet-native/libs/native/osx/x86_64/libbulletjme.dylib
|
||||
!/jme3-bullet-native/libs/native/linux/x86/libbulletjme.so
|
||||
!/jme3-bullet-native/libs/native/linux/x86_64/libbulletjme.so
|
||||
/.nb-gradle/
|
||||
/sdk/ant-jme/nbproject/private/
|
||||
/sdk/nbi/stub/ext/engine/nbproject/private/
|
||||
/sdk/nbi/stub/ext/components/products/jdk/nbproject/private/
|
||||
/sdk/nbi/stub/ext/components/products/blender/nbproject/private/
|
||||
/sdk/nbi/stub/ext/components/products/helloworld/nbproject/private/
|
||||
/sdk/BasicGameTemplate/nbproject/private/
|
||||
/sdk/nbi/stub/ext/components/products/jdk/build/
|
||||
/sdk/nbi/stub/ext/components/products/jdk/dist/
|
||||
/sdk/jme3-dark-laf/nbproject/private/
|
||||
|
20
.travis.yml
20
.travis.yml
@ -8,9 +8,9 @@ cache:
|
||||
- gradle-cache
|
||||
- netbeans
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
# branches:
|
||||
# only:
|
||||
# - master
|
||||
|
||||
notifications:
|
||||
slack:
|
||||
@ -25,16 +25,26 @@ install:
|
||||
script:
|
||||
- ./gradlew check
|
||||
- ./gradlew createZipDistribution
|
||||
- "[ $TRAVIS_BRANCH == 'master' ] && [ $TRAVIS_PULL_REQUEST == 'false' ] && ./gradlew uploadArchives || :"
|
||||
|
||||
before_deploy:
|
||||
- export RELEASE_DIST=$(ls build/distributions/*.zip)
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: "KbFiMt0a8FxUKvCJUYwikLYaqqGMn1p6k4OsXnGqwptQZEUIayabNLHeaD2kTNT3e6AY1ETwQLff/lB2LttmIo4g5NWW63g1K3A/HwgnhJwETengiProZ/Udl+ugPeDL/+ar43HUhFq4knBnzFKnEcHAThTPVqH/RMDvZf1UUYI="
|
||||
file: build/distributions/jME3.1.0_snapshot-github_2015-06-20.zip
|
||||
secure: PuEsJd6juXBH29ByITW3ntSAyrwWs0IeFvXJ5Y2YlhojhSMtTwkoWeB6YmDJWP4fhzbajk4TQ1HlOX2IxJXSW/8ShOEIUlGXz9fHiST0dkSM+iRAUgC5enCLW5ITPTiem7eY9ZhS9miIam7ngce9jHNMh75PTzZrEJtezoALT9w=
|
||||
file_glob: true
|
||||
file: "${RELEASE_DIST}"
|
||||
skip_cleanup: true
|
||||
on:
|
||||
repo: jMonkeyEngine/jmonkeyengine
|
||||
tags: true
|
||||
|
||||
before_install:
|
||||
- git fetch --unshallow
|
||||
- "[ $TRAVIS_PULL_REQUEST == 'false' ] && openssl aes-256-cbc -K $encrypted_a1949b55824a_key -iv $encrypted_a1949b55824a_iv -in private/www-updater.key.enc -out private/www-updater.key -d || :"
|
||||
|
||||
# before_install:
|
||||
# required libs for android build tools
|
||||
# sudo apt-get update
|
||||
|
58
build.gradle
58
build.gradle
@ -1,15 +1,17 @@
|
||||
import org.gradle.api.artifacts.*
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:1.1.0'
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:1.1.0'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'base'
|
||||
apply from: file('version.gradle')
|
||||
apply from: file('upload.gradle')
|
||||
|
||||
// This is applied to all sub projects
|
||||
subprojects {
|
||||
@ -58,15 +60,14 @@ task libDist(dependsOn: subprojects.build) << {
|
||||
}
|
||||
}
|
||||
|
||||
task createZipDistribution(type:Zip,dependsOn:["dist","libDist"], description:"Package the nightly zip distribution"){
|
||||
archiveName "jME"+jmeVersion+"_"+jmeVersionTag+"_"+new Date().format("yyyy-MM-dd")+".zip"
|
||||
|
||||
into("/") {
|
||||
from {"./dist"}
|
||||
}
|
||||
into("/sources") {
|
||||
from {"$buildDir/libDist/sources"}
|
||||
}
|
||||
task createZipDistribution(type:Zip,dependsOn:["dist","libDist"], description:"Package the nightly zip distribution"){
|
||||
archiveName "jME" + jmeFullVersion + ".zip"
|
||||
into("/") {
|
||||
from {"./dist"}
|
||||
}
|
||||
into("/sources") {
|
||||
from {"$buildDir/libDist/sources"}
|
||||
}
|
||||
}
|
||||
|
||||
task copyLibs(type: Copy){
|
||||
@ -114,7 +115,12 @@ task wrapper(type: Wrapper, description: 'Creates and deploys the Gradle wrapper
|
||||
gradleVersion = '2.2.1'
|
||||
}
|
||||
|
||||
String findNDK() {
|
||||
ext {
|
||||
ndkCommandPath = ""
|
||||
ndkExists = false
|
||||
}
|
||||
|
||||
task configureAndroidNDK {
|
||||
def ndkBuildFile = "ndk-build"
|
||||
// if windows, use ndk-build.cmd instead
|
||||
if (System.properties['os.name'].toLowerCase().contains('windows')) {
|
||||
@ -127,27 +133,13 @@ String findNDK() {
|
||||
if (System.env.ANDROID_NDK != null) {
|
||||
ndkBuildPath = System.env.ANDROID_NDK + File.separator + ndkBuildFile
|
||||
}
|
||||
|
||||
if (new File(ndkBuildPath).exists()) {
|
||||
return ndkBuildPath
|
||||
} else {
|
||||
return null
|
||||
ndkExists = true
|
||||
ndkCommandPath = ndkBuildPath
|
||||
}
|
||||
}
|
||||
|
||||
boolean checkNdkExists(String ndkCommandPath) {
|
||||
// String ndkCommandPath = findNDK()
|
||||
if (ndkCommandPath != null && new File(ndkCommandPath).exists()) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
ndkCommandPath = findNDK()
|
||||
ndkExists = checkNdkExists(ndkCommandPath)
|
||||
}
|
||||
|
||||
//class IncrementalReverseTask extends DefaultTask {
|
||||
// @InputDirectory
|
||||
// def File inputDir
|
||||
|
@ -4,10 +4,9 @@
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
group = 'com.jme3'
|
||||
version = jmeVersion + '-' + jmeVersionTag
|
||||
group = 'com.jme3'
|
||||
version = jmePomVersion
|
||||
|
||||
sourceCompatibility = '1.6'
|
||||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||
@ -19,11 +18,23 @@ repositories {
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
deployerJars
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Adding dependencies here will add the dependencies to each subproject.
|
||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.0.28-beta'
|
||||
testCompile group: 'org.easytesting', name: 'fest-assert-core', version: '2.0M10'
|
||||
deployerJars "org.apache.maven.wagon:wagon-ssh:2.9"
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes 'Implementation-Title': 'jMonkeyEngine',
|
||||
'Implementation-Version': jmeFullVersion
|
||||
}
|
||||
}
|
||||
|
||||
javadoc {
|
||||
@ -58,41 +69,35 @@ artifacts {
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
from components.java
|
||||
artifact sourcesJar
|
||||
artifact javadocJar
|
||||
|
||||
pom.withXml {
|
||||
asNode().children().last() + {
|
||||
resolveStrategy = Closure.DELEGATE_FIRST
|
||||
name POM_NAME
|
||||
description POM_DESCRIPTION
|
||||
url POM_URL
|
||||
scm {
|
||||
url POM_SCM_URL
|
||||
connection POM_SCM_CONNECTION
|
||||
developerConnection POM_SCM_DEVELOPER_CONNECTION
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name POM_LICENSE_NAME
|
||||
url POM_LICENSE_URL
|
||||
distribution POM_LICENSE_DISTRIBUTION
|
||||
}
|
||||
}
|
||||
uploadArchives {
|
||||
repositories.mavenDeployer {
|
||||
configuration = configurations.deployerJars
|
||||
|
||||
// disable this otherwise it will fill up the server with stale jars
|
||||
uniqueVersion = false
|
||||
|
||||
repository(url: "scp://updates.jmonkeyengine.org/var/www/updates/maven") {
|
||||
authentication(userName: "www-updater", privateKey: "private/www-updater.key")
|
||||
}
|
||||
|
||||
pom.project {
|
||||
name POM_NAME
|
||||
description POM_DESCRIPTION
|
||||
url POM_URL
|
||||
scm {
|
||||
url POM_SCM_URL
|
||||
connection POM_SCM_CONNECTION
|
||||
developerConnection POM_SCM_DEVELOPER_CONNECTION
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name POM_LICENSE_NAME
|
||||
url POM_LICENSE_URL
|
||||
distribution POM_LICENSE_DISTRIBUTION
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url "${rootProject.buildDir}/repo" // change to point to your repo, e.g. http://my.org/repo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task createFolders(description: 'Creates the source folders if they do not exist.') doLast {
|
||||
|
@ -3,7 +3,9 @@ jmeVersion = 3.1.0
|
||||
# Version used for application and settings folder, no spaces!
|
||||
jmeMainVersion = 3.1
|
||||
# Version addition pre-alpha-svn, Stable, Beta
|
||||
jmeVersionTag = snapshot-github
|
||||
jmeVersionTag = SNAPSHOT
|
||||
# Increment this each time jmeVersionTag changes but jmeVersion stays the same
|
||||
jmeVersionTagID = 0
|
||||
|
||||
# specify if JavaDoc should be built
|
||||
buildJavaDoc = true
|
||||
|
@ -145,7 +145,7 @@ public class Ipo {
|
||||
|
||||
float[] times = new float[framesAmount + 1];
|
||||
Vector3f[] translations = new Vector3f[framesAmount + 1];
|
||||
float[] translation = new float[] { localTranslation.x, localTranslation.y, localTranslation.z };
|
||||
float[] translation = new float[3];
|
||||
Quaternion[] rotations = new Quaternion[framesAmount + 1];
|
||||
float[] quaternionRotation = new float[] { localRotation.getX(), localRotation.getY(), localRotation.getZ(), localRotation.getW(), };
|
||||
float[] eulerRotation = localRotation.toAngles(null);
|
||||
@ -165,6 +165,8 @@ public class Ipo {
|
||||
|
||||
// calculating track data
|
||||
for (int frame = startFrame; frame <= stopFrame; ++frame) {
|
||||
boolean translationSet = false;
|
||||
translation[0] = translation[1] = translation[2] = 0;
|
||||
int index = frame - startFrame;
|
||||
times[index] = index * timeBetweenFrames;// start + (frame - 1) * timeBetweenFrames;
|
||||
for (int j = 0; j < bezierCurves.length; ++j) {
|
||||
@ -173,15 +175,18 @@ public class Ipo {
|
||||
// LOCATION
|
||||
case AC_LOC_X:
|
||||
translation[0] = (float) value;
|
||||
translationSet = true;
|
||||
break;
|
||||
case AC_LOC_Y:
|
||||
if (swapAxes && value != 0) {
|
||||
value = -value;
|
||||
}
|
||||
translation[yIndex] = (float) value;
|
||||
translationSet = true;
|
||||
break;
|
||||
case AC_LOC_Z:
|
||||
translation[zIndex] = (float) value;
|
||||
translationSet = true;
|
||||
break;
|
||||
|
||||
// EULER ROTATION
|
||||
@ -235,7 +240,11 @@ public class Ipo {
|
||||
LOGGER.log(Level.WARNING, "Unknown ipo curve type: {0}.", bezierCurves[j].getType());
|
||||
}
|
||||
}
|
||||
translations[index] = localRotation.multLocal(new Vector3f(translation[0], translation[1], translation[2]));
|
||||
if(translationSet) {
|
||||
translations[index] = localRotation.multLocal(new Vector3f(translation[0], translation[1], translation[2]));
|
||||
} else {
|
||||
translations[index] = new Vector3f();
|
||||
}
|
||||
|
||||
if(boneContext != null) {
|
||||
if(boneContext.getBone().getParent() == null && boneContext.is(BoneContext.NO_LOCAL_LOCATION)) {
|
||||
|
@ -811,39 +811,72 @@ extern "C" {
|
||||
/*
|
||||
* Class: com_jme3_bullet_objects_PhysicsRigidBody
|
||||
* Method: getAngularFactor
|
||||
* Signature: (J)F
|
||||
* Signature: (JLcom/jme3/math/Vector3f;)V
|
||||
*/
|
||||
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularFactor
|
||||
(JNIEnv *env, jobject object, jlong bodyId) {
|
||||
btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
|
||||
if (body == NULL) {
|
||||
jclass newExc = env->FindClass("java/lang/NullPointerException");
|
||||
env->ThrowNew(newExc, "The native object does not exist.");
|
||||
return 0;
|
||||
}
|
||||
return body->getAngularFactor().getX();
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: com_jme3_bullet_objects_PhysicsRigidBody
|
||||
* Method: setAngularFactor
|
||||
* Signature: (JF)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularFactor
|
||||
(JNIEnv *env, jobject object, jlong bodyId, jfloat value) {
|
||||
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularFactor
|
||||
(JNIEnv *env, jobject object, jlong bodyId, jobject factor) {
|
||||
btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
|
||||
if (body == NULL) {
|
||||
jclass newExc = env->FindClass("java/lang/NullPointerException");
|
||||
env->ThrowNew(newExc, "The native object does not exist.");
|
||||
return;
|
||||
}
|
||||
btVector3 vec1 = btVector3();
|
||||
vec1.setX(value);
|
||||
vec1.setY(value);
|
||||
vec1.setZ(value);
|
||||
body->setAngularFactor(vec1);
|
||||
jmeBulletUtil::convert(env, &body->getAngularFactor(), factor);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: com_jme3_bullet_objects_PhysicsRigidBody
|
||||
* Method: setAngularFactor
|
||||
* Signature: (JLcom/jme3/math/Vector3f;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularFactor
|
||||
(JNIEnv *env, jobject object, jlong bodyId, jobject factor) {
|
||||
btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
|
||||
if (body == NULL) {
|
||||
jclass newExc = env->FindClass("java/lang/NullPointerException");
|
||||
env->ThrowNew(newExc, "The native object does not exist.");
|
||||
return;
|
||||
}
|
||||
btVector3 vec = btVector3();
|
||||
jmeBulletUtil::convert(env, factor, &vec);
|
||||
body->setAngularFactor(vec);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: com_jme3_bullet_objects_PhysicsRigidBody
|
||||
* Method: getLinearFactor
|
||||
* Signature: (JLcom/jme3/math/Vector3f;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearFactor
|
||||
(JNIEnv *env, jobject object, jlong bodyId, jobject factor) {
|
||||
btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
|
||||
if (body == NULL) {
|
||||
jclass newExc = env->FindClass("java/lang/NullPointerException");
|
||||
env->ThrowNew(newExc, "The native object does not exist.");
|
||||
return;
|
||||
}
|
||||
jmeBulletUtil::convert(env, &body->getLinearFactor(), factor);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: com_jme3_bullet_objects_PhysicsRigidBody
|
||||
* Method: setLinearFactor
|
||||
* Signature: (JLcom/jme3/math/Vector3f;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearFactor
|
||||
(JNIEnv *env, jobject object, jlong bodyId, jobject factor) {
|
||||
btRigidBody* body = reinterpret_cast<btRigidBody*>(bodyId);
|
||||
if (body == NULL) {
|
||||
jclass newExc = env->FindClass("java/lang/NullPointerException");
|
||||
env->ThrowNew(newExc, "The native object does not exist.");
|
||||
return;
|
||||
}
|
||||
btVector3 vec = btVector3();
|
||||
jmeBulletUtil::convert(env, factor, &vec);
|
||||
body->setLinearFactor(vec);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -396,18 +396,35 @@ JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngula
|
||||
/*
|
||||
* Class: com_jme3_bullet_objects_PhysicsRigidBody
|
||||
* Method: getAngularFactor
|
||||
* Signature: (J)F
|
||||
* Signature: (JLcom/jme3/math/Vector3f;)V
|
||||
*/
|
||||
JNIEXPORT jfloat JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularFactor
|
||||
(JNIEnv *, jobject, jlong);
|
||||
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getAngularFactor
|
||||
(JNIEnv *, jobject, jlong, jobject);
|
||||
|
||||
|
||||
/*
|
||||
* Class: com_jme3_bullet_objects_PhysicsRigidBody
|
||||
* Method: setAngularFactor
|
||||
* Signature: (JF)V
|
||||
* Signature: (JLcom/jme3/math/Vector3f;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setAngularFactor
|
||||
(JNIEnv *, jobject, jlong, jfloat);
|
||||
(JNIEnv *, jobject, jlong, jobject);
|
||||
|
||||
/*
|
||||
* Class: com_jme3_bullet_objects_PhysicsRigidBody
|
||||
* Method: getLinearFactor
|
||||
* Signature: (JLcom/jme3/math/Vector3f;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_getLinearFactor
|
||||
(JNIEnv *, jobject, jlong, jobject);
|
||||
|
||||
/*
|
||||
* Class: com_jme3_bullet_objects_PhysicsRigidBody
|
||||
* Method: setLinearFactor
|
||||
* Signature: (JLcom/jme3/math/Vector3f;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_jme3_bullet_objects_PhysicsRigidBody_setLinearFactor
|
||||
(JNIEnv *, jobject, jlong, jobject);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -93,7 +93,9 @@ public class CapsuleCollisionShape extends CollisionShape{
|
||||
*/
|
||||
@Override
|
||||
public void setScale(Vector3f scale) {
|
||||
Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "CapsuleCollisionShape cannot be scaled");
|
||||
if (!scale.equals(Vector3f.UNIT_XYZ)) {
|
||||
Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "CapsuleCollisionShape cannot be scaled");
|
||||
}
|
||||
}
|
||||
|
||||
public void write(JmeExporter ex) throws IOException {
|
||||
|
@ -627,16 +627,44 @@ public class PhysicsRigidBody extends PhysicsCollisionObject {
|
||||
private native float getAngularSleepingThreshold(long objectId);
|
||||
|
||||
public float getAngularFactor() {
|
||||
return getAngularFactor(objectId);
|
||||
return getAngularFactor(null).getX();
|
||||
}
|
||||
|
||||
private native float getAngularFactor(long objectId);
|
||||
public Vector3f getAngularFactor(Vector3f store) {
|
||||
// doing like this prevent from breaking the API
|
||||
if (store == null) {
|
||||
store = new Vector3f();
|
||||
}
|
||||
getAngularFactor(objectId, store);
|
||||
return store;
|
||||
}
|
||||
|
||||
private native void getAngularFactor(long objectId, Vector3f vec);
|
||||
|
||||
public void setAngularFactor(float factor) {
|
||||
setAngularFactor(objectId, factor);
|
||||
setAngularFactor(objectId, new Vector3f(factor, factor, factor));
|
||||
}
|
||||
|
||||
private native void setAngularFactor(long objectId, float factor);
|
||||
public void setAngularFactor(Vector3f factor) {
|
||||
setAngularFactor(objectId, factor);
|
||||
}
|
||||
|
||||
private native void setAngularFactor(long objectId, Vector3f factor);
|
||||
|
||||
public Vector3f getLinearFactor() {
|
||||
Vector3f vec = new Vector3f();
|
||||
getLinearFactor(objectId, vec);
|
||||
return vec;
|
||||
}
|
||||
|
||||
private native void getLinearFactor(long objectId, Vector3f vec);
|
||||
|
||||
public void setLinearFactor(Vector3f factor) {
|
||||
setLinearFactor(objectId, factor);
|
||||
}
|
||||
|
||||
private native void setLinearFactor(long objectId, Vector3f factor);
|
||||
|
||||
|
||||
/**
|
||||
* do not use manually, joints are added automatically
|
||||
@ -673,7 +701,13 @@ public class PhysicsRigidBody extends PhysicsCollisionObject {
|
||||
capsule.write(getGravity(), "gravity", Vector3f.ZERO);
|
||||
capsule.write(getFriction(), "friction", 0.5f);
|
||||
capsule.write(getRestitution(), "restitution", 0);
|
||||
capsule.write(getAngularFactor(), "angularFactor", 1);
|
||||
Vector3f angularFactor = getAngularFactor(null);
|
||||
if (angularFactor.x == angularFactor.y && angularFactor.y == angularFactor.z) {
|
||||
capsule.write(getAngularFactor(), "angularFactor", 1);
|
||||
} else {
|
||||
capsule.write(getAngularFactor(null), "angularFactor", Vector3f.UNIT_XYZ);
|
||||
capsule.write(getLinearFactor(), "linearFactor", Vector3f.UNIT_XYZ);
|
||||
}
|
||||
capsule.write(kinematic, "kinematic", false);
|
||||
|
||||
capsule.write(getLinearDamping(), "linearDamping", 0);
|
||||
@ -703,7 +737,13 @@ public class PhysicsRigidBody extends PhysicsCollisionObject {
|
||||
setKinematic(capsule.readBoolean("kinematic", false));
|
||||
|
||||
setRestitution(capsule.readFloat("restitution", 0));
|
||||
setAngularFactor(capsule.readFloat("angularFactor", 1));
|
||||
Vector3f angularFactor = (Vector3f) capsule.readSavable("angularFactor", Vector3f.NAN.clone());
|
||||
if(angularFactor == Vector3f.NAN) {
|
||||
setAngularFactor(capsule.readFloat("angularFactor", 1));
|
||||
} else {
|
||||
setAngularFactor(angularFactor);
|
||||
setLinearFactor((Vector3f) capsule.readSavable("linearFactor", Vector3f.UNIT_XYZ.clone()));
|
||||
}
|
||||
setDamping(capsule.readFloat("linearDamping", 0), capsule.readFloat("angularDamping", 0));
|
||||
setSleepingThresholds(capsule.readFloat("linearSleepingThreshold", 0.8f), capsule.readFloat("angularSleepingThreshold", 1.0f));
|
||||
setCcdMotionThreshold(capsule.readFloat("ccdMotionThreshold", 0));
|
||||
|
@ -17,55 +17,23 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'org.ajoberstar:gradle-git:1.0.0-rc.1'
|
||||
}
|
||||
task updateVersionPropertiesFile << {
|
||||
def verfile = file('src/main/resources/com/jme3/system/version.properties')
|
||||
verfile.text = "# THIS IS AN AUTO-GENERATED FILE..\n" +
|
||||
"# DO NOT MODIFY!\n" +
|
||||
"build.date=${jmeBuildDate}\n" +
|
||||
"git.revision=${jmeRevision}\n" +
|
||||
"git.branch=${jmeBranchName}\n" +
|
||||
"git.hash=${jmeGitHash}\n" +
|
||||
"git.hash.short=${jmeShortGitHash}\n" +
|
||||
"git.tag=${jmeGitTag}\n" +
|
||||
"name.full=jMonkeyEngine ${jmeFullVersion}\n" +
|
||||
"version.full=${jmeFullVersion}\n" +
|
||||
"version.number=${jmeVersion}\n" +
|
||||
"version.tag=${jmeVersionTag}"
|
||||
}
|
||||
|
||||
import java.text.SimpleDateFormat
|
||||
import org.ajoberstar.grgit.*
|
||||
|
||||
task updateVersion << {
|
||||
|
||||
def verfile = file('src/main/java/com/jme3/system/JmeVersion.java')
|
||||
def jmeGitHash
|
||||
def jmeShortGitHash
|
||||
def jmeBuildDate
|
||||
def jmeBranchName
|
||||
|
||||
try {
|
||||
def grgit = Grgit.open(project.file('.').parent)
|
||||
jmeGitHash = grgit.head().id
|
||||
jmeShortGitHash = grgit.head().abbreviatedId
|
||||
jmeBuildDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date())
|
||||
jmeBranchName = grgit.branch.current.name
|
||||
} catch (ex) {
|
||||
// Failed to get repo info
|
||||
logger.warn("Failed to get repository info: " + ex.message + ". " + \
|
||||
"Only partial build info will be generated.")
|
||||
|
||||
jmeGitHash = ""
|
||||
jmeShortGitHash = ""
|
||||
jmeBuildDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date())
|
||||
jmeBranchName = "unknown"
|
||||
}
|
||||
|
||||
verfile.text = "\npackage com.jme3.system;\n\n" +
|
||||
"/**\n * THIS IS AN AUTO-GENERATED FILE..\n * DO NOT MODIFY!\n */\n" +
|
||||
"public class JmeVersion {\n" +
|
||||
" public static final String BUILD_DATE = \"${jmeBuildDate}\";\n" +
|
||||
" public static final String BRANCH_NAME = \"${jmeBranchName}\";\n" +
|
||||
" public static final String GIT_HASH = \"${jmeGitHash}\";\n" +
|
||||
" public static final String GIT_SHORT_HASH = \"${jmeShortGitHash}\";\n" +
|
||||
" public static final String FULL_NAME = \"jMonkeyEngine ${jmeVersion} (${jmeVersionTag})\";\n" +
|
||||
"}\n"
|
||||
}
|
||||
|
||||
compileJava.dependsOn(updateVersion)
|
||||
compileJava.dependsOn(updateVersionPropertiesFile)
|
||||
|
||||
dependencies {
|
||||
}
|
||||
|
@ -553,7 +553,6 @@ public final class Bone implements Savable {
|
||||
Vector3f translate = modelPos.add(rotate.mult(scale.mult(modelBindInversePos, tmp2), tmp2), tmp2);
|
||||
|
||||
// Populating the matrix
|
||||
outTransform.loadIdentity();
|
||||
outTransform.setTransform(translate, scale, rotate.toRotationMatrix(tmp4));
|
||||
}
|
||||
|
||||
|
@ -702,7 +702,9 @@ public class Cinematic extends AbstractCinematicEvent implements AppState {
|
||||
dispose();
|
||||
cinematicEvents.clear();
|
||||
timeLine.clear();
|
||||
eventsData.clear();
|
||||
if (eventsData != null) {
|
||||
eventsData.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -43,7 +43,7 @@ import com.jme3.export.JmeImporter;
|
||||
import com.jme3.export.OutputCapsule;
|
||||
import com.jme3.scene.Spatial;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
@ -431,15 +431,17 @@ public class AnimationEvent extends AbstractCinematicEvent {
|
||||
@Override
|
||||
public void dispose() {
|
||||
super.dispose();
|
||||
Object o = cinematic.getEventData(MODEL_CHANNELS, model);
|
||||
if (o != null) {
|
||||
ArrayList<AnimChannel> list = (ArrayList<AnimChannel>) o;
|
||||
list.remove(channel);
|
||||
if (list.isEmpty()) {
|
||||
cinematic.removeEventData(MODEL_CHANNELS, model);
|
||||
if (cinematic != null) {
|
||||
Object o = cinematic.getEventData(MODEL_CHANNELS, model);
|
||||
if (o != null) {
|
||||
Collection<AnimChannel> values = ((HashMap<Integer, AnimChannel>) o).values();
|
||||
while (values.remove(channel));
|
||||
if (values.isEmpty()) {
|
||||
cinematic.removeEventData(MODEL_CHANNELS, model);
|
||||
}
|
||||
}
|
||||
cinematic = null;
|
||||
channel = null;
|
||||
}
|
||||
cinematic = null;
|
||||
channel = null;
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ import com.jme3.math.Vector3f;
|
||||
import com.jme3.scene.CollisionData;
|
||||
import com.jme3.scene.Mesh;
|
||||
import com.jme3.scene.Mesh.Mode;
|
||||
import com.jme3.scene.VertexBuffer;
|
||||
import com.jme3.scene.VertexBuffer.Type;
|
||||
import com.jme3.scene.mesh.IndexBuffer;
|
||||
import com.jme3.scene.mesh.VirtualIndexBuffer;
|
||||
@ -114,8 +115,13 @@ public class BIHTree implements CollisionData {
|
||||
|
||||
bihSwapTmp = new float[9];
|
||||
|
||||
FloatBuffer vb = (FloatBuffer) mesh.getBuffer(Type.Position).getData();
|
||||
VertexBuffer vBuffer = mesh.getBuffer(Type.Position);
|
||||
if(vBuffer == null){
|
||||
throw new IllegalArgumentException("A mesh should at least contain a Position buffer");
|
||||
}
|
||||
IndexBuffer ib = mesh.getIndexBuffer();
|
||||
FloatBuffer vb = (FloatBuffer) vBuffer.getData();
|
||||
|
||||
if (ib == null) {
|
||||
ib = new VirtualIndexBuffer(mesh.getVertexCount(), mesh.getMode());
|
||||
} else if (mesh.getMode() != Mode.Triangles) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
||||
* Copyright (c) 2009-2012, 2015 jMonkeyEngine
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -32,6 +32,7 @@
|
||||
package com.jme3.light;
|
||||
|
||||
import com.jme3.bounding.BoundingBox;
|
||||
import com.jme3.math.ColorRGBA;
|
||||
import com.jme3.math.Vector3f;
|
||||
import com.jme3.renderer.Camera;
|
||||
import com.jme3.scene.Spatial;
|
||||
@ -49,6 +50,13 @@ import com.jme3.util.TempVars;
|
||||
*/
|
||||
public class AmbientLight extends Light {
|
||||
|
||||
public AmbientLight() {
|
||||
}
|
||||
|
||||
public AmbientLight(ColorRGBA color) {
|
||||
super(color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean intersectsBox(BoundingBox box, TempVars vars) {
|
||||
return true;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
||||
* Copyright (c) 2009-2012, 2015 jMonkeyEngine
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -36,6 +36,7 @@ import com.jme3.export.InputCapsule;
|
||||
import com.jme3.export.JmeExporter;
|
||||
import com.jme3.export.JmeImporter;
|
||||
import com.jme3.export.OutputCapsule;
|
||||
import com.jme3.math.ColorRGBA;
|
||||
import com.jme3.math.Vector3f;
|
||||
import com.jme3.renderer.Camera;
|
||||
import com.jme3.scene.Spatial;
|
||||
@ -53,6 +54,30 @@ public class DirectionalLight extends Light {
|
||||
|
||||
protected Vector3f direction = new Vector3f(0f, -1f, 0f);
|
||||
|
||||
/**
|
||||
* Creates a DirectionalLight
|
||||
*/
|
||||
public DirectionalLight() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a DirectionalLight with the given direction
|
||||
* @param direction the light's direction
|
||||
*/
|
||||
public DirectionalLight(Vector3f direction) {
|
||||
setDirection(direction);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a DirectionalLight with the given direction and the given color
|
||||
* @param direction the light's direction
|
||||
* @param color the light's color
|
||||
*/
|
||||
public DirectionalLight(Vector3f direction, ColorRGBA color) {
|
||||
super(color);
|
||||
setDirection(direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void computeLastDistance(Spatial owner) {
|
||||
lastDistance = 0; // directional lights are always closest to their owner
|
||||
@ -77,7 +102,7 @@ public class DirectionalLight extends Light {
|
||||
*
|
||||
* @param dir the direction of the light.
|
||||
*/
|
||||
public void setDirection(Vector3f dir){
|
||||
public final void setDirection(Vector3f dir){
|
||||
direction.set(dir);
|
||||
if (!direction.isUnitVector()) {
|
||||
direction.normalizeLocal();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
||||
* Copyright (c) 2009-2012, 2015 jMonkeyEngine
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -94,7 +94,7 @@ public abstract class Light implements Savable, Cloneable {
|
||||
}
|
||||
}
|
||||
|
||||
protected ColorRGBA color = new ColorRGBA(1f,1f,1f,1f);
|
||||
protected ColorRGBA color = new ColorRGBA(ColorRGBA.White);
|
||||
|
||||
/**
|
||||
* Used in LightList for caching the distance
|
||||
@ -115,6 +115,13 @@ public abstract class Light implements Savable, Cloneable {
|
||||
boolean frustumCheckNeeded = true;
|
||||
boolean intersectsFrustum = false;
|
||||
|
||||
protected Light() {
|
||||
}
|
||||
|
||||
protected Light(ColorRGBA color) {
|
||||
setColor(color);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the color of the light.
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
||||
* Copyright (c) 2009-2012, 2015 jMonkeyEngine
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -32,14 +32,13 @@
|
||||
package com.jme3.light;
|
||||
|
||||
import com.jme3.bounding.BoundingBox;
|
||||
import com.jme3.bounding.BoundingSphere;
|
||||
import com.jme3.bounding.BoundingVolume;
|
||||
import com.jme3.export.InputCapsule;
|
||||
import com.jme3.export.JmeExporter;
|
||||
import com.jme3.export.JmeImporter;
|
||||
import com.jme3.export.OutputCapsule;
|
||||
import com.jme3.math.ColorRGBA;
|
||||
import com.jme3.math.FastMath;
|
||||
import com.jme3.math.Plane;
|
||||
import com.jme3.math.Vector3f;
|
||||
import com.jme3.renderer.Camera;
|
||||
import com.jme3.scene.Spatial;
|
||||
@ -62,6 +61,52 @@ public class PointLight extends Light {
|
||||
protected float radius = 0;
|
||||
protected float invRadius = 0;
|
||||
|
||||
/**
|
||||
* Creates a PointLight
|
||||
*/
|
||||
public PointLight() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a PointLight at the given position
|
||||
* @param position the position in world space
|
||||
*/
|
||||
public PointLight(Vector3f position) {
|
||||
setPosition(position);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a PointLight at the given position and with the given color
|
||||
* @param position the position in world space
|
||||
* @param color the light color
|
||||
*/
|
||||
public PointLight(Vector3f position, ColorRGBA color) {
|
||||
super(color);
|
||||
setPosition(position);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a PointLight at the given position, with the given color and the
|
||||
* given radius
|
||||
* @param position the position in world space
|
||||
* @param color the light color
|
||||
* @param radius the light radius
|
||||
*/
|
||||
public PointLight(Vector3f position, ColorRGBA color, float radius) {
|
||||
this(position, color);
|
||||
setRadius(radius);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a PointLight at the given position, with the given radius
|
||||
* @param position the position in world space
|
||||
* @param radius the light radius
|
||||
*/
|
||||
public PointLight(Vector3f position, float radius) {
|
||||
this(position);
|
||||
setRadius(radius);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void computeLastDistance(Spatial owner) {
|
||||
if (owner.getWorldBound() != null) {
|
||||
@ -88,7 +133,7 @@ public class PointLight extends Light {
|
||||
*
|
||||
* @param position the world space position of the light.
|
||||
*/
|
||||
public void setPosition(Vector3f position) {
|
||||
public final void setPosition(Vector3f position) {
|
||||
this.position.set(position);
|
||||
}
|
||||
|
||||
@ -115,13 +160,13 @@ public class PointLight extends Light {
|
||||
*
|
||||
* @throws IllegalArgumentException If radius is negative
|
||||
*/
|
||||
public void setRadius(float radius) {
|
||||
public final void setRadius(float radius) {
|
||||
if (radius < 0) {
|
||||
throw new IllegalArgumentException("Light radius cannot be negative");
|
||||
}
|
||||
this.radius = radius;
|
||||
if (radius != 0) {
|
||||
this.invRadius = 1 / radius;
|
||||
if (radius != 0f) {
|
||||
this.invRadius = 1f / radius;
|
||||
} else {
|
||||
this.invRadius = 0;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2012 jMonkeyEngine
|
||||
* Copyright (c) 2009-2012, 2015 jMonkeyEngine
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -34,6 +34,7 @@ package com.jme3.light;
|
||||
import com.jme3.bounding.BoundingBox;
|
||||
import com.jme3.bounding.BoundingVolume;
|
||||
import com.jme3.export.*;
|
||||
import com.jme3.math.ColorRGBA;
|
||||
import com.jme3.math.FastMath;
|
||||
import com.jme3.math.Plane;
|
||||
import com.jme3.math.Vector3f;
|
||||
@ -44,36 +45,121 @@ import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Represents a spot light.
|
||||
* A spot light emmit a cone of light from a position and in a direction.
|
||||
* It can be used to fake torch lights or car's lights.
|
||||
* A spot light emits a cone of light from a position and in a direction.
|
||||
* It can be used to fake torch lights or cars' lights.
|
||||
* <p>
|
||||
* In addition to a position and a direction, spot lights also have a range which
|
||||
* can be used to attenuate the influence of the light depending on the
|
||||
* distance between the light and the effected object.
|
||||
* distance between the light and the affected object.
|
||||
* Also the angle of the cone can be tweaked by changing the spot inner angle and the spot outer angle.
|
||||
* the spot inner angle determin the cone of light where light has full influence.
|
||||
* the spot outer angle determin the cone global cone of light of the spot light.
|
||||
* the light intensity slowly decrease between the inner cone and the outer cone.
|
||||
* the spot inner angle determines the cone of light where light has full influence.
|
||||
* the spot outer angle determines the cone global cone of light of the spot light.
|
||||
* the light intensity slowly decreases between the inner cone and the outer cone.
|
||||
* @author Nehon
|
||||
*/
|
||||
public class SpotLight extends Light {
|
||||
|
||||
protected Vector3f position = new Vector3f();
|
||||
protected Vector3f direction = new Vector3f(0,-1,0);
|
||||
protected Vector3f direction = new Vector3f(0, -1, 0);
|
||||
protected float spotInnerAngle = FastMath.QUARTER_PI / 8;
|
||||
protected float spotOuterAngle = FastMath.QUARTER_PI / 6;
|
||||
protected float spotRange = 100;
|
||||
protected float invSpotRange = 1f / 100;
|
||||
protected float packedAngleCos=0;
|
||||
protected float packedAngleCos = 0;
|
||||
|
||||
protected float outerAngleCosSqr, outerAngleSinSqr;
|
||||
protected float outerAngleSinRcp, outerAngleSin, outerAngleCos;
|
||||
|
||||
/**
|
||||
* Creates a SpotLight.
|
||||
*/
|
||||
public SpotLight() {
|
||||
super();
|
||||
computeAngleParameters();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a SpotLight at the given position and with the given direction.
|
||||
* @param position the position in world space.
|
||||
* @param direction the direction of the light.
|
||||
*/
|
||||
public SpotLight(Vector3f position, Vector3f direction) {
|
||||
this();
|
||||
setPosition(position);
|
||||
setDirection(direction);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a SpotLight at the given position, with the given direction, and the
|
||||
* given range.
|
||||
* @param position the position in world space.
|
||||
* @param direction the direction of the light.
|
||||
* @param range the spot light range
|
||||
*/
|
||||
public SpotLight(Vector3f position, Vector3f direction, float range) {
|
||||
this();
|
||||
setPosition(position);
|
||||
setDirection(direction);
|
||||
this.spotRange = range;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a SpotLight at the given position, with the given direction and
|
||||
* the given color.
|
||||
* @param position the position in world space.
|
||||
* @param direction the direction of the light.
|
||||
* @param color the light's color.
|
||||
*/
|
||||
public SpotLight(Vector3f position, Vector3f direction, ColorRGBA color) {
|
||||
super(color);
|
||||
computeAngleParameters();
|
||||
setPosition(position);
|
||||
setDirection(direction);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a SpotLight at the given position, with the given direction,
|
||||
* the given range and the given color.
|
||||
* @param position the position in world space.
|
||||
* @param direction the direction of the light.
|
||||
* @param range the spot light range
|
||||
* @param color the light's color.
|
||||
*/
|
||||
public SpotLight(Vector3f position, Vector3f direction, float range, ColorRGBA color) {
|
||||
super(color);
|
||||
computeAngleParameters();
|
||||
setPosition(position);
|
||||
setDirection(direction);
|
||||
this.spotRange = range;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a SpotLight at the given position, with the given direction,
|
||||
* the given color and the given inner and outer angles
|
||||
* (controls the falloff of the light)
|
||||
*
|
||||
* @param position the position in world space.
|
||||
* @param direction the direction of the light.
|
||||
* @param range the spot light range
|
||||
* @param color the light's color.
|
||||
* @param innerAngle the inner angle of the spot light.
|
||||
* @param outerAngle the outer angle of the spot light.
|
||||
*
|
||||
* @see SpotLight#setSpotInnerAngle(float)
|
||||
* @see SpotLight#setSpotOuterAngle(float)
|
||||
*/
|
||||
public SpotLight(Vector3f position, Vector3f direction, float range, ColorRGBA color, float innerAngle, float outerAngle) {
|
||||
super(color);
|
||||
this.spotInnerAngle = innerAngle;
|
||||
this.spotOuterAngle = outerAngle;
|
||||
computeAngleParameters();
|
||||
setPosition(position);
|
||||
setDirection(direction);
|
||||
this.spotRange = range;
|
||||
}
|
||||
|
||||
|
||||
private void computeAngleParameters() {
|
||||
float innerCos = FastMath.cos(spotInnerAngle);
|
||||
outerAngleCos = FastMath.cos(spotOuterAngle);
|
||||
@ -189,7 +275,7 @@ public class SpotLight extends Light {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(Vector3f direction) {
|
||||
public final void setDirection(Vector3f direction) {
|
||||
this.direction.set(direction);
|
||||
}
|
||||
|
||||
@ -197,7 +283,7 @@ public class SpotLight extends Light {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(Vector3f position) {
|
||||
public final void setPosition(Vector3f position) {
|
||||
this.position.set(position);
|
||||
}
|
||||
|
||||
|
@ -154,53 +154,34 @@ public final class Matrix4f implements Savable, Cloneable, java.io.Serializable
|
||||
}
|
||||
|
||||
public void fromFrame(Vector3f location, Vector3f direction, Vector3f up, Vector3f left) {
|
||||
loadIdentity();
|
||||
|
||||
TempVars vars = TempVars.get();
|
||||
try {
|
||||
Vector3f fwdVector = vars.vect1.set(direction);
|
||||
Vector3f leftVector = vars.vect2.set(fwdVector).crossLocal(up);
|
||||
Vector3f upVector = vars.vect3.set(leftVector).crossLocal(fwdVector);
|
||||
|
||||
Vector3f f = vars.vect1.set(direction);
|
||||
Vector3f s = vars.vect2.set(f).crossLocal(up);
|
||||
Vector3f u = vars.vect3.set(s).crossLocal(f);
|
||||
// s.normalizeLocal();
|
||||
// u.normalizeLocal();
|
||||
m00 = leftVector.x;
|
||||
m01 = leftVector.y;
|
||||
m02 = leftVector.z;
|
||||
m03 = -leftVector.dot(location);
|
||||
|
||||
m00 = s.x;
|
||||
m01 = s.y;
|
||||
m02 = s.z;
|
||||
m10 = upVector.x;
|
||||
m11 = upVector.y;
|
||||
m12 = upVector.z;
|
||||
m13 = -upVector.dot(location);
|
||||
|
||||
m10 = u.x;
|
||||
m11 = u.y;
|
||||
m12 = u.z;
|
||||
m20 = -fwdVector.x;
|
||||
m21 = -fwdVector.y;
|
||||
m22 = -fwdVector.z;
|
||||
m23 = fwdVector.dot(location);
|
||||
|
||||
m20 = -f.x;
|
||||
m21 = -f.y;
|
||||
m22 = -f.z;
|
||||
|
||||
// m00 = -left.x;
|
||||
// m10 = -left.y;
|
||||
// m20 = -left.z;
|
||||
//
|
||||
// m01 = up.x;
|
||||
// m11 = up.y;
|
||||
// m21 = up.z;
|
||||
//
|
||||
// m02 = -direction.x;
|
||||
// m12 = -direction.y;
|
||||
// m22 = -direction.z;
|
||||
//
|
||||
|
||||
Matrix4f transMatrix = vars.tempMat4;
|
||||
transMatrix.loadIdentity();
|
||||
transMatrix.m03 = -location.x;
|
||||
transMatrix.m13 = -location.y;
|
||||
transMatrix.m23 = -location.z;
|
||||
this.multLocal(transMatrix);
|
||||
|
||||
vars.release();
|
||||
|
||||
// transMatrix.multLocal(this);
|
||||
|
||||
// set(transMatrix);
|
||||
m30 = 0f;
|
||||
m31 = 0f;
|
||||
m32 = 0f;
|
||||
m33 = 1f;
|
||||
} finally {
|
||||
vars.release();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -49,7 +49,7 @@ public final class Transform implements Savable, Cloneable, java.io.Serializable
|
||||
|
||||
private Quaternion rot = new Quaternion();
|
||||
private Vector3f translation = new Vector3f();
|
||||
private Vector3f scale = new Vector3f(1,1,1);
|
||||
private Vector3f scale = new Vector3f(1, 1, 1);
|
||||
|
||||
public Transform(Vector3f translation, Quaternion rot){
|
||||
this.translation.set(translation);
|
||||
@ -283,9 +283,32 @@ public final class Transform implements Savable, Cloneable, java.io.Serializable
|
||||
* Loads the identity. Equal to translation=0,0,0 scale=1,1,1 rot=0,0,0,1.
|
||||
*/
|
||||
public void loadIdentity() {
|
||||
translation.set(0,0,0);
|
||||
scale.set(1,1,1);
|
||||
rot.set(0,0,0,1);
|
||||
translation.set(0, 0, 0);
|
||||
scale.set(1, 1, 1);
|
||||
rot.set(0, 0, 0, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 89 * hash + rot.hashCode();
|
||||
hash = 89 * hash + translation.hashCode();
|
||||
hash = 89 * hash + scale.hashCode();
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final Transform other = (Transform) obj;
|
||||
return this.translation.equals(other.translation)
|
||||
&& this.scale.equals(other.scale)
|
||||
&& this.rot.equals(other.rot);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -307,22 +330,21 @@ public final class Transform implements Savable, Cloneable, java.io.Serializable
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JmeExporter e) throws IOException {
|
||||
OutputCapsule capsule = e.getCapsule(this);
|
||||
capsule.write(rot, "rot", new Quaternion());
|
||||
capsule.write(rot, "rot", Quaternion.IDENTITY);
|
||||
capsule.write(translation, "translation", Vector3f.ZERO);
|
||||
capsule.write(scale, "scale", Vector3f.UNIT_XYZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(JmeImporter e) throws IOException {
|
||||
InputCapsule capsule = e.getCapsule(this);
|
||||
|
||||
rot = (Quaternion)capsule.readSavable("rot", new Quaternion());
|
||||
translation = (Vector3f)capsule.readSavable("translation", null);
|
||||
if( translation == null ) {
|
||||
translation = new Vector3f();
|
||||
}
|
||||
scale = (Vector3f)capsule.readSavable("scale", Vector3f.UNIT_XYZ);
|
||||
rot.set((Quaternion)capsule.readSavable("rot", Quaternion.IDENTITY));
|
||||
translation.set((Vector3f)capsule.readSavable("translation", Vector3f.ZERO));
|
||||
scale.set((Vector3f)capsule.readSavable("scale", Vector3f.UNIT_XYZ));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -300,7 +300,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
|
||||
public void postFrame(FrameBuffer out) {
|
||||
|
||||
FrameBuffer sceneBuffer = renderFrameBuffer;
|
||||
if (renderFrameBufferMS != null && !renderer.getCaps().contains(Caps.OpenGL31)) {
|
||||
if (renderFrameBufferMS != null && !renderer.getCaps().contains(Caps.OpenGL32)) {
|
||||
renderer.copyFrameBuffer(renderFrameBufferMS, renderFrameBuffer, true);
|
||||
} else if (renderFrameBufferMS != null) {
|
||||
sceneBuffer = renderFrameBufferMS;
|
||||
@ -443,7 +443,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
|
||||
//antialiasing on filters only supported in opengl 3 due to depth read problem
|
||||
if (numSamples > 1 && caps.contains(Caps.FrameBufferMultisample)) {
|
||||
renderFrameBufferMS = new FrameBuffer(width, height, numSamples);
|
||||
if (caps.contains(Caps.OpenGL31)) {
|
||||
if (caps.contains(Caps.OpenGL32)) {
|
||||
Texture2D msColor = new Texture2D(width, height, numSamples, fbFormat);
|
||||
Texture2D msDepth = new Texture2D(width, height, numSamples, Format.Depth);
|
||||
renderFrameBufferMS.setDepthTexture(msDepth);
|
||||
@ -456,7 +456,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
|
||||
}
|
||||
}
|
||||
|
||||
if (numSamples <= 1 || !caps.contains(Caps.OpenGL31)) {
|
||||
if (numSamples <= 1 || !caps.contains(Caps.OpenGL32)) {
|
||||
renderFrameBuffer = new FrameBuffer(width, height, 1);
|
||||
renderFrameBuffer.setDepthBuffer(Format.Depth);
|
||||
filterTexture = new Texture2D(width, height, fbFormat);
|
||||
|
@ -161,6 +161,7 @@ public interface GL {
|
||||
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
|
||||
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
|
||||
public static final int GL_TEXTURE_BASE_LEVEL = 0x813C;
|
||||
public static final int GL_TEXTURE_MAG_FILTER = 0x2800;
|
||||
public static final int GL_TEXTURE_MAX_LEVEL = 0x813D;
|
||||
public static final int GL_TEXTURE_MIN_FILTER = 0x2801;
|
||||
|
@ -376,7 +376,9 @@ public class GLRenderer implements Renderer {
|
||||
caps.add(Caps.TextureFilterAnisotropic);
|
||||
}
|
||||
|
||||
if (hasExtension("GL_EXT_framebuffer_object") || gl3 != null) {
|
||||
if (hasExtension("GL_EXT_framebuffer_object")
|
||||
|| gl3 != null
|
||||
|| caps.contains(Caps.OpenGLES20)) {
|
||||
caps.add(Caps.FrameBuffer);
|
||||
|
||||
limits.put(Limits.RenderBufferSize, getInteger(GLFbo.GL_MAX_RENDERBUFFER_SIZE_EXT));
|
||||
@ -401,7 +403,7 @@ public class GLRenderer implements Renderer {
|
||||
}
|
||||
}
|
||||
|
||||
if (hasExtension("GL_ARB_draw_buffers")) {
|
||||
if (hasExtension("GL_ARB_draw_buffers") || gl3 != null) {
|
||||
limits.put(Limits.FrameBufferMrtAttachments, getInteger(GLExt.GL_MAX_DRAW_BUFFERS_ARB));
|
||||
if (limits.get(Limits.FrameBufferMrtAttachments) > 1) {
|
||||
caps.add(Caps.FrameBufferMRT);
|
||||
@ -1064,6 +1066,9 @@ public class GLRenderer implements Renderer {
|
||||
stringBuf.append("\n");
|
||||
} else {
|
||||
if (gles2) {
|
||||
// request GLSL ES (1.00) when compiling under GLES2.
|
||||
stringBuf.append("#version 100\n");
|
||||
|
||||
if (source.getType() == ShaderType.Fragment) {
|
||||
// GLES2 requires precision qualifier.
|
||||
stringBuf.append("precision mediump float;\n");
|
||||
@ -1080,6 +1085,7 @@ public class GLRenderer implements Renderer {
|
||||
if (linearizeSrgbImages) {
|
||||
stringBuf.append("#define SRGB 1\n");
|
||||
}
|
||||
stringBuf.append("#define ").append(source.getType().name().toUpperCase()).append("_SHADER 1\n");
|
||||
|
||||
stringBuf.append(source.getDefines());
|
||||
stringBuf.append(source.getSource());
|
||||
|
@ -90,9 +90,11 @@ final class TextureUtil {
|
||||
}
|
||||
|
||||
public GLImageFormat getImageFormatWithError(Format fmt, boolean isSrgb) {
|
||||
//if the passed format is one kind of depth there isno point in getting the srgb format;
|
||||
isSrgb = isSrgb && fmt != Format.Depth && fmt != Format.Depth16 && fmt != Format.Depth24 && fmt != Format.Depth24Stencil8 && fmt != Format.Depth32 && fmt != Format.Depth32F;
|
||||
GLImageFormat glFmt = getImageFormat(fmt, isSrgb);
|
||||
if (glFmt == null && isSrgb) {
|
||||
glFmt = getImageFormat(fmt, false);
|
||||
glFmt = getImageFormat(fmt, false);
|
||||
logger.log(Level.WARNING, "No sRGB format available for ''{0}''. Failling back to linear.", fmt);
|
||||
}
|
||||
if (glFmt == null) {
|
||||
|
@ -444,6 +444,7 @@ public class BatchNode extends GeometryGroupNode {
|
||||
int maxWeights = -1;
|
||||
|
||||
Mesh.Mode mode = null;
|
||||
float lineWidth = 1f;
|
||||
for (Geometry geom : geometries) {
|
||||
totalVerts += geom.getVertexCount();
|
||||
totalTris += geom.getTriangleCount();
|
||||
@ -452,6 +453,7 @@ public class BatchNode extends GeometryGroupNode {
|
||||
maxVertCount = geom.getVertexCount();
|
||||
}
|
||||
Mesh.Mode listMode;
|
||||
float listLineWidth = 1f;
|
||||
int components;
|
||||
switch (geom.getMesh().getMode()) {
|
||||
case Points:
|
||||
@ -462,6 +464,7 @@ public class BatchNode extends GeometryGroupNode {
|
||||
case LineStrip:
|
||||
case Lines:
|
||||
listMode = Mesh.Mode.Lines;
|
||||
listLineWidth = geom.getMesh().getLineWidth();
|
||||
components = 2;
|
||||
break;
|
||||
case TriangleFan:
|
||||
@ -491,13 +494,21 @@ public class BatchNode extends GeometryGroupNode {
|
||||
if (mode != null && mode != listMode) {
|
||||
throw new UnsupportedOperationException("Cannot combine different"
|
||||
+ " primitive types: " + mode + " != " + listMode);
|
||||
}
|
||||
}
|
||||
mode = listMode;
|
||||
if (mode == Mesh.Mode.Lines) {
|
||||
if (lineWidth != 1f && listLineWidth != lineWidth) {
|
||||
throw new UnsupportedOperationException("When using Mesh Line mode, cannot combine meshes with different line width "
|
||||
+ lineWidth + " != " + listLineWidth);
|
||||
}
|
||||
lineWidth = listLineWidth;
|
||||
}
|
||||
compsForBuf[VertexBuffer.Type.Index.ordinal()] = components;
|
||||
}
|
||||
|
||||
outMesh.setMaxNumWeights(maxWeights);
|
||||
outMesh.setMode(mode);
|
||||
outMesh.setLineWidth(lineWidth);
|
||||
if (totalVerts >= 65536) {
|
||||
// make sure we create an UnsignedInt buffer so
|
||||
// we can fit all of the meshes
|
||||
|
@ -54,6 +54,8 @@ import java.util.prefs.Preferences;
|
||||
*/
|
||||
public final class AppSettings extends HashMap<String, Object> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final AppSettings defaults = new AppSettings(false);
|
||||
|
||||
/**
|
||||
|
66
jme3-core/src/main/java/com/jme3/system/JmeVersion.java
Normal file
66
jme3-core/src/main/java/com/jme3/system/JmeVersion.java
Normal file
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2015 jMonkeyEngine
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package com.jme3.system;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* Pulls in version info from the version.properties file.
|
||||
*
|
||||
* @author Kirill Vainer
|
||||
*/
|
||||
public class JmeVersion {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(JmeVersion.class.getName());
|
||||
private static final Properties props = new Properties();
|
||||
|
||||
static {
|
||||
try {
|
||||
props.load(JmeVersion.class.getResourceAsStream("version.properties"));
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Unable to read version info!", ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static final String BUILD_DATE = props.getProperty("build.date", "1900-01-01");
|
||||
public static final String BRANCH_NAME = props.getProperty("git.branch", "unknown");
|
||||
public static final String GIT_HASH = props.getProperty("git.hash", "");
|
||||
public static final String GIT_SHORT_HASH = props.getProperty("git.hash.short", "");
|
||||
public static final String GIT_TAG = props.getProperty("git.tag", "");
|
||||
public static final String VERSION_NUMBER = props.getProperty("version.number", "");
|
||||
public static final String VERSION_TAG = props.getProperty("version.tag", "");
|
||||
public static final String VERSION_FULL = props.getProperty("version.full", "");
|
||||
public static final String FULL_NAME = props.getProperty("name.full", "jMonkeyEngine (unknown version)");
|
||||
}
|
@ -36,6 +36,7 @@ import com.jme3.math.Quaternion;
|
||||
import com.jme3.math.Vector2f;
|
||||
import com.jme3.math.Vector3f;
|
||||
import com.jme3.math.Vector4f;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.ref.PhantomReference;
|
||||
import java.lang.ref.Reference;
|
||||
import java.lang.ref.ReferenceQueue;
|
||||
@ -1010,11 +1011,15 @@ public final class BufferUtils {
|
||||
}
|
||||
|
||||
public static ByteBuffer createByteBuffer(String data) {
|
||||
byte[] bytes = data.getBytes();
|
||||
ByteBuffer bb = createByteBuffer(bytes.length);
|
||||
bb.put(bytes);
|
||||
bb.flip();
|
||||
return bb;
|
||||
try {
|
||||
byte[] bytes = data.getBytes("UTF-8");
|
||||
ByteBuffer bb = createByteBuffer(bytes.length);
|
||||
bb.put(bytes);
|
||||
bb.flip();
|
||||
return bb;
|
||||
} catch (UnsupportedEncodingException ex) {
|
||||
throw new UnsupportedOperationException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -42,7 +42,6 @@ import java.io.*;
|
||||
public class LittleEndien extends InputStream implements DataInput {
|
||||
|
||||
protected BufferedInputStream in;
|
||||
protected BufferedReader inRead;
|
||||
|
||||
/**
|
||||
* Creates a new LittleEndien reader from the given input stream. The
|
||||
@ -51,7 +50,6 @@ public class LittleEndien extends InputStream implements DataInput {
|
||||
*/
|
||||
public LittleEndien(InputStream in) {
|
||||
this.in = new BufferedInputStream(in);
|
||||
inRead = new BufferedReader(new InputStreamReader(in));
|
||||
}
|
||||
|
||||
public int read() throws IOException {
|
||||
@ -141,7 +139,7 @@ public class LittleEndien extends InputStream implements DataInput {
|
||||
}
|
||||
|
||||
public String readLine() throws IOException {
|
||||
return inRead.readLine();
|
||||
throw new IOException("Unsupported operation");
|
||||
}
|
||||
|
||||
public String readUTF() throws IOException {
|
||||
|
@ -1,3 +1,4 @@
|
||||
Exception This material definition is deprecated. Please use Unshaded.j3md instead.
|
||||
MaterialDef Colored Textured {
|
||||
|
||||
MaterialParameters {
|
||||
@ -17,4 +18,4 @@ MaterialDef Colored Textured {
|
||||
Technique {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
#import "Common/ShaderLib/GLSLCompat.glsllib"
|
||||
|
||||
#if defined(HAS_GLOWMAP) || defined(HAS_COLORMAP) || (defined(HAS_LIGHTMAP) && !defined(SEPARATE_TEXCOORD))
|
||||
#define NEED_TEXCOORD1
|
||||
#endif
|
||||
|
@ -13,7 +13,7 @@ MaterialDef Unshaded {
|
||||
Color GlowColor
|
||||
|
||||
// For instancing
|
||||
Boolean UseInstancing
|
||||
Boolean UseInstancing
|
||||
|
||||
// For hardware skinning
|
||||
Int NumberOfBones
|
||||
@ -54,8 +54,8 @@ MaterialDef Unshaded {
|
||||
}
|
||||
|
||||
Technique {
|
||||
VertexShader GLSL100: Common/MatDefs/Misc/Unshaded.vert
|
||||
FragmentShader GLSL100: Common/MatDefs/Misc/Unshaded.frag
|
||||
VertexShader GLSL150: Common/MatDefs/Misc/Unshaded.vert
|
||||
FragmentShader GLSL150: Common/MatDefs/Misc/Unshaded.frag
|
||||
|
||||
WorldParameters {
|
||||
WorldViewProjectionMatrix
|
||||
@ -76,6 +76,25 @@ MaterialDef Unshaded {
|
||||
}
|
||||
|
||||
Technique {
|
||||
VertexShader GLSL100: Common/MatDefs/Misc/Unshaded.vert
|
||||
FragmentShader GLSL100: Common/MatDefs/Misc/Unshaded.frag
|
||||
|
||||
WorldParameters {
|
||||
WorldViewProjectionMatrix
|
||||
ViewProjectionMatrix
|
||||
ViewMatrix
|
||||
}
|
||||
|
||||
Defines {
|
||||
INSTANCING : UseInstancing
|
||||
SEPARATE_TEXCOORD : SeparateTexCoord
|
||||
HAS_COLORMAP : ColorMap
|
||||
HAS_LIGHTMAP : LightMap
|
||||
HAS_VERTEXCOLOR : VertexColor
|
||||
HAS_COLOR : Color
|
||||
NUM_BONES : NumberOfBones
|
||||
DISCARD_ALPHA : AlphaDiscardThreshold
|
||||
}
|
||||
}
|
||||
|
||||
Technique PreNormalPass {
|
||||
|
@ -1,3 +1,4 @@
|
||||
#import "Common/ShaderLib/GLSLCompat.glsllib"
|
||||
#import "Common/ShaderLib/Skinning.glsllib"
|
||||
#import "Common/ShaderLib/Instancing.glsllib"
|
||||
|
||||
|
@ -1,14 +0,0 @@
|
||||
#if _VERSION_ >= 150
|
||||
out vec4 outFragColor;
|
||||
# define texture1D texture
|
||||
# define texture2D texture
|
||||
# define texture3D texture
|
||||
# define texture2DLod texture
|
||||
# if defined VERTEX_SHADER
|
||||
# define varying out
|
||||
# define attribute in
|
||||
# elif defined FRAGMENT_SHADER
|
||||
# define varying in
|
||||
# define gl_FragColor outFragColor
|
||||
# endif
|
||||
#endif
|
@ -0,0 +1,34 @@
|
||||
#if defined _GL_ES_
|
||||
# define hfloat highp float
|
||||
# define hvec2 highp vec2
|
||||
# define hvec3 highp vec3
|
||||
# define hvec4 highp vec4
|
||||
# define lfloat lowp float
|
||||
# define lvec2 lowp vec2
|
||||
# define lvec3 lowp vec3
|
||||
# define lvec4 lowp vec4
|
||||
#else
|
||||
# define hfloat float
|
||||
# define hvec2 vec2
|
||||
# define hvec3 vec3
|
||||
# define hvec4 vec4
|
||||
# define lfloat float
|
||||
# define lvec2 vec2
|
||||
# define lvec3 vec3
|
||||
# define lvec4 vec4
|
||||
#endif
|
||||
|
||||
#if __VERSION__ >= 130
|
||||
out vec4 outFragColor;
|
||||
# define texture1D texture
|
||||
# define texture2D texture
|
||||
# define texture3D texture
|
||||
# define texture2DLod texture
|
||||
# if defined VERTEX_SHADER
|
||||
# define varying out
|
||||
# define attribute in
|
||||
# elif defined FRAGMENT_SHADER
|
||||
# define varying in
|
||||
# define gl_FragColor outFragColor
|
||||
# endif
|
||||
#endif
|
@ -0,0 +1,11 @@
|
||||
# THIS IS AN AUTO-GENERATED FILE..
|
||||
# DO NOT MODIFY!
|
||||
build.date=1900-01-01
|
||||
git.revision=0
|
||||
git.branch=unknown
|
||||
git.hash=
|
||||
git.hash.short=
|
||||
git.tag=
|
||||
name.full=jMonkeyEngine 3.1.0-UNKNOWN
|
||||
version.number=3.1.0
|
||||
version.tag=SNAPSHOT
|
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2015 jMonkeyEngine
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package com.jme3.cinematic;
|
||||
|
||||
import com.jme3.animation.AnimControl;
|
||||
import com.jme3.animation.Animation;
|
||||
import com.jme3.cinematic.events.AnimationEvent;
|
||||
import com.jme3.scene.Node;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author davidB
|
||||
*/
|
||||
public class CinematicTest {
|
||||
|
||||
/**
|
||||
* No NPE or any exception when clear() a new Cinematic
|
||||
*/
|
||||
@Test
|
||||
public void clearEmpty() {
|
||||
Cinematic sut = new Cinematic();
|
||||
sut.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* No ClassCastException when clear() a Cinematic with AnimationEvent
|
||||
*/
|
||||
@Test
|
||||
public void clearAnimationEvent() {
|
||||
Cinematic sut = new Cinematic();
|
||||
Node model = new Node("model");
|
||||
AnimControl ac = new AnimControl();
|
||||
ac.addAnim(new Animation("animName", 1.0f));
|
||||
model.addControl(ac);
|
||||
sut.enqueueCinematicEvent(new AnimationEvent(model, "animName"));
|
||||
sut.initialize(null, null);
|
||||
sut.clear();
|
||||
}
|
||||
}
|
@ -21,7 +21,7 @@ dependencies {
|
||||
// compile project(':jme3-bullet-native')
|
||||
compile project(':jme3-jbullet')
|
||||
compile project(':jme3-jogg')
|
||||
// compile project(':jme3-jogl')
|
||||
compile project(':jme3-jogl')
|
||||
compile project(':jme3-lwjgl')
|
||||
compile project(':jme3-networking')
|
||||
compile project(':jme3-niftygui')
|
||||
@ -51,7 +51,9 @@ jar.doFirst{
|
||||
}
|
||||
}
|
||||
|
||||
task dist (dependsOn: ['build', ':jme3-jogl:jar', ':jme3-bullet:jar', ':jme3-android:jar']) << {
|
||||
task dist (dependsOn: ['build', ':jme3-jogl:jar', ':jme3-bullet:jar', ':jme3-android:jar', \
|
||||
':jme3-android-native:jar', ':jme3-bullet-native-android:jar', \
|
||||
':jme3-bullet-native:jar']) << {
|
||||
// Copy all dependencies to ../dist/lib, remove versions from jar files
|
||||
configurations.compile.resolvedConfiguration.resolvedArtifacts.each { artifact ->
|
||||
copy {
|
||||
@ -97,23 +99,23 @@ task dist (dependsOn: ['build', ':jme3-jogl:jar', ':jme3-bullet:jar', ':jme3-and
|
||||
copy {
|
||||
from project(':jme3-bullet-native').jar.archivePath
|
||||
into '../dist/opt/native-bullet'
|
||||
rename {"jme3-bullet-natives.jar"}
|
||||
rename {project(':jme3-bullet-native').name+".jar"}
|
||||
}
|
||||
|
||||
// Copy android packages, remove version
|
||||
copy {
|
||||
from project(':jme3-android').jar.archivePath
|
||||
into '../dist/opt/android'
|
||||
rename { project(':jme3-android').name + ".jar" }
|
||||
rename {project(':jme3-android').name+".jar"}
|
||||
}
|
||||
copy {
|
||||
from project(':jme3-android-native').jar.archivePath
|
||||
into '../dist/opt/android'
|
||||
rename { project(':jme3-android-native').name + ".jar" }
|
||||
rename {project(':jme3-android-native').name+".jar"}
|
||||
}
|
||||
copy {
|
||||
from project(':jme3-bullet-native-android').jar.archivePath
|
||||
into '../dist/opt/native-bullet'
|
||||
rename {"jme3-bullet-native-android.jar"}
|
||||
rename {project(':jme3-bullet-native-android').name+".jar"}
|
||||
}
|
||||
}
|
||||
|
594
jme3-jogl/src/main/java/com/jme3/renderer/jogl/JoglGL.java
Normal file
594
jme3-jogl/src/main/java/com/jme3/renderer/jogl/JoglGL.java
Normal file
@ -0,0 +1,594 @@
|
||||
package com.jme3.renderer.jogl;
|
||||
|
||||
import com.jme3.renderer.RendererException;
|
||||
import com.jme3.renderer.opengl.GL;
|
||||
import com.jme3.renderer.opengl.GL2;
|
||||
import com.jme3.renderer.opengl.GL3;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
import java.nio.ShortBuffer;
|
||||
|
||||
import com.jme3.renderer.opengl.GL4;
|
||||
import com.jogamp.opengl.GLContext;
|
||||
|
||||
public class JoglGL implements GL, GL2, GL3, GL4 {
|
||||
|
||||
private static int getLimitBytes(ByteBuffer buffer) {
|
||||
checkLimit(buffer);
|
||||
return buffer.limit();
|
||||
}
|
||||
|
||||
private static int getLimitBytes(ShortBuffer buffer) {
|
||||
checkLimit(buffer);
|
||||
return buffer.limit() * 2;
|
||||
}
|
||||
|
||||
private static int getLimitBytes(FloatBuffer buffer) {
|
||||
checkLimit(buffer);
|
||||
return buffer.limit() * 4;
|
||||
}
|
||||
|
||||
private static int getLimitCount(Buffer buffer, int elementSize) {
|
||||
checkLimit(buffer);
|
||||
return buffer.limit() / elementSize;
|
||||
}
|
||||
|
||||
private static void checkLimit(Buffer buffer) {
|
||||
if (buffer == null) {
|
||||
return;
|
||||
}
|
||||
if (buffer.limit() == 0) {
|
||||
throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error");
|
||||
}
|
||||
if (buffer.remaining() == 0) {
|
||||
throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetStats() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glActiveTexture(int param1) {
|
||||
GLContext.getCurrentGL().glActiveTexture(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glAlphaFunc(int param1, float param2) {
|
||||
GLContext.getCurrentGL().getGL2ES1().glAlphaFunc(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glAttachShader(int param1, int param2) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glAttachShader(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBindBuffer(int param1, int param2) {
|
||||
GLContext.getCurrentGL().glBindBuffer(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBindTexture(int param1, int param2) {
|
||||
GLContext.getCurrentGL().glBindTexture(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBlendFunc(int param1, int param2) {
|
||||
GLContext.getCurrentGL().glBlendFunc(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBufferData(int param1, long param2, int param3) {
|
||||
GLContext.getCurrentGL().glBufferData(param1, param2, null, param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBufferData(int param1, FloatBuffer param2, int param3) {
|
||||
checkLimit(param2);
|
||||
GLContext.getCurrentGL().glBufferData(param1, getLimitBytes(param2), param2, param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBufferData(int param1, ShortBuffer param2, int param3) {
|
||||
checkLimit(param2);
|
||||
GLContext.getCurrentGL().glBufferData(param1, getLimitBytes(param2), param2, param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBufferData(int param1, ByteBuffer param2, int param3) {
|
||||
checkLimit(param2);
|
||||
GLContext.getCurrentGL().glBufferData(param1, getLimitBytes(param2), param2, param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBufferSubData(int param1, long param2, FloatBuffer param3) {
|
||||
checkLimit(param3);
|
||||
GLContext.getCurrentGL().glBufferSubData(param1, param2, getLimitBytes(param3), param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBufferSubData(int param1, long param2, ShortBuffer param3) {
|
||||
checkLimit(param3);
|
||||
GLContext.getCurrentGL().glBufferSubData(param1, param2, getLimitBytes(param3), param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBufferSubData(int param1, long param2, ByteBuffer param3) {
|
||||
checkLimit(param3);
|
||||
GLContext.getCurrentGL().glBufferSubData(param1, param2, getLimitBytes(param3), param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glClear(int param1) {
|
||||
GLContext.getCurrentGL().glClear(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glClearColor(float param1, float param2, float param3, float param4) {
|
||||
GLContext.getCurrentGL().glClearColor(param1, param2, param3, param4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glColorMask(boolean param1, boolean param2, boolean param3, boolean param4) {
|
||||
GLContext.getCurrentGL().glColorMask(param1, param2, param3, param4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glCompileShader(int param1) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glCompileShader(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glCompressedTexImage2D(int param1, int param2, int param3, int param4, int param5, int param6, ByteBuffer param7) {
|
||||
checkLimit(param7);
|
||||
GLContext.getCurrentGL().glCompressedTexImage2D(param1, param2, param3, param4, param5, param6, getLimitBytes(param7), param7);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glCompressedTexImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, ByteBuffer param8) {
|
||||
checkLimit(param8);
|
||||
GLContext.getCurrentGL().getGL2ES2().glCompressedTexImage3D(param1, param2, param3, param4, param5, param6, param7, getLimitBytes(param8), param8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glCompressedTexSubImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, ByteBuffer param8) {
|
||||
checkLimit(param8);
|
||||
GLContext.getCurrentGL().glCompressedTexSubImage2D(param1, param2, param3, param4, param5, param6, param7, getLimitBytes(param8), param8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glCompressedTexSubImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, ByteBuffer param10) {
|
||||
checkLimit(param10);
|
||||
GLContext.getCurrentGL().getGL2ES2().glCompressedTexSubImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, getLimitBytes(param10), param10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int glCreateProgram() {
|
||||
return GLContext.getCurrentGL().getGL2ES2().glCreateProgram();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int glCreateShader(int param1) {
|
||||
return GLContext.getCurrentGL().getGL2ES2().glCreateShader(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glCullFace(int param1) {
|
||||
GLContext.getCurrentGL().glCullFace(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDeleteBuffers(IntBuffer param1) {
|
||||
checkLimit(param1);
|
||||
GLContext.getCurrentGL().glDeleteBuffers(param1.limit(), param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDeleteProgram(int param1) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glDeleteProgram(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDeleteShader(int param1) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glDeleteShader(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDeleteTextures(IntBuffer param1) {
|
||||
checkLimit(param1);
|
||||
GLContext.getCurrentGL().glDeleteTextures(param1.limit() ,param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDepthFunc(int param1) {
|
||||
GLContext.getCurrentGL().glDepthFunc(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDepthMask(boolean param1) {
|
||||
GLContext.getCurrentGL().glDepthMask(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDepthRange(double param1, double param2) {
|
||||
GLContext.getCurrentGL().glDepthRange(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDetachShader(int param1, int param2) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glDetachShader(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDisable(int param1) {
|
||||
GLContext.getCurrentGL().glDisable(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDisableVertexAttribArray(int param1) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glDisableVertexAttribArray(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDrawArrays(int param1, int param2, int param3) {
|
||||
GLContext.getCurrentGL().glDrawArrays(param1, param2, param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDrawBuffer(int param1) {
|
||||
GLContext.getCurrentGL().getGL2GL3().glDrawBuffer(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDrawRangeElements(int param1, int param2, int param3, int param4, int param5, long param6) {
|
||||
GLContext.getCurrentGL().getGL2ES3().glDrawRangeElements(param1, param2, param3, param4, param5, param6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glEnable(int param1) {
|
||||
GLContext.getCurrentGL().glEnable(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glEnableVertexAttribArray(int param1) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glEnableVertexAttribArray(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glGenBuffers(IntBuffer param1) {
|
||||
checkLimit(param1);
|
||||
GLContext.getCurrentGL().glGenBuffers(param1.limit(), param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glGenTextures(IntBuffer param1) {
|
||||
checkLimit(param1);
|
||||
GLContext.getCurrentGL().glGenTextures(param1.limit(), param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glGetBoolean(int param1, ByteBuffer param2) {
|
||||
checkLimit(param2);
|
||||
GLContext.getCurrentGL().glGetBooleanv(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glGetBufferSubData(int target, long offset, ByteBuffer data) {
|
||||
checkLimit(data);
|
||||
GLContext.getCurrentGL().getGL2GL3().glGetBufferSubData(target, offset, getLimitBytes(data), data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int glGetError() {
|
||||
return GLContext.getCurrentGL().glGetError();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glGetInteger(int param1, IntBuffer param2) {
|
||||
checkLimit(param2);
|
||||
GLContext.getCurrentGL().glGetIntegerv(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glGetProgram(int param1, int param2, IntBuffer param3) {
|
||||
checkLimit(param3);
|
||||
GLContext.getCurrentGL().getGL2ES2().glGetProgramiv(param1, param2, param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glGetShader(int param1, int param2, IntBuffer param3) {
|
||||
checkLimit(param3);
|
||||
GLContext.getCurrentGL().getGL2ES2().glGetShaderiv(param1, param2, param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String glGetString(int param1) {
|
||||
return GLContext.getCurrentGL().glGetString(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String glGetString(int param1, int param2) {
|
||||
return GLContext.getCurrentGL().getGL2ES3().glGetStringi(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean glIsEnabled(int param1) {
|
||||
return GLContext.getCurrentGL().glIsEnabled(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glLineWidth(float param1) {
|
||||
GLContext.getCurrentGL().glLineWidth(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glLinkProgram(int param1) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glLinkProgram(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glPixelStorei(int param1, int param2) {
|
||||
GLContext.getCurrentGL().glPixelStorei(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glPointSize(float param1) {
|
||||
GLContext.getCurrentGL().getGL2ES1().glPointSize(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glPolygonMode(int param1, int param2) {
|
||||
GLContext.getCurrentGL().getGL2().glPolygonMode(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glPolygonOffset(float param1, float param2) {
|
||||
GLContext.getCurrentGL().glPolygonOffset(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glReadBuffer(int param1) {
|
||||
GLContext.getCurrentGL().getGL2ES3().glReadBuffer(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glReadPixels(int param1, int param2, int param3, int param4, int param5, int param6, ByteBuffer param7) {
|
||||
checkLimit(param7);
|
||||
GLContext.getCurrentGL().glReadPixels(param1, param2, param3, param4, param5, param6, param7);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glReadPixels(int param1, int param2, int param3, int param4, int param5, int param6, long param7) {
|
||||
GLContext.getCurrentGL().glReadPixels(param1, param2, param3, param4, param5, param6, param7);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glScissor(int param1, int param2, int param3, int param4) {
|
||||
GLContext.getCurrentGL().glScissor(param1, param2, param3, param4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glStencilFuncSeparate(int param1, int param2, int param3, int param4) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glStencilFuncSeparate(param1, param2, param3, param4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glStencilOpSeparate(int param1, int param2, int param3, int param4) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glStencilOpSeparate(param1, param2, param3, param4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glTexImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, ByteBuffer param9) {
|
||||
checkLimit(param9);
|
||||
GLContext.getCurrentGL().glTexImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glTexImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, ByteBuffer param10) {
|
||||
checkLimit(param10);
|
||||
GLContext.getCurrentGL().getGL2ES2().glTexImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glTexParameterf(int param1, int param2, float param3) {
|
||||
GLContext.getCurrentGL().glTexParameterf(param1, param2, param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glTexParameteri(int param1, int param2, int param3) {
|
||||
GLContext.getCurrentGL().glTexParameteri(param1, param2, param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glTexSubImage2D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, ByteBuffer param9) {
|
||||
checkLimit(param9);
|
||||
GLContext.getCurrentGL().glTexSubImage2D(param1, param2, param3, param4, param5, param6, param7, param8, param9);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glTexSubImage3D(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, ByteBuffer param11) {
|
||||
checkLimit(param11);
|
||||
GLContext.getCurrentGL().getGL2ES2().glTexSubImage3D(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniform1(int param1, FloatBuffer param2) {
|
||||
checkLimit(param2);
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniform1fv(param1, getLimitCount(param2, 1), param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniform1(int param1, IntBuffer param2) {
|
||||
checkLimit(param2);
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniform1iv(param1, getLimitCount(param2, 1), param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniform1f(int param1, float param2) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniform1f(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniform1i(int param1, int param2) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniform1i(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniform2(int param1, IntBuffer param2) {
|
||||
checkLimit(param2);
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniform2iv(param1, getLimitCount(param2, 2), param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniform2(int param1, FloatBuffer param2) {
|
||||
checkLimit(param2);
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniform2fv(param1, getLimitCount(param2, 2), param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniform2f(int param1, float param2, float param3) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniform2f(param1, param2, param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniform3(int param1, IntBuffer param2) {
|
||||
checkLimit(param2);
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniform3iv(param1, getLimitCount(param2, 3), param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniform3(int param1, FloatBuffer param2) {
|
||||
checkLimit(param2);
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniform3fv(param1, getLimitCount(param2, 3), param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniform3f(int param1, float param2, float param3, float param4) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniform3f(param1, param2, param3, param4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniform4(int param1, FloatBuffer param2) {
|
||||
checkLimit(param2);
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniform4fv(param1, getLimitCount(param2, 4), param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniform4(int param1, IntBuffer param2) {
|
||||
checkLimit(param2);
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniform4iv(param1, getLimitCount(param2, 4), param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniform4f(int param1, float param2, float param3, float param4, float param5) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniform4f(param1, param2, param3, param4, param5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniformMatrix3(int param1, boolean param2, FloatBuffer param3) {
|
||||
checkLimit(param3);
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniformMatrix3fv(param1, getLimitCount(param3, 3 * 3), param2, param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUniformMatrix4(int param1, boolean param2, FloatBuffer param3) {
|
||||
checkLimit(param3);
|
||||
GLContext.getCurrentGL().getGL2ES2().glUniformMatrix4fv(param1, getLimitCount(param3, 4 * 4), param2, param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glUseProgram(int param1) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glUseProgram(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glVertexAttribPointer(int param1, int param2, int param3, boolean param4, int param5, long param6) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glVertexAttribPointer(param1, param2, param3, param4, param5, param6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glViewport(int param1, int param2, int param3, int param4) {
|
||||
GLContext.getCurrentGL().glViewport(param1, param2, param3, param4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int glGetAttribLocation(int param1, String param2) {
|
||||
// FIXME: Does JOGL require null-terminated strings?????
|
||||
return GLContext.getCurrentGL().getGL2ES2().glGetAttribLocation(param1, param2 + "\0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int glGetUniformLocation(int param1, String param2) {
|
||||
// FIXME: Does JOGL require null-terminated strings????????
|
||||
return GLContext.getCurrentGL().getGL2ES2().glGetUniformLocation(param1, param2 + "\0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glShaderSource(int param1, String[] param2, IntBuffer param3) {
|
||||
checkLimit(param3);
|
||||
GLContext.getCurrentGL().getGL2ES2().glShaderSource(param1, param2.length, param2, param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String glGetProgramInfoLog(int program, int maxSize) {
|
||||
ByteBuffer buffer = ByteBuffer.allocateDirect(maxSize);
|
||||
buffer.order(ByteOrder.nativeOrder());
|
||||
ByteBuffer tmp = ByteBuffer.allocateDirect(4);
|
||||
tmp.order(ByteOrder.nativeOrder());
|
||||
IntBuffer intBuffer = tmp.asIntBuffer();
|
||||
|
||||
GLContext.getCurrentGL().getGL2ES2().glGetProgramInfoLog(program, maxSize, intBuffer, buffer);
|
||||
int numBytes = intBuffer.get(0);
|
||||
byte[] bytes = new byte[numBytes];
|
||||
buffer.get(bytes);
|
||||
return new String(bytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String glGetShaderInfoLog(int shader, int maxSize) {
|
||||
ByteBuffer buffer = ByteBuffer.allocateDirect(maxSize);
|
||||
buffer.order(ByteOrder.nativeOrder());
|
||||
ByteBuffer tmp = ByteBuffer.allocateDirect(4);
|
||||
tmp.order(ByteOrder.nativeOrder());
|
||||
IntBuffer intBuffer = tmp.asIntBuffer();
|
||||
|
||||
GLContext.getCurrentGL().getGL2ES2().glGetShaderInfoLog(shader, maxSize, intBuffer, buffer);
|
||||
int numBytes = intBuffer.get(0);
|
||||
byte[] bytes = new byte[numBytes];
|
||||
buffer.get(bytes);
|
||||
return new String(bytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBindFragDataLocation(int param1, int param2, String param3) {
|
||||
GLContext.getCurrentGL().getGL2GL3().glBindFragDataLocation(param1, param2, param3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBindVertexArray(int param1) {
|
||||
GLContext.getCurrentGL().getGL2ES3().glBindVertexArray(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glGenVertexArrays(IntBuffer param1) {
|
||||
checkLimit(param1);
|
||||
GLContext.getCurrentGL().getGL2ES3().glGenVertexArrays(param1.limit(), param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glPatchParameter(int count) {
|
||||
GLContext.getCurrentGL().getGL3().glPatchParameteri(com.jogamp.opengl.GL3.GL_PATCH_VERTICES, count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDeleteVertexArrays(IntBuffer arrays) {
|
||||
checkLimit(arrays);
|
||||
GLContext.getCurrentGL().getGL2ES3().glDeleteVertexArrays(arrays.limit(), arrays);
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
package com.jme3.renderer.jogl;
|
||||
|
||||
import com.jme3.renderer.RendererException;
|
||||
import com.jme3.renderer.opengl.GLExt;
|
||||
import com.jogamp.opengl.GLContext;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
public class JoglGLExt implements GLExt {
|
||||
|
||||
private static int getLimitBytes(IntBuffer buffer) {
|
||||
checkLimit(buffer);
|
||||
return buffer.limit() * 4;
|
||||
}
|
||||
|
||||
private static void checkLimit(Buffer buffer) {
|
||||
if (buffer == null) {
|
||||
return;
|
||||
}
|
||||
if (buffer.limit() == 0) {
|
||||
throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error");
|
||||
}
|
||||
if (buffer.remaining() == 0) {
|
||||
throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBufferData(int target, IntBuffer data, int usage) {
|
||||
checkLimit(data);
|
||||
GLContext.getCurrentGL().glBufferData(target, getLimitBytes(data), data, usage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBufferSubData(int target, long offset, IntBuffer data) {
|
||||
checkLimit(data);
|
||||
GLContext.getCurrentGL().glBufferSubData(target, getLimitBytes(data), offset, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDrawArraysInstancedARB(int mode, int first, int count, int primcount) {
|
||||
GLContext.getCurrentGL().getGL2ES3().glDrawArraysInstanced(mode, first, count, primcount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDrawBuffers(IntBuffer bufs) {
|
||||
checkLimit(bufs);
|
||||
GLContext.getCurrentGL().getGL2ES2().glDrawBuffers(bufs.limit(), bufs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDrawElementsInstancedARB(int mode, int indices_count, int type, long indices_buffer_offset, int primcount) {
|
||||
GLContext.getCurrentGL().getGL2ES3().glDrawElementsInstanced(mode, indices_count, type, indices_buffer_offset, primcount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glGetMultisample(int pname, int index, FloatBuffer val) {
|
||||
checkLimit(val);
|
||||
GLContext.getCurrentGL().getGL2ES2().glGetMultisamplefv(pname, index, val);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glTexImage2DMultisample(int target, int samples, int internalformat, int width, int height, boolean fixedsamplelocations) {
|
||||
GLContext.getCurrentGL().getGL2ES2().glTexImage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glVertexAttribDivisorARB(int index, int divisor) {
|
||||
GLContext.getCurrentGL().getGL2ES3().glVertexAttribDivisor(index, divisor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object glFenceSync(int condition, int flags) {
|
||||
return GLContext.getCurrentGL().getGL3ES3().glFenceSync(condition, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int glClientWaitSync(Object sync, int flags, long timeout) {
|
||||
return GLContext.getCurrentGL().getGL3ES3().glClientWaitSync(((Long) sync).longValue(), flags, timeout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDeleteSync(Object sync) {
|
||||
GLContext.getCurrentGL().getGL3ES3().glDeleteSync(((Long) sync).longValue());
|
||||
}
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package com.jme3.renderer.jogl;
|
||||
|
||||
import com.jme3.renderer.RendererException;
|
||||
import com.jme3.renderer.opengl.GLFbo;
|
||||
import com.jogamp.opengl.GLContext;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
/**
|
||||
* Implements GLFbo
|
||||
*
|
||||
* @author Kirill Vainer
|
||||
*/
|
||||
public class JoglGLFbo implements GLFbo {
|
||||
|
||||
private static void checkLimit(Buffer buffer) {
|
||||
if (buffer == null) {
|
||||
return;
|
||||
}
|
||||
if (buffer.limit() == 0) {
|
||||
throw new RendererException("Attempting to upload empty buffer (limit = 0), that's an error");
|
||||
}
|
||||
if (buffer.remaining() == 0) {
|
||||
throw new RendererException("Attempting to upload empty buffer (remaining = 0), that's an error");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBlitFramebufferEXT(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, int mask, int filter) {
|
||||
GLContext.getCurrentGL().getGL2ES3().glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glRenderbufferStorageMultisampleEXT(int target, int samples, int internalformat, int width, int height) {
|
||||
GLContext.getCurrentGL().glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBindFramebufferEXT(int param1, int param2) {
|
||||
GLContext.getCurrentGL().glBindFramebuffer(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glBindRenderbufferEXT(int param1, int param2) {
|
||||
GLContext.getCurrentGL().glBindRenderbuffer(param1, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int glCheckFramebufferStatusEXT(int param1) {
|
||||
return GLContext.getCurrentGL().glCheckFramebufferStatus(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDeleteFramebuffersEXT(IntBuffer param1) {
|
||||
checkLimit(param1);
|
||||
GLContext.getCurrentGL().glDeleteFramebuffers(param1.limit(), param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glDeleteRenderbuffersEXT(IntBuffer param1) {
|
||||
checkLimit(param1);
|
||||
GLContext.getCurrentGL().glDeleteRenderbuffers(param1.limit(), param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glFramebufferRenderbufferEXT(int param1, int param2, int param3, int param4) {
|
||||
GLContext.getCurrentGL().glFramebufferRenderbuffer(param1, param2, param3, param4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glFramebufferTexture2DEXT(int param1, int param2, int param3, int param4, int param5) {
|
||||
GLContext.getCurrentGL().glFramebufferTexture2D(param1, param2, param3, param4, param5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glGenFramebuffersEXT(IntBuffer param1) {
|
||||
checkLimit(param1);
|
||||
GLContext.getCurrentGL().glGenFramebuffers(param1.limit(), param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glGenRenderbuffersEXT(IntBuffer param1) {
|
||||
checkLimit(param1);
|
||||
GLContext.getCurrentGL().glGenRenderbuffers(param1.limit(), param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glGenerateMipmapEXT(int param1) {
|
||||
GLContext.getCurrentGL().glGenerateMipmap(param1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void glRenderbufferStorageEXT(int param1, int param2, int param3, int param4) {
|
||||
GLContext.getCurrentGL().glRenderbufferStorage(param1, param2, param3, param4);
|
||||
}
|
||||
}
|
@ -37,22 +37,15 @@ import com.jme3.input.MouseInput;
|
||||
import com.jme3.input.TouchInput;
|
||||
import com.jme3.input.awt.AwtKeyInput;
|
||||
import com.jme3.input.awt.AwtMouseInput;
|
||||
import com.jme3.renderer.jogl.JoglRenderer;
|
||||
import com.jogamp.opengl.util.Animator;
|
||||
import com.jogamp.opengl.util.AnimatorBase;
|
||||
import com.jogamp.opengl.util.FPSAnimator;
|
||||
|
||||
import java.awt.GraphicsDevice;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.logging.Logger;
|
||||
import com.jogamp.opengl.DebugGL2;
|
||||
import com.jogamp.opengl.DebugGL3;
|
||||
import com.jogamp.opengl.DebugGL3bc;
|
||||
import com.jogamp.opengl.DebugGL4;
|
||||
import com.jogamp.opengl.DebugGL4bc;
|
||||
import com.jogamp.opengl.DebugGLES1;
|
||||
import com.jogamp.opengl.DebugGLES2;
|
||||
import com.jogamp.opengl.GL;
|
||||
|
||||
import com.jogamp.opengl.GLAutoDrawable;
|
||||
import com.jogamp.opengl.GLCapabilities;
|
||||
import com.jogamp.opengl.GLEventListener;
|
||||
@ -124,50 +117,9 @@ public abstract class JoglAbstractDisplay extends JoglContext implements GLEvent
|
||||
canvas.setSize(settings.getWidth(), settings.getHeight());
|
||||
canvas.setIgnoreRepaint(true);
|
||||
canvas.addGLEventListener(this);
|
||||
|
||||
if (settings.getBoolean("GraphicsDebug")) {
|
||||
canvas.invoke(false, new GLRunnable() {
|
||||
public boolean run(GLAutoDrawable glad) {
|
||||
GL gl = glad.getGL();
|
||||
if (gl.isGLES()) {
|
||||
if (gl.isGLES1()) {
|
||||
glad.setGL(new DebugGLES1(gl.getGLES1()));
|
||||
} else {
|
||||
if (gl.isGLES2()) {
|
||||
glad.setGL(new DebugGLES2(gl.getGLES2()));
|
||||
} else {
|
||||
// TODO ES3
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (gl.isGL4bc()) {
|
||||
glad.setGL(new DebugGL4bc(gl.getGL4bc()));
|
||||
} else {
|
||||
if (gl.isGL4()) {
|
||||
glad.setGL(new DebugGL4(gl.getGL4()));
|
||||
} else {
|
||||
if (gl.isGL3bc()) {
|
||||
glad.setGL(new DebugGL3bc(gl.getGL3bc()));
|
||||
} else {
|
||||
if (gl.isGL3()) {
|
||||
glad.setGL(new DebugGL3(gl.getGL3()));
|
||||
} else {
|
||||
if (gl.isGL2()) {
|
||||
glad.setGL(new DebugGL2(gl.getGL2()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
renderer = new JoglRenderer();
|
||||
|
||||
renderer.setMainFrameBufferSrgb(settings.getGammaCorrection());
|
||||
//FIXME not sure it is the best place to do that
|
||||
renderable.set(true);
|
||||
}
|
||||
|
||||
protected void startGLCanvas() {
|
||||
@ -182,9 +134,6 @@ public abstract class JoglAbstractDisplay extends JoglContext implements GLEvent
|
||||
|
||||
animator.start();
|
||||
wasAnimating = true;
|
||||
|
||||
//FIXME not sure it is the best place to do that
|
||||
renderable.set(true);
|
||||
}
|
||||
|
||||
protected void onCanvasAdded() {
|
||||
|
@ -41,28 +41,34 @@ public class JoglCanvas extends JoglAbstractDisplay implements JmeCanvasContext
|
||||
|
||||
private static final Logger logger = Logger.getLogger(JoglCanvas.class.getName());
|
||||
private int width, height;
|
||||
private boolean runningFirstTime = true;
|
||||
|
||||
public JoglCanvas(){
|
||||
super();
|
||||
initGLCanvas();
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
@Override
|
||||
public Type getType() {
|
||||
return Type.Canvas;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
@Override
|
||||
public void setTitle(String title) {
|
||||
}
|
||||
|
||||
public void restart() {
|
||||
@Override
|
||||
public void restart() {
|
||||
}
|
||||
|
||||
public void create(boolean waitFor){
|
||||
@Override
|
||||
public void create(boolean waitFor){
|
||||
if (waitFor)
|
||||
waitFor(true);
|
||||
}
|
||||
|
||||
public void destroy(boolean waitFor){
|
||||
@Override
|
||||
public void destroy(boolean waitFor){
|
||||
if (waitFor)
|
||||
waitFor(false);
|
||||
if (animator.isAnimating())
|
||||
@ -81,13 +87,20 @@ public class JoglCanvas extends JoglAbstractDisplay implements JmeCanvasContext
|
||||
startGLCanvas();
|
||||
}
|
||||
|
||||
public void init(GLAutoDrawable drawable) {
|
||||
@Override
|
||||
public void init(GLAutoDrawable drawable) {
|
||||
canvas.requestFocus();
|
||||
|
||||
super.internalCreate();
|
||||
logger.fine("Display created.");
|
||||
|
||||
renderer.initialize();
|
||||
// At this point, the OpenGL context is active.
|
||||
if (runningFirstTime){
|
||||
// THIS is the part that creates the renderer.
|
||||
// It must always be called, now that we have the pbuffer workaround.
|
||||
initContextFirstTime();
|
||||
runningFirstTime = false;
|
||||
}
|
||||
listener.initialize();
|
||||
}
|
||||
|
||||
@ -97,7 +110,8 @@ public class JoglCanvas extends JoglAbstractDisplay implements JmeCanvasContext
|
||||
super.startGLCanvas();
|
||||
}
|
||||
|
||||
public void display(GLAutoDrawable glad) {
|
||||
@Override
|
||||
public void display(GLAutoDrawable glad) {
|
||||
if (!created.get() && renderer != null){
|
||||
listener.destroy();
|
||||
logger.fine("Canvas destroyed.");
|
||||
@ -129,7 +143,8 @@ public class JoglCanvas extends JoglAbstractDisplay implements JmeCanvasContext
|
||||
|
||||
}
|
||||
|
||||
public Canvas getCanvas() {
|
||||
@Override
|
||||
public Canvas getCanvas() {
|
||||
return canvas;
|
||||
}
|
||||
|
||||
|
@ -36,17 +36,33 @@ import com.jme3.input.JoyInput;
|
||||
import com.jme3.input.KeyInput;
|
||||
import com.jme3.input.MouseInput;
|
||||
import com.jme3.renderer.Renderer;
|
||||
import com.jme3.renderer.RendererException;
|
||||
import com.jme3.renderer.jogl.JoglGL;
|
||||
import com.jme3.renderer.jogl.JoglGLExt;
|
||||
import com.jme3.renderer.jogl.JoglGLFbo;
|
||||
import com.jme3.renderer.jogl.JoglRenderer;
|
||||
import com.jme3.renderer.opengl.GL2;
|
||||
import com.jme3.renderer.opengl.GL3;
|
||||
import com.jme3.renderer.opengl.GL4;
|
||||
import com.jme3.renderer.opengl.GLDebugDesktop;
|
||||
import com.jme3.renderer.opengl.GLExt;
|
||||
import com.jme3.renderer.opengl.GLFbo;
|
||||
import com.jme3.renderer.opengl.GLRenderer;
|
||||
import com.jme3.renderer.opengl.GLTiming;
|
||||
import com.jme3.renderer.opengl.GLTimingState;
|
||||
import com.jme3.renderer.opengl.GLTracer;
|
||||
import com.jme3.system.AppSettings;
|
||||
import com.jme3.system.JmeContext;
|
||||
import com.jme3.system.NanoTimer;
|
||||
import com.jme3.system.NativeLibraryLoader;
|
||||
import com.jme3.system.SystemListener;
|
||||
import com.jme3.system.Timer;
|
||||
|
||||
import java.nio.IntBuffer;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.jogamp.opengl.GL;
|
||||
import com.jogamp.opengl.GL2GL3;
|
||||
import com.jogamp.opengl.GLContext;
|
||||
@ -62,7 +78,7 @@ public abstract class JoglContext implements JmeContext {
|
||||
protected final Object createdLock = new Object();
|
||||
|
||||
protected AppSettings settings = new AppSettings(true);
|
||||
protected JoglRenderer renderer;
|
||||
protected Renderer renderer;
|
||||
protected Timer timer;
|
||||
protected SystemListener listener;
|
||||
|
||||
@ -77,43 +93,53 @@ public abstract class JoglContext implements JmeContext {
|
||||
}
|
||||
}
|
||||
|
||||
public void setSystemListener(SystemListener listener){
|
||||
@Override
|
||||
public void setSystemListener(SystemListener listener){
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public void setSettings(AppSettings settings) {
|
||||
@Override
|
||||
public void setSettings(AppSettings settings) {
|
||||
this.settings.copyFrom(settings);
|
||||
}
|
||||
|
||||
public boolean isRenderable(){
|
||||
@Override
|
||||
public boolean isRenderable(){
|
||||
return renderable.get();
|
||||
}
|
||||
|
||||
public AppSettings getSettings() {
|
||||
@Override
|
||||
public AppSettings getSettings() {
|
||||
return settings;
|
||||
}
|
||||
|
||||
public Renderer getRenderer() {
|
||||
@Override
|
||||
public Renderer getRenderer() {
|
||||
return renderer;
|
||||
}
|
||||
|
||||
public MouseInput getMouseInput() {
|
||||
@Override
|
||||
public MouseInput getMouseInput() {
|
||||
return mouseInput;
|
||||
}
|
||||
|
||||
public KeyInput getKeyInput() {
|
||||
@Override
|
||||
public KeyInput getKeyInput() {
|
||||
return keyInput;
|
||||
}
|
||||
|
||||
public JoyInput getJoyInput() {
|
||||
@Override
|
||||
public JoyInput getJoyInput() {
|
||||
return joyInput;
|
||||
}
|
||||
|
||||
public Timer getTimer() {
|
||||
@Override
|
||||
public Timer getTimer() {
|
||||
return timer;
|
||||
}
|
||||
|
||||
public boolean isCreated() {
|
||||
@Override
|
||||
public boolean isCreated() {
|
||||
return created.get();
|
||||
}
|
||||
|
||||
@ -135,13 +161,78 @@ public abstract class JoglContext implements JmeContext {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void initContextFirstTime(){
|
||||
if (GLContext.getCurrent().getGLVersionNumber().getMajor() < 2) {
|
||||
throw new RendererException("OpenGL 2.0 or higher is " +
|
||||
"required for jMonkeyEngine");
|
||||
}
|
||||
|
||||
if (settings.getRenderer().equals("JOGL")) {
|
||||
com.jme3.renderer.opengl.GL gl = new JoglGL();
|
||||
GLExt glext = new JoglGLExt();
|
||||
GLFbo glfbo = new JoglGLFbo();
|
||||
|
||||
if (settings.getBoolean("GraphicsDebug")) {
|
||||
gl = new GLDebugDesktop(gl, glext, glfbo);
|
||||
glext = (GLExt) gl;
|
||||
glfbo = (GLFbo) gl;
|
||||
}
|
||||
|
||||
if (settings.getBoolean("GraphicsTiming")) {
|
||||
GLTimingState timingState = new GLTimingState();
|
||||
gl = (com.jme3.renderer.opengl.GL) GLTiming.createGLTiming(gl, timingState, GL.class, GL2.class, GL3.class, GL4.class);
|
||||
glext = (GLExt) GLTiming.createGLTiming(glext, timingState, GLExt.class);
|
||||
glfbo = (GLFbo) GLTiming.createGLTiming(glfbo, timingState, GLFbo.class);
|
||||
}
|
||||
|
||||
if (settings.getBoolean("GraphicsTrace")) {
|
||||
gl = (com.jme3.renderer.opengl.GL) GLTracer.createDesktopGlTracer(gl, GL.class, GL2.class, GL3.class, GL4.class);
|
||||
glext = (GLExt) GLTracer.createDesktopGlTracer(glext, GLExt.class);
|
||||
glfbo = (GLFbo) GLTracer.createDesktopGlTracer(glfbo, GLFbo.class);
|
||||
}
|
||||
|
||||
//FIXME uncomment the line below when the unified renderer is ready for the prime time :)
|
||||
//renderer = new GLRenderer(gl, glext, glfbo);
|
||||
renderer = new JoglRenderer();
|
||||
renderer.initialize();
|
||||
} else {
|
||||
throw new UnsupportedOperationException("Unsupported renderer: " + settings.getRenderer());
|
||||
}
|
||||
|
||||
if (GLContext.getCurrentGL().isExtensionAvailable("GL_ARB_debug_output") && settings.getBoolean("GraphicsDebug")) {
|
||||
GLContext.getCurrent().enableGLDebugMessage(true);
|
||||
GLContext.getCurrent().addGLDebugListener(new JoglGLDebugOutputHandler());
|
||||
}
|
||||
|
||||
renderer.setMainFrameBufferSrgb(settings.getGammaCorrection());
|
||||
renderer.setLinearizeSrgbImages(settings.getGammaCorrection());
|
||||
|
||||
public void internalCreate() {
|
||||
// Init input
|
||||
if (keyInput != null) {
|
||||
keyInput.initialize();
|
||||
}
|
||||
|
||||
if (mouseInput != null) {
|
||||
mouseInput.initialize();
|
||||
}
|
||||
|
||||
if (joyInput != null) {
|
||||
joyInput.initialize();
|
||||
}
|
||||
}
|
||||
|
||||
public void internalCreate() {
|
||||
timer = new NanoTimer();
|
||||
synchronized (createdLock){
|
||||
created.set(true);
|
||||
createdLock.notifyAll();
|
||||
}
|
||||
if (renderable.get()){
|
||||
initContextFirstTime();
|
||||
} else {
|
||||
assert getType() == Type.Canvas;
|
||||
}
|
||||
}
|
||||
|
||||
protected void internalDestroy() {
|
||||
|
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2015 jMonkeyEngine
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package com.jme3.system.jogl;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.jogamp.opengl.GL2ES2;
|
||||
import com.jogamp.opengl.GLDebugListener;
|
||||
import com.jogamp.opengl.GLDebugMessage;
|
||||
|
||||
class JoglGLDebugOutputHandler implements GLDebugListener {
|
||||
|
||||
private static final HashMap<Integer, String> constMap = new HashMap<Integer, String>();
|
||||
private static final String MESSAGE_FORMAT =
|
||||
"[JME3] OpenGL debug message\r\n" +
|
||||
" ID: %d\r\n" +
|
||||
" Source: %s\r\n" +
|
||||
" Type: %s\r\n" +
|
||||
" Severity: %s\r\n" +
|
||||
" Message: %s";
|
||||
|
||||
static {
|
||||
constMap.put(GL2ES2.GL_DEBUG_SOURCE_API, "API");
|
||||
constMap.put(GL2ES2.GL_DEBUG_SOURCE_APPLICATION, "APPLICATION");
|
||||
constMap.put(GL2ES2.GL_DEBUG_SOURCE_OTHER, "OTHER");
|
||||
constMap.put(GL2ES2.GL_DEBUG_SOURCE_SHADER_COMPILER, "SHADER_COMPILER");
|
||||
constMap.put(GL2ES2.GL_DEBUG_SOURCE_THIRD_PARTY, "THIRD_PARTY");
|
||||
constMap.put(GL2ES2.GL_DEBUG_SOURCE_WINDOW_SYSTEM, "WINDOW_SYSTEM");
|
||||
|
||||
constMap.put(GL2ES2.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, "DEPRECATED_BEHAVIOR");
|
||||
constMap.put(GL2ES2.GL_DEBUG_TYPE_ERROR, "ERROR");
|
||||
constMap.put(GL2ES2.GL_DEBUG_TYPE_OTHER, "OTHER");
|
||||
constMap.put(GL2ES2.GL_DEBUG_TYPE_PERFORMANCE, "PERFORMANCE");
|
||||
constMap.put(GL2ES2.GL_DEBUG_TYPE_PORTABILITY, "PORTABILITY");
|
||||
constMap.put(GL2ES2.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR, "UNDEFINED_BEHAVIOR");
|
||||
|
||||
constMap.put(GL2ES2.GL_DEBUG_SEVERITY_HIGH, "HIGH");
|
||||
constMap.put(GL2ES2.GL_DEBUG_SEVERITY_MEDIUM, "MEDIUM");
|
||||
constMap.put(GL2ES2.GL_DEBUG_SEVERITY_LOW, "LOW");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void messageSent(GLDebugMessage event) {
|
||||
String sourceStr = constMap.get(event.getDbgSource());
|
||||
String typeStr = constMap.get(event.getDbgType());
|
||||
String severityStr = constMap.get(event.getDbgSeverity());
|
||||
|
||||
System.err.println(String.format(MESSAGE_FORMAT, event.getDbgId(), sourceStr, typeStr, severityStr, event.getDbgMsg()));
|
||||
}
|
||||
|
||||
}
|
@ -37,21 +37,14 @@ import com.jme3.input.MouseInput;
|
||||
import com.jme3.input.TouchInput;
|
||||
import com.jme3.input.jogl.NewtKeyInput;
|
||||
import com.jme3.input.jogl.NewtMouseInput;
|
||||
import com.jme3.renderer.jogl.JoglRenderer;
|
||||
import com.jogamp.newt.opengl.GLWindow;
|
||||
import com.jogamp.opengl.util.Animator;
|
||||
import com.jogamp.opengl.util.AnimatorBase;
|
||||
import com.jogamp.opengl.util.FPSAnimator;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.logging.Logger;
|
||||
import com.jogamp.opengl.DebugGL2;
|
||||
import com.jogamp.opengl.DebugGL3;
|
||||
import com.jogamp.opengl.DebugGL3bc;
|
||||
import com.jogamp.opengl.DebugGL4;
|
||||
import com.jogamp.opengl.DebugGL4bc;
|
||||
import com.jogamp.opengl.DebugGLES1;
|
||||
import com.jogamp.opengl.DebugGLES2;
|
||||
import com.jogamp.opengl.GL;
|
||||
|
||||
import com.jogamp.opengl.GLAutoDrawable;
|
||||
import com.jogamp.opengl.GLCapabilities;
|
||||
import com.jogamp.opengl.GLEventListener;
|
||||
@ -103,50 +96,9 @@ public abstract class JoglNewtAbstractDisplay extends JoglContext implements GLE
|
||||
canvas.requestFocus();
|
||||
canvas.setSize(settings.getWidth(), settings.getHeight());
|
||||
canvas.addGLEventListener(this);
|
||||
|
||||
if (settings.getBoolean("GraphicsDebug")) {
|
||||
canvas.invoke(false, new GLRunnable() {
|
||||
public boolean run(GLAutoDrawable glad) {
|
||||
GL gl = glad.getGL();
|
||||
if (gl.isGLES()) {
|
||||
if (gl.isGLES1()) {
|
||||
glad.setGL(new DebugGLES1(gl.getGLES1()));
|
||||
} else {
|
||||
if (gl.isGLES2()) {
|
||||
glad.setGL(new DebugGLES2(gl.getGLES2()));
|
||||
} else {
|
||||
// TODO ES3
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (gl.isGL4bc()) {
|
||||
glad.setGL(new DebugGL4bc(gl.getGL4bc()));
|
||||
} else {
|
||||
if (gl.isGL4()) {
|
||||
glad.setGL(new DebugGL4(gl.getGL4()));
|
||||
} else {
|
||||
if (gl.isGL3bc()) {
|
||||
glad.setGL(new DebugGL3bc(gl.getGL3bc()));
|
||||
} else {
|
||||
if (gl.isGL3()) {
|
||||
glad.setGL(new DebugGL3(gl.getGL3()));
|
||||
} else {
|
||||
if (gl.isGL2()) {
|
||||
glad.setGL(new DebugGL2(gl.getGL2()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
renderer = new JoglRenderer();
|
||||
|
||||
renderer.setMainFrameBufferSrgb(settings.getGammaCorrection());
|
||||
//FIXME not sure it is the best place to do that
|
||||
renderable.set(true);
|
||||
}
|
||||
|
||||
protected void startGLCanvas() {
|
||||
@ -161,9 +113,6 @@ public abstract class JoglNewtAbstractDisplay extends JoglContext implements GLE
|
||||
|
||||
animator.start();
|
||||
wasAnimating = true;
|
||||
|
||||
//FIXME not sure it is the best place to do that
|
||||
renderable.set(true);
|
||||
}
|
||||
|
||||
protected void onCanvasAdded() {
|
||||
|
@ -41,6 +41,7 @@ public class JoglNewtCanvas extends JoglNewtAbstractDisplay implements JmeCanvas
|
||||
|
||||
private static final Logger logger = Logger.getLogger(JoglNewtCanvas.class.getName());
|
||||
private int width, height;
|
||||
private boolean runningFirstTime = true;
|
||||
|
||||
private NewtCanvasAWT newtAwtCanvas;
|
||||
|
||||
@ -53,7 +54,9 @@ public class JoglNewtCanvas extends JoglNewtAbstractDisplay implements JmeCanvas
|
||||
protected final void initGLCanvas() {
|
||||
super.initGLCanvas();
|
||||
newtAwtCanvas = new NewtCanvasAWT(canvas) {
|
||||
@Override
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public void addNotify() {
|
||||
super.addNotify();
|
||||
onCanvasAdded();
|
||||
@ -67,22 +70,27 @@ public class JoglNewtCanvas extends JoglNewtAbstractDisplay implements JmeCanvas
|
||||
};
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
@Override
|
||||
public Type getType() {
|
||||
return Type.Canvas;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
@Override
|
||||
public void setTitle(String title) {
|
||||
}
|
||||
|
||||
public void restart() {
|
||||
@Override
|
||||
public void restart() {
|
||||
}
|
||||
|
||||
public void create(boolean waitFor){
|
||||
@Override
|
||||
public void create(boolean waitFor){
|
||||
if (waitFor)
|
||||
waitFor(true);
|
||||
}
|
||||
|
||||
public void destroy(boolean waitFor){
|
||||
@Override
|
||||
public void destroy(boolean waitFor){
|
||||
if (waitFor)
|
||||
waitFor(false);
|
||||
if (animator.isAnimating())
|
||||
@ -101,13 +109,20 @@ public class JoglNewtCanvas extends JoglNewtAbstractDisplay implements JmeCanvas
|
||||
startGLCanvas();
|
||||
}
|
||||
|
||||
public void init(GLAutoDrawable drawable) {
|
||||
@Override
|
||||
public void init(GLAutoDrawable drawable) {
|
||||
canvas.requestFocus();
|
||||
|
||||
super.internalCreate();
|
||||
logger.fine("Display created.");
|
||||
|
||||
renderer.initialize();
|
||||
// At this point, the OpenGL context is active.
|
||||
if (runningFirstTime){
|
||||
// THIS is the part that creates the renderer.
|
||||
// It must always be called, now that we have the pbuffer workaround.
|
||||
initContextFirstTime();
|
||||
runningFirstTime = false;
|
||||
}
|
||||
listener.initialize();
|
||||
}
|
||||
|
||||
@ -117,7 +132,8 @@ public class JoglNewtCanvas extends JoglNewtAbstractDisplay implements JmeCanvas
|
||||
super.startGLCanvas();
|
||||
}
|
||||
|
||||
public void display(GLAutoDrawable glad) {
|
||||
@Override
|
||||
public void display(GLAutoDrawable glad) {
|
||||
if (!created.get() && renderer != null){
|
||||
listener.destroy();
|
||||
logger.fine("Canvas destroyed.");
|
||||
|
@ -13,7 +13,7 @@ import java.nio.ShortBuffer;
|
||||
import com.jme3.renderer.opengl.GL4;
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
public class LwjglGL implements GL, GL2, GL3, GL4 {
|
||||
public final class LwjglGL implements GL, GL2, GL3, GL4 {
|
||||
|
||||
private static void checkLimit(Buffer buffer) {
|
||||
if (buffer == null) {
|
||||
|
@ -13,7 +13,7 @@ import org.lwjgl.opengl.GL15;
|
||||
import org.lwjgl.opengl.GL20;
|
||||
import org.lwjgl.opengl.GLSync;
|
||||
|
||||
public class LwjglGLExt implements GLExt {
|
||||
public final class LwjglGLExt implements GLExt {
|
||||
|
||||
private static void checkLimit(Buffer buffer) {
|
||||
if (buffer == null) {
|
||||
|
@ -13,7 +13,7 @@ import org.lwjgl.opengl.EXTFramebufferObject;
|
||||
*
|
||||
* @author Kirill Vainer
|
||||
*/
|
||||
public class LwjglGLFboEXT implements GLFbo {
|
||||
public final class LwjglGLFboEXT implements GLFbo {
|
||||
|
||||
private static void checkLimit(Buffer buffer) {
|
||||
if (buffer == null) {
|
||||
|
@ -11,7 +11,7 @@ import org.lwjgl.opengl.GL30;
|
||||
*
|
||||
* @author Kirill Vainer
|
||||
*/
|
||||
public class LwjglGLFboGL3 implements GLFbo {
|
||||
public final class LwjglGLFboGL3 implements GLFbo {
|
||||
|
||||
private static void checkLimit(Buffer buffer) {
|
||||
if (buffer == null) {
|
||||
|
1
private/known_hosts
Normal file
1
private/known_hosts
Normal file
@ -0,0 +1 @@
|
||||
updates.jmonkeyengine.org ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC5bNOiZwU5dF62nBllxkjiSIfn0k6RVfprvO1aUypRmARD3/MKJKg7cGLezlLKaHZtVs84VpEqpmg5IzPAXWEmxUw1oke70uYMli7JV+4oPAeQRFwUdldP98I5h9VHwSjBqMycRLkxYaHF8edIPt1Zsa2dM3qrufy71ndQoFF6g7QxmT7gsTxwcNufDxymIgiAna/Qp2fr0YCLCiB8RQ7JTHfqA3dOWw0wz7AwfBTwwDCHkVxB5B4nz5iZxFr0scvqcae8vMncq8xKS7OMrLbn6asVaF6dDu+5Jc0mqxma5Qg7VC1xQXZsvlRISfrTFhQMhEx+j9w5snzihrlFnZ35
|
BIN
private/www-updater.key.enc
Normal file
BIN
private/www-updater.key.enc
Normal file
Binary file not shown.
@ -50,8 +50,8 @@ javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=1.5
|
||||
javac.target=1.5
|
||||
javac.source=1.6
|
||||
javac.target=1.6
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
|
@ -51,8 +51,7 @@
|
||||
-init-macrodef-junit: defines macro for junit execution
|
||||
-init-macrodef-debug: defines macro for class debugging
|
||||
-init-macrodef-java: defines macro for class execution
|
||||
-do-jar-with-manifest: JAR building (if you are using a manifest)
|
||||
-do-jar-without-manifest: JAR building (if you are not using a manifest)
|
||||
-do-jar: JAR building
|
||||
run: execution of project
|
||||
-javadoc-build: Javadoc generation
|
||||
test-report: JUnit report generation
|
||||
|
@ -1,8 +1,8 @@
|
||||
build.xml.data.CRC32=0f706f4a
|
||||
build.xml.script.CRC32=0b0b23c4
|
||||
build.xml.stylesheet.CRC32=28e38971@1.38.1.45
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=0f706f4a
|
||||
nbproject/build-impl.xml.script.CRC32=46d1a69a
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
|
||||
build.xml.data.CRC32=0f706f4a
|
||||
build.xml.script.CRC32=82b8b23d
|
||||
build.xml.stylesheet.CRC32=8064a381@1.75.2.48
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=0f706f4a
|
||||
nbproject/build-impl.xml.script.CRC32=46d1a69a
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
|
||||
|
@ -25,20 +25,26 @@ excludes=
|
||||
includes=**
|
||||
jar.compress=false
|
||||
javac.classpath=\
|
||||
${libs.jme3.classpath}:\
|
||||
${libs.jme3-libraries.classpath}:\
|
||||
${libs.jme3-libraries-blender.classpath}:\
|
||||
${libs.jme3-jogg.classpath}:\
|
||||
${libs.jme3-blender.classpath}:\
|
||||
${libs.jme3-networking.classpath}:\
|
||||
${libs.jme3-plugins.classpath}:\
|
||||
${libs.jme3-core.classpath}:\
|
||||
${libs.jme3-desktop.classpath}:\
|
||||
${libs.jme3-lwjgl.classpath}:\
|
||||
${libs.jme3-niftygui.classpath}:\
|
||||
${libs.jme3-effects.classpath}:\
|
||||
${libs.jme3-terrain.classpath}:\
|
||||
${libs.jme3-jbullet.classpath}:\
|
||||
${libs.jme3-test-data.classpath}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
javac.source=1.5
|
||||
javac.target=1.5
|
||||
javac.source=1.6
|
||||
javac.target=1.6
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}:\
|
||||
${libs.junit.classpath}:\
|
||||
${libs.junit_4.classpath}
|
||||
${build.classes.dir}
|
||||
javadoc.additionalparam=
|
||||
javadoc.author=false
|
||||
javadoc.encoding=${source.encoding}
|
||||
|
@ -47,8 +47,8 @@ javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=1.5
|
||||
javac.target=1.5
|
||||
javac.source=1.6
|
||||
javac.target=1.6
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
|
@ -36,8 +36,8 @@ javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=1.5
|
||||
javac.target=1.5
|
||||
javac.source=1.6
|
||||
javac.target=1.6
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
|
@ -165,7 +165,7 @@ task createBaseXml(dependsOn: configurations.corelibs) <<{
|
||||
"compile-dependency"{}
|
||||
"run-dependency"{
|
||||
"release-version" "1"
|
||||
"specification-version" "3.0.0"
|
||||
"specification-version" jmeVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -388,12 +388,14 @@ copyTestSources.outputs.dir "JME3TestsTemplate/src/"
|
||||
copyTestSources.outputs.dir "JME3TestsTemplateAndroid/src/"
|
||||
|
||||
ant.properties['plugins.version'] = jmeVersion
|
||||
ant.properties['app.version']= jmeMainVersion + "-" + jmeVersionTag
|
||||
ant.properties['app.version']= jmeFullVersion
|
||||
ant.properties['nbm.revision']= jmeNbmRevision
|
||||
|
||||
task buildSdk(dependsOn: [copyBaseLibs, copyProjectLibs, createProjectXml, createBaseXml, copyTestSources]) <<{
|
||||
ant.propertyfile(file: "nbproject/project.properties") {
|
||||
entry( key: "plugins.version", value: "${jmeVersion}")
|
||||
entry( key: "app.version", value: "${jmeMainVersion + "-" + jmeVersionTag}")
|
||||
entry( key: "app.version", value: "${jmeFullVersion}")
|
||||
entry( key: "nbm.revision", value: "${jmeNbmRevision}")
|
||||
}
|
||||
ant.ant(dir: ".", antfile: "build.xml", target: "build")
|
||||
}
|
||||
@ -416,7 +418,7 @@ task cleanSdk() <<{
|
||||
file("JME3TestsTemplateAndroid/src/jmetest/").deleteDir()
|
||||
}
|
||||
|
||||
tasks.remove(uploadArchives)
|
||||
|
||||
jar.dependsOn(buildSdk)
|
||||
clean.dependsOn(cleanSdk);
|
||||
|
||||
|
||||
clean.dependsOn(cleanSdk)
|
||||
|
163
sdk/build.xml
163
sdk/build.xml
@ -12,7 +12,6 @@
|
||||
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="ant-import.classpath"/>
|
||||
<taskdef resource="com/jme/ant/ant-jme.properties" classpathref="ant-import.classpath"/>
|
||||
<taskdef name="deb" classname="com.googlecode.ant_deb_task.Deb" classpathref="ant-import.classpath"/>
|
||||
<taskdef name="gcupload" classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask" classpathref="ant-import.classpath"/>
|
||||
<taskdef name="desktopentry" classname="com.googlecode.ant_deb_task.DesktopEntry" classpathref="ant-import.classpath"/>
|
||||
|
||||
<!--override branding target to include netbeans config file creation, using this target makes sure init was called-->
|
||||
@ -157,7 +156,7 @@
|
||||
replace="OpenIDE-Module-Specification-Version: ${plugins.version}"
|
||||
byline="true"/>
|
||||
<replaceregexp file="${module_dir}/nbproject/project.properties"
|
||||
match="spec.version.base"
|
||||
match="#*spec\.version\.base"
|
||||
replace="#spec.version.base"
|
||||
byline="true"/>
|
||||
</then>
|
||||
@ -167,7 +166,7 @@
|
||||
replace="OpenIDE-Module-Implementation-Version: 0"
|
||||
byline="true"/>
|
||||
<replaceregexp file="${module_dir}/nbproject/project.properties"
|
||||
match="#spec.version.base"
|
||||
match="#*spec\.version\.base"
|
||||
replace="spec.version.base"
|
||||
byline="true"/>
|
||||
</else>
|
||||
@ -176,9 +175,6 @@
|
||||
|
||||
<target name="set-impl-version">
|
||||
<property file="nbproject/project.properties"/>
|
||||
<antcall target="-create-jme3-svn-properties" inheritall="true">
|
||||
<param name="jme3_dir" value="../engine/"/>
|
||||
</antcall>
|
||||
<foreach target="-do-impl-version" list="${modules}" delimiter=":" param="module_dir" inheritall="true">
|
||||
<param name="set_impl_version" value="true"/>
|
||||
</foreach>
|
||||
@ -191,105 +187,19 @@
|
||||
</foreach>
|
||||
</target>
|
||||
|
||||
<!--sets/unsets implementation version to svn revision for plugins-->
|
||||
<!--sets/unsets implementation version to GIT revision for plugins-->
|
||||
<target name="-do-impl-version">
|
||||
<!--jme3 libraries-->
|
||||
<if>
|
||||
<or>
|
||||
<equals arg1="${module_dir}" arg2="jme3-core-libraries"/>
|
||||
<equals arg1="${module_dir}" arg2="jme3-project-libraries"/>
|
||||
</or>
|
||||
<then>
|
||||
<!--set jme3 libraries svn revision-->
|
||||
<property prefix="svn" file="build/jme3-lib-svn.properties"/>
|
||||
</then>
|
||||
<else>
|
||||
<!--jme3 core-->
|
||||
<if>
|
||||
<or>
|
||||
<equals arg1="${module_dir}" arg2="jme3-core-baselibs"/>
|
||||
<equals arg1="${module_dir}" arg2="jme3-project-baselibs"/>
|
||||
</or>
|
||||
<then>
|
||||
<!--set jme3 svn revision-->
|
||||
<property prefix="svn" file="build/jme3-svn.properties"/>
|
||||
</then>
|
||||
<else>
|
||||
<!--jme3 test data-->
|
||||
<if>
|
||||
<equals arg1="${module_dir}" arg2="jme3-project-testdata"/>
|
||||
<then>
|
||||
<!--set jme3 testdata svn revision-->
|
||||
<property prefix="svn" file="build/jme3-testdata-svn.properties"/>
|
||||
</then>
|
||||
<else>
|
||||
<!--jme3 tests-->
|
||||
<if>
|
||||
<equals arg1="${module_dir}" arg2="jme3-tests-template"/>
|
||||
<then>
|
||||
<!--set jme3 tests svn revision-->
|
||||
<property prefix="svn" file="build/jme3-tests-svn.properties"/>
|
||||
</then>
|
||||
<!--"normal" module-->
|
||||
<else>
|
||||
<!--load svn revision of this modules folder if we are setting the value-->
|
||||
<if>
|
||||
<equals arg1="${set_impl_version}" arg2="true"/>
|
||||
<then>
|
||||
<exec executable="svn" output="build/${module_dir}-svn.properties" dir="${module_dir}">
|
||||
<arg value="info" />
|
||||
</exec>
|
||||
<replace file="build/${module_dir}-svn.properties" token=" " value=""/>
|
||||
</then>
|
||||
</if>
|
||||
<!--set svn revision of module-->
|
||||
<property prefix="svn" file="build/${module_dir}-svn.properties"/>
|
||||
</else>
|
||||
</if>
|
||||
</else>
|
||||
</if>
|
||||
</else>
|
||||
</if>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<if>
|
||||
<equals arg1="${set_impl_version}" arg2="true"/>
|
||||
<then>
|
||||
<echo>Setting implementation version for ${module_dir} to revision: ${svn.LastChangedRev}</echo>
|
||||
<replace file="${module_dir}/manifest.mf" token="OpenIDE-Module-Implementation-Version: 0" value="OpenIDE-Module-Implementation-Version: ${svn.LastChangedRev}"/>
|
||||
<echo>Setting implementation version for ${module_dir} to revision: ${nbm.revision}</echo>
|
||||
<replace file="${module_dir}/manifest.mf" token="OpenIDE-Module-Implementation-Version: 0" value="OpenIDE-Module-Implementation-Version: ${nbm.revision}"/>
|
||||
</then>
|
||||
<else>
|
||||
<echo>Removing implementation version for ${module_dir} from revision: ${svn.LastChangedRev}</echo>
|
||||
<replace file="${module_dir}/manifest.mf" token="OpenIDE-Module-Implementation-Version: ${svn.LastChangedRev}" value="OpenIDE-Module-Implementation-Version: 0"/>
|
||||
<echo>Removing implementation version for ${module_dir} from revision: ${nbm.revision}</echo>
|
||||
<replace file="${module_dir}/manifest.mf" token="OpenIDE-Module-Implementation-Version: ${nbm.revision}" value="OpenIDE-Module-Implementation-Version: 0"/>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
</target>
|
||||
|
||||
<!--creates properties files containing svn info for the jme3 folders-->
|
||||
<target name="-create-jme3-svn-properties">
|
||||
<mkdir dir="build"/>
|
||||
<!--jme3 svn properties-->
|
||||
<exec executable="svn" dir="${jme3_dir}/src/" output="build/jme3-svn.properties">
|
||||
<arg value="info" />
|
||||
</exec>
|
||||
<replace file="build/jme3-svn.properties" token=" " value=""/>
|
||||
<!--jme3 test data svn properties-->
|
||||
<exec executable="svn" dir="${jme3_dir}/test-data/" output="build/jme3-testdata-svn.properties">
|
||||
<arg value="info" />
|
||||
</exec>
|
||||
<replace file="build/jme3-testdata-svn.properties" token=" " value=""/>
|
||||
<!--jme3 libraries svn properties-->
|
||||
<exec executable="svn" dir="${jme3_dir}/lib/" output="build/jme3-lib-svn.properties">
|
||||
<arg value="info" />
|
||||
</exec>
|
||||
<replace file="build/jme3-lib-svn.properties" token=" " value=""/>
|
||||
<!--jme3 tests svn properties-->
|
||||
<exec executable="svn" dir="${jme3_dir}/src/test/" output="build/jme3-tests-svn.properties">
|
||||
<arg value="info" />
|
||||
</exec>
|
||||
<replace file="build/jme3-tests-svn.properties" token=" " value=""/>
|
||||
</target>
|
||||
|
||||
<target name="build-installers">
|
||||
@ -298,7 +208,7 @@
|
||||
<property name="suite.location" value="${basedir}"/>
|
||||
<property name="suite.nbi.product.uid" value="${app.name}"/>
|
||||
<!--TODO: this is .0.2 because of the pre-release static 3.0.0, else the RCs could not be installed next to a beta-->
|
||||
<property name="suite.nbi.product.version" value="${plugins.version}.0.4"/>
|
||||
<property name="suite.nbi.product.version" value="${plugins.version}.0.${nbm.revision}"/>
|
||||
<property name="nbi.stub.location" value="${basedir}/nbi/stub"/>
|
||||
<property name="nbi.stub.common.location" value="${basedir}/nbi/.common"/>
|
||||
<property name="nbi.ant.tasks.jar" value="${basedir}/nbi/antlib/nbi-ant-tasks.jar"/>
|
||||
@ -311,6 +221,8 @@
|
||||
<property name="pack200.enabled" value="true"/>
|
||||
<property name="nbi.icon.file" value="${basedir}/jmonkeyplatform.png"/>
|
||||
<property name="nbi.dock.icon.file" value="${basedir}/jmonkeyplatform.icns"/>
|
||||
<property name="product.description" value="${app.description}"/>
|
||||
<property name="product.categories" value="${app.categories}"/>
|
||||
</ant>
|
||||
</target>
|
||||
|
||||
@ -339,7 +251,7 @@
|
||||
section="devel"
|
||||
depends="sun-java6-jdk"
|
||||
maintainer="jMonkeyEngine"
|
||||
homepage="http://www.jmonkeyengine.com"
|
||||
homepage="http://www.jmonkeyengine.org"
|
||||
postrm="debscripts/postrm"
|
||||
>
|
||||
<tarfileset dir="dist/${app.name}/" prefix="opt/${app.name}">
|
||||
@ -360,57 +272,4 @@
|
||||
</deb>
|
||||
</target>
|
||||
|
||||
<target name="-upload-googlecode" depends="-check-googlecode" if="googlecode.credentials.present">
|
||||
<property file="nbproject/project.properties"/>
|
||||
<property file="../../../googlecode.properties" prefix="googlecode"/>
|
||||
<echo>Upload windows installers to googlecode..</echo>
|
||||
<gcupload projectname="jmonkeyengine"
|
||||
labels="Type-Installer, OpSys-Windows, jMonkeyEngine3, Featured"
|
||||
summary="jMonkeyEngine3 SDK ${app.version} for Windows32"
|
||||
filename="${basedir}/dist/${app.name}-windows-x86.exe"
|
||||
targetfilename="jME3_SDK_${app.version}-windows-x86.exe"
|
||||
username="${googlecode.username}"
|
||||
password="${googlecode.password}"
|
||||
/>
|
||||
<gcupload projectname="jmonkeyengine"
|
||||
labels="Type-Installer, OpSys-Windows, jMonkeyEngine3, Featured"
|
||||
summary="jMonkeyEngine3 SDK ${app.version} for Windows64"
|
||||
filename="${basedir}/dist/${app.name}-windows-x64.exe"
|
||||
targetfilename="jME3_SDK_${app.version}-windows-x64.exe"
|
||||
username="${googlecode.username}"
|
||||
password="${googlecode.password}"
|
||||
/>
|
||||
<echo>Upload linux installers to googlecode..</echo>
|
||||
<gcupload projectname="jmonkeyengine"
|
||||
labels="Type-Installer, OpSys-Linux, jMonkeyEngine3, Featured"
|
||||
summary="jMonkeyEngine3 SDK ${app.version} for Linux32"
|
||||
filename="${basedir}/dist/${app.name}-linux-x86.sh"
|
||||
targetfilename="jME3_SDK_${app.version}-linux-x86.sh"
|
||||
username="${googlecode.username}"
|
||||
password="${googlecode.password}"
|
||||
/>
|
||||
<gcupload projectname="jmonkeyengine"
|
||||
labels="Type-Installer, OpSys-Linux, jMonkeyEngine3, Featured"
|
||||
summary="jMonkeyEngine3 SDK ${app.version} for Linux64"
|
||||
filename="${basedir}/dist/${app.name}-linux-x64.sh"
|
||||
targetfilename="jME3_SDK_${app.version}-linux-x64.sh"
|
||||
username="${googlecode.username}"
|
||||
password="${googlecode.password}"
|
||||
/>
|
||||
<echo>Upload mac installer to googlecode..</echo>
|
||||
<gcupload projectname="jmonkeyengine"
|
||||
labels="Type-Installer, OpSys-OSX, jMonkeyEngine3, Featured"
|
||||
summary="jMonkeyEngine3 SDK ${app.version} for MacOS X"
|
||||
filename="${basedir}/dist/${app.name}-macosx.tgz"
|
||||
targetfilename="jME3_SDK_${app.version}-macosx.tgz"
|
||||
username="${googlecode.username}"
|
||||
password="${googlecode.password}"
|
||||
/>
|
||||
</target>
|
||||
|
||||
<target name="-check-googlecode">
|
||||
<available file="../../../googlecode.properties" property="googlecode.credentials.present"/>
|
||||
</target>
|
||||
|
||||
|
||||
</project>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
#(c) jMonkeyEngine.com
|
||||
#(c) jmonkeyengine.org
|
||||
#Author Normen Hansen
|
||||
set -e
|
||||
rm -rf jdk-macosx.zip
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
#(c) jMonkeyEngine.com
|
||||
#(c) jmonkeyengine.org
|
||||
#This script creates SFX binaries of the JDK for the specified platform
|
||||
#Author Normen Hansen
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
javac.source=1.6
|
||||
javac.compilerargs=-Xlint -Xlint:-serial
|
||||
license.file=../license-jme.txt
|
||||
nbm.homepage=http://www.jmonkeyengine.com
|
||||
nbm.homepage=http://www.jmonkeyengine.org
|
||||
nbm.module.author=Normen Hansen
|
||||
nbm.needs.restart=true
|
||||
spec.version.base=3.1.0
|
||||
|
@ -1,4 +1,6 @@
|
||||
#Thu, 25 Aug 2011 20:26:50 +0200
|
||||
javac.source=1.5
|
||||
javac.source=1.6
|
||||
javac.compilerargs=-Xlint -Xlint\:-serial
|
||||
nbm.homepage=http\://www.jmonkeyengine.org
|
||||
nbm.module.author=Normen Hansen
|
||||
spec.version.base=3.1.0
|
||||
|
@ -1,8 +1,8 @@
|
||||
#Thu, 25 Aug 2011 20:26:49 +0200
|
||||
javac.source=1.5
|
||||
javac.source=1.6
|
||||
javac.compilerargs=-Xlint -Xlint\:-serial
|
||||
license.file=../license-jme.txt
|
||||
nbm.homepage=http\://www.jmonkeyengine.com
|
||||
nbm.homepage=http\://www.jmonkeyengine.org
|
||||
nbm.module.author=Normen Hansen
|
||||
nbm.needs.restart=true
|
||||
spec.version.base=3.1.0
|
||||
|
@ -1,7 +1,8 @@
|
||||
#Thu, 25 Aug 2011 20:26:50 +0200
|
||||
javac.source=1.5
|
||||
javac.source=1.6
|
||||
javac.compilerargs=-Xlint -Xlint\:-serial
|
||||
nbm.homepage=http\://www.jmonkeyengine.com
|
||||
license.file=../license-jme.txt
|
||||
nbm.homepage=http\://www.jmonkeyengine.org
|
||||
nbm.module.author=Kaelthas
|
||||
nbm.needs.restart=true
|
||||
spec.version.base=3.1.0
|
||||
|
@ -164,6 +164,14 @@ public class BlenderTool {
|
||||
return "../blender";
|
||||
}
|
||||
}
|
||||
|
||||
private static String getBlenderOsSettingsPath() {
|
||||
if (Utilities.isMac()) {
|
||||
return "../blender/blender.app/Contents/Resources";
|
||||
} else {
|
||||
return "../blender";
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean checkBlenderFolders() {
|
||||
String jmpDir = Places.getUserDirectory().getAbsolutePath();
|
||||
@ -251,9 +259,9 @@ public class BlenderTool {
|
||||
}
|
||||
|
||||
private static File getBlenderSettingsFolder() {
|
||||
File blender = InstalledFileLocator.getDefault().locate(getBlenderOsPath() + "/2.69", null, false);
|
||||
File blender = InstalledFileLocator.getDefault().locate(getBlenderOsSettingsPath() + "/2.75", null, false);
|
||||
if (blender == null) {
|
||||
blender = InstalledFileLocator.getDefault().locate(getBlenderOsPath() + "/2.67", null, false);
|
||||
blender = InstalledFileLocator.getDefault().locate(getBlenderOsSettingsPath() + "/2.69", null, false);
|
||||
}
|
||||
if (blender == null) {
|
||||
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message("Error finding Blender settings"));
|
||||
|
@ -1,8 +1,8 @@
|
||||
#Thu, 25 Aug 2011 20:26:50 +0200
|
||||
javac.source=1.5
|
||||
javac.source=1.6
|
||||
javac.compilerargs=-Xlint -Xlint\:-serial
|
||||
license.file=../license-jme.txt
|
||||
nbm.homepage=http\://www.jmonkeyengine.com
|
||||
nbm.homepage=http\://www.jmonkeyengine.org
|
||||
nbm.module.author=R\u00e9my Bouquet
|
||||
nbm.needs.restart=true
|
||||
spec.version.base=3.1.0
|
||||
|
@ -1,4 +1,7 @@
|
||||
#Thu, 25 Aug 2011 20:26:50 +0200
|
||||
javac.source=1.6
|
||||
javac.compilerargs=-Xlint -Xlint\:-serial
|
||||
license.file=../license-jme.txt
|
||||
nbm.homepage=http\://www.jmonkeyengine.org
|
||||
nbm.module.author=Normen Hansen
|
||||
spec.version.base=3.1.0
|
||||
|
@ -1,8 +1,8 @@
|
||||
#Thu, 25 Aug 2011 20:26:49 +0200
|
||||
javac.source=1.5
|
||||
javac.source=1.6
|
||||
javac.compilerargs=-Xlint -Xlint\:-serial
|
||||
license.file=../license-jme.txt
|
||||
nbm.homepage=http\://www.jmonkeyengine.com
|
||||
nbm.homepage=http\://www.jmonkeyengine.org
|
||||
nbm.module.author=Normen Hansen
|
||||
nbm.needs.restart=true
|
||||
spec.version.base=3.1.0
|
||||
|
@ -1,8 +1,8 @@
|
||||
build.xml.data.CRC32=278ea45d
|
||||
build.xml.data.CRC32=d43b0890
|
||||
build.xml.script.CRC32=cdae6a36
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@2.67.1
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=278ea45d
|
||||
nbproject/build-impl.xml.data.CRC32=d43b0890
|
||||
nbproject/build-impl.xml.script.CRC32=246f9b81
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.67.1
|
||||
|
@ -1,7 +1,7 @@
|
||||
javac.source=1.5
|
||||
javac.source=1.6
|
||||
javac.compilerargs=-Xlint -Xlint\:-serial
|
||||
license.file=../license-jme.txt
|
||||
nbm.homepage=http\://www.jmonkeyengine.com
|
||||
nbm.homepage=http\://www.jmonkeyengine.org
|
||||
nbm.module.author=jMonkeyEngine
|
||||
nbm.needs.restart=true
|
||||
spec.version.base=3.1.0
|
||||
|
@ -1,15 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<?xml version='1.0'?>
|
||||
<project xmlns='http://www.netbeans.org/ns/project/1'>
|
||||
<type>org.netbeans.modules.apisupport.project</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
|
||||
<data xmlns='http://www.netbeans.org/ns/nb-module-project/3'>
|
||||
<code-name-base>com.jme3.gde.core.baselibs</code-name-base>
|
||||
<suite-component/>
|
||||
<suite-component />
|
||||
<module-dependencies>
|
||||
<dependency>
|
||||
<code-name-base>com.jme3.gde.core.libraries</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<build-prerequisite />
|
||||
<compile-dependency />
|
||||
<run-dependency>
|
||||
<release-version>1</release-version>
|
||||
<specification-version>3.1.0</specification-version>
|
||||
@ -19,133 +19,142 @@
|
||||
<public-packages>
|
||||
<package>com.jme3.asset</package>
|
||||
<package>com.jme3.scene.plugins.blender</package>
|
||||
<package>com.jme3.scene.plugins.blender.animations</package>
|
||||
<package>com.jme3.scene.plugins.blender.cameras</package>
|
||||
<package>com.jme3.scene.plugins.blender.math</package>
|
||||
<package>com.jme3.scene.plugins.blender.constraints</package>
|
||||
<package>com.jme3.scene.plugins.blender.constraints.definitions</package>
|
||||
<package>com.jme3.scene.plugins.blender.curves</package>
|
||||
<package>com.jme3.scene.plugins.blender.file</package>
|
||||
<package>com.jme3.scene.plugins.blender.landscape</package>
|
||||
<package>com.jme3.scene.plugins.blender.lights</package>
|
||||
<package>com.jme3.scene.plugins.blender.materials</package>
|
||||
<package>com.jme3.scene.plugins.blender.math</package>
|
||||
<package>com.jme3.scene.plugins.blender.meshes</package>
|
||||
<package>com.jme3.scene.plugins.blender.modifiers</package>
|
||||
<package>com.jme3.scene.plugins.blender.objects</package>
|
||||
<package>com.jme3.scene.plugins.blender.particles</package>
|
||||
<package>com.jme3.scene.plugins.blender.cameras</package>
|
||||
<package>com.jme3.scene.plugins.blender.objects</package>
|
||||
<package>com.jme3.scene.plugins.blender.landscape</package>
|
||||
<package>com.jme3.scene.plugins.blender.modifiers</package>
|
||||
<package>com.jme3.scene.plugins.blender.textures</package>
|
||||
<package>com.jme3.scene.plugins.blender.textures.io</package>
|
||||
<package>com.jme3.scene.plugins.blender.textures.blending</package>
|
||||
<package>com.jme3.scene.plugins.blender.textures.generating</package>
|
||||
<package>com.jme3.scene.plugins.blender.textures.io</package>
|
||||
<package>checkers.quals</package>
|
||||
<package>com.jme3.animation</package>
|
||||
<package>com.jme3.app</package>
|
||||
<package>com.jme3.app.state</package>
|
||||
<package>com.jme3.asset.cache</package>
|
||||
<package>com.jme3.asset.plugins</package>
|
||||
<package>com.jme3.audio</package>
|
||||
<package>com.jme3.audio.openal</package>
|
||||
<package>com.jme3.audio.plugins</package>
|
||||
<package>com.jme3.bounding</package>
|
||||
<package>com.jme3.cinematic</package>
|
||||
<package>com.jme3.cinematic.events</package>
|
||||
<package>com.jme3.collision</package>
|
||||
<package>com.jme3.collision.bih</package>
|
||||
<package>com.jme3.cursors.plugins</package>
|
||||
<package>com.jme3.effect</package>
|
||||
<package>com.jme3.effect.influencers</package>
|
||||
<package>com.jme3.effect.shapes</package>
|
||||
<package>com.jme3.export</package>
|
||||
<package>com.jme3.export.binary</package>
|
||||
<package>com.jme3.font</package>
|
||||
<package>com.jme3.font.plugins</package>
|
||||
<package>com.jme3.input</package>
|
||||
<package>com.jme3.input.controls</package>
|
||||
<package>com.jme3.input.dummy</package>
|
||||
<package>com.jme3.input.event</package>
|
||||
<package>com.jme3.light</package>
|
||||
<package>com.jme3.material</package>
|
||||
<package>com.jme3.material.plugins</package>
|
||||
<package>com.jme3.math</package>
|
||||
<package>com.jme3.post</package>
|
||||
<package>com.jme3.profile</package>
|
||||
<package>com.jme3.renderer</package>
|
||||
<package>com.jme3.renderer.opengl</package>
|
||||
<package>com.jme3.renderer.queue</package>
|
||||
<package>com.jme3.scene</package>
|
||||
<package>com.jme3.scene.control</package>
|
||||
<package>com.jme3.scene.debug</package>
|
||||
<package>com.jme3.scene.instancing</package>
|
||||
<package>com.jme3.scene.mesh</package>
|
||||
<package>com.jme3.scene.plugins</package>
|
||||
<package>com.jme3.scene.shape</package>
|
||||
<package>com.jme3.scene.plugins.blender.animations</package>
|
||||
<package>com.jme3.scene.plugins.blender.materials</package>
|
||||
<package>com.jme3.scene.plugins.blender.file</package>
|
||||
<package>com.jme3.scene.plugins.blender.lights</package>
|
||||
<package>jme3tools.shader</package>
|
||||
<package>jme3tools.savegame</package>
|
||||
<package>jme3tools.shadercheck</package>
|
||||
<package>jme3tools.optimize</package>
|
||||
<package>jme3tools.converters</package>
|
||||
<package>com.jme3.shader</package>
|
||||
<package>com.jme3.shader.plugins</package>
|
||||
<package>com.jme3.shadow</package>
|
||||
<package>com.jme3.system</package>
|
||||
<package>com.jme3.texture</package>
|
||||
<package>com.jme3.texture.image</package>
|
||||
<package>com.jme3.texture.plugins</package>
|
||||
<package>com.jme3.ui</package>
|
||||
<package>com.jme3.export</package>
|
||||
<package>com.jme3.export.binary</package>
|
||||
<package>com.jme3.cinematic</package>
|
||||
<package>com.jme3.cinematic.events</package>
|
||||
<package>com.jme3.math</package>
|
||||
<package>com.jme3.util</package>
|
||||
<package>com.jme3.util.blockparser</package>
|
||||
<package>com.jme3.util.xml</package>
|
||||
<package>jme3tools.converters</package>
|
||||
<package>jme3tools.converters.model</package>
|
||||
<package>jme3tools.converters.model.strip</package>
|
||||
<package>jme3tools.optimize</package>
|
||||
<package>jme3tools.savegame</package>
|
||||
<package>jme3tools.shader</package>
|
||||
<package>jme3tools.shadercheck</package>
|
||||
<package>com.jme3.post</package>
|
||||
<package>com.jme3.input</package>
|
||||
<package>com.jme3.input.dummy</package>
|
||||
<package>com.jme3.input.controls</package>
|
||||
<package>com.jme3.input.event</package>
|
||||
<package>com.jme3.profile</package>
|
||||
<package>com.jme3.ui</package>
|
||||
<package>com.jme3.audio</package>
|
||||
<package>com.jme3.audio.openal</package>
|
||||
<package>com.jme3.audio.plugins</package>
|
||||
<package>com.jme3.cursors.plugins</package>
|
||||
<package>com.jme3.bounding</package>
|
||||
<package>com.jme3.shadow</package>
|
||||
<package>com.jme3.texture</package>
|
||||
<package>com.jme3.texture.image</package>
|
||||
<package>com.jme3.texture.plugins</package>
|
||||
<package>com.jme3.system</package>
|
||||
<package>com.jme3.material</package>
|
||||
<package>com.jme3.material.plugins</package>
|
||||
<package>com.jme3.renderer</package>
|
||||
<package>com.jme3.renderer.queue</package>
|
||||
<package>com.jme3.renderer.opengl</package>
|
||||
<package>com.jme3.effect</package>
|
||||
<package>com.jme3.effect.shapes</package>
|
||||
<package>com.jme3.effect.influencers</package>
|
||||
<package>com.jme3.app</package>
|
||||
<package>com.jme3.app.state</package>
|
||||
<package>com.jme3.asset.plugins</package>
|
||||
<package>com.jme3.asset.cache</package>
|
||||
<package>com.jme3.light</package>
|
||||
<package>com.jme3.animation</package>
|
||||
<package>com.jme3.collision</package>
|
||||
<package>com.jme3.collision.bih</package>
|
||||
<package>com.jme3.scene</package>
|
||||
<package>com.jme3.scene.shape</package>
|
||||
<package>com.jme3.scene.plugins</package>
|
||||
<package>com.jme3.scene.debug</package>
|
||||
<package>com.jme3.scene.instancing</package>
|
||||
<package>com.jme3.scene.control</package>
|
||||
<package>com.jme3.scene.mesh</package>
|
||||
<package>com.jme3.font</package>
|
||||
<package>com.jme3.font.plugins</package>
|
||||
<package>checkers.quals</package>
|
||||
<package>jme3tools.navigation</package>
|
||||
<package>com.jme3.input.awt</package>
|
||||
<package>com.jme3.system.awt</package>
|
||||
<package>jme3tools.navigation</package>
|
||||
<package>com.jme3.post.filters</package>
|
||||
<package>com.jme3.post.ssao</package>
|
||||
<package>com.jme3.post.filters</package>
|
||||
<package>com.jme3.water</package>
|
||||
<package>com.jme3.bullet</package>
|
||||
<package>com.jme3.bullet.collision</package>
|
||||
<package>com.jme3.bullet.collision.shapes</package>
|
||||
<package>com.jme3.bullet.collision.shapes.infos</package>
|
||||
<package>com.jme3.bullet.control</package>
|
||||
<package>com.jme3.bullet.control.ragdoll</package>
|
||||
<package>com.jme3.bullet.debug</package>
|
||||
<package>com.jme3.bullet.util</package>
|
||||
<package>com.jme3.bullet.joints</package>
|
||||
<package>com.jme3.bullet.joints.motors</package>
|
||||
<package>com.jme3.bullet.objects</package>
|
||||
<package>com.jme3.bullet.objects.infos</package>
|
||||
<package>com.jme3.bullet.util</package>
|
||||
<package>com.jme3.audio.lwjgl</package>
|
||||
<package>com.jme3.bullet.debug</package>
|
||||
<package>com.jme3.bullet.control</package>
|
||||
<package>com.jme3.bullet.control.ragdoll</package>
|
||||
<package>com.jme3.bullet.collision</package>
|
||||
<package>com.jme3.bullet.collision.shapes</package>
|
||||
<package>com.jme3.bullet.collision.shapes.infos</package>
|
||||
<package>com.jme3.input.lwjgl</package>
|
||||
<package>com.jme3.renderer.lwjgl</package>
|
||||
<package>com.jme3.audio.lwjgl</package>
|
||||
<package>com.jme3.system.lwjgl</package>
|
||||
<package>com.jme3.renderer.lwjgl</package>
|
||||
<package>com.jme3.network</package>
|
||||
<package>com.jme3.network.base</package>
|
||||
<package>com.jme3.network.kernel</package>
|
||||
<package>com.jme3.network.kernel.tcp</package>
|
||||
<package>com.jme3.network.kernel.udp</package>
|
||||
<package>com.jme3.network.kernel.tcp</package>
|
||||
<package>com.jme3.network.util</package>
|
||||
<package>com.jme3.network.message</package>
|
||||
<package>com.jme3.network.rmi</package>
|
||||
<package>com.jme3.network.base</package>
|
||||
<package>com.jme3.network.serializing</package>
|
||||
<package>com.jme3.network.serializing.serializers</package>
|
||||
<package>com.jme3.network.service</package>
|
||||
<package>com.jme3.network.service.rpc</package>
|
||||
<package>com.jme3.network.service.rpc.msg</package>
|
||||
<package>com.jme3.network.service.serializer</package>
|
||||
<package>com.jme3.niftygui</package>
|
||||
<package>com.jme3.export.xml</package>
|
||||
<package>com.jme3.scene.plugins.fbx</package>
|
||||
<package>com.jme3.scene.plugins.fbx.obj</package>
|
||||
<package>com.jme3.scene.plugins.fbx.anim</package>
|
||||
<package>com.jme3.scene.plugins.fbx.node</package>
|
||||
<package>com.jme3.scene.plugins.fbx.misc</package>
|
||||
<package>com.jme3.scene.plugins.fbx.material</package>
|
||||
<package>com.jme3.scene.plugins.fbx.file</package>
|
||||
<package>com.jme3.scene.plugins.fbx.mesh</package>
|
||||
<package>com.jme3.scene.plugins.ogre</package>
|
||||
<package>com.jme3.scene.plugins.ogre.matext</package>
|
||||
<package>com.jme3.terrain</package>
|
||||
<package>com.jme3.terrain.heightmap</package>
|
||||
<package>com.jme3.terrain.geomipmap</package>
|
||||
<package>com.jme3.terrain.geomipmap.picking</package>
|
||||
<package>com.jme3.terrain.geomipmap.grid</package>
|
||||
<package>com.jme3.terrain.geomipmap.lodcalc</package>
|
||||
<package>com.jme3.terrain.geomipmap.lodcalc.util</package>
|
||||
<package>com.jme3.terrain.geomipmap.picking</package>
|
||||
<package>com.jme3.terrain.heightmap</package>
|
||||
<package>com.jme3.terrain.noise</package>
|
||||
<package>com.jme3.terrain.noise.basis</package>
|
||||
<package>com.jme3.terrain.noise.filter</package>
|
||||
<package>com.jme3.terrain.noise.fractal</package>
|
||||
<package>com.jme3.terrain.noise.modulator</package>
|
||||
<package>com.jme3.terrain.noise.fractal</package>
|
||||
<package>com.jme3.terrain.noise.basis</package>
|
||||
</public-packages>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/jme3-blender-3.1.0-snapshot-github.jar</runtime-relative-path>
|
||||
@ -193,4 +202,4 @@
|
||||
</class-path-extension>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
||||
</project>
|
@ -1,8 +1,8 @@
|
||||
#Thu, 25 Aug 2011 20:26:48 +0200
|
||||
javac.source=1.5
|
||||
javac.source=1.6
|
||||
javac.compilerargs=-Xlint -Xlint\:-serial
|
||||
license.file=../license-jme.txt
|
||||
nbm.homepage=http\://www.jmonkeyengine.com
|
||||
nbm.homepage=http\://www.jmonkeyengine.org
|
||||
nbm.module.author=jMonkeyEngine
|
||||
nbm.needs.restart=true
|
||||
spec.version.base=3.1.0
|
||||
|
@ -6,6 +6,44 @@
|
||||
<suite-component />
|
||||
<module-dependencies />
|
||||
<public-packages>
|
||||
<package>org.ejml</package>
|
||||
<package>org.ejml.interfaces.decomposition</package>
|
||||
<package>org.ejml.interfaces.linsol</package>
|
||||
<package>org.ejml.data</package>
|
||||
<package>org.ejml.alg.dense.linsol</package>
|
||||
<package>org.ejml.ops</package>
|
||||
<package>org.ejml.factory</package>
|
||||
<package>org.ejml.alg.fixed</package>
|
||||
<package>org.ejml.alg.generic</package>
|
||||
<package>org.ejml.alg.block</package>
|
||||
<package>org.ejml.alg.block.decomposition.chol</package>
|
||||
<package>org.ejml.alg.block.decomposition.qr</package>
|
||||
<package>org.ejml.alg.block.decomposition.hessenberg</package>
|
||||
<package>org.ejml.alg.block.decomposition.bidiagonal</package>
|
||||
<package>org.ejml.alg.block.linsol.chol</package>
|
||||
<package>org.ejml.alg.block.linsol.qr</package>
|
||||
<package>org.ejml.alg.dense.decomposition</package>
|
||||
<package>org.ejml.alg.dense.decomposition.chol</package>
|
||||
<package>org.ejml.alg.dense.decomposition.lu</package>
|
||||
<package>org.ejml.alg.dense.decomposition.qr</package>
|
||||
<package>org.ejml.alg.dense.decomposition.hessenberg</package>
|
||||
<package>org.ejml.alg.dense.decomposition.svd</package>
|
||||
<package>org.ejml.alg.dense.decomposition.svd.implicitqr</package>
|
||||
<package>org.ejml.alg.dense.decomposition.eig</package>
|
||||
<package>org.ejml.alg.dense.decomposition.eig.watched</package>
|
||||
<package>org.ejml.alg.dense.decomposition.eig.symm</package>
|
||||
<package>org.ejml.alg.dense.decomposition.bidiagonal</package>
|
||||
<package>org.ejml.alg.dense.mult</package>
|
||||
<package>org.ejml.alg.dense.misc</package>
|
||||
<package>org.ejml.alg.dense.linsol.chol</package>
|
||||
<package>org.ejml.alg.dense.linsol.lu</package>
|
||||
<package>org.ejml.alg.dense.linsol.qr</package>
|
||||
<package>org.ejml.alg.dense.linsol.svd</package>
|
||||
<package>org.ejml.simple</package>
|
||||
<package>org.ejml.alg.dense.decompose</package>
|
||||
<package>org.ejml.alg.dense.decompose.chol</package>
|
||||
<package>org.ejml.alg.dense.decompose.lu</package>
|
||||
<package>org.ejml.alg.dense.decompose.qr</package>
|
||||
<package>com.bulletphysics</package>
|
||||
<package>com.bulletphysics.collision.broadphase</package>
|
||||
<package>com.bulletphysics.collision.dispatch</package>
|
||||
@ -161,6 +199,22 @@
|
||||
<package>org.jglfont.impl.format.awt</package>
|
||||
<package>org.jglfont.impl</package>
|
||||
</public-packages>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/core-0.27.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/core-0.27.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/dense64-0.27.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/dense64-0.27.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/simple-0.27.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/simple-0.27.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/denseC64-0.27.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/denseC64-0.27.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/jbullet.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/jbullet.jar</binary-origin>
|
||||
|
@ -1,8 +1,8 @@
|
||||
build.xml.data.CRC32=08468784
|
||||
build.xml.data.CRC32=e145fa2a
|
||||
build.xml.script.CRC32=cfa8d5c5
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@2.67.1
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=08468784
|
||||
nbproject/build-impl.xml.data.CRC32=e145fa2a
|
||||
nbproject/build-impl.xml.script.CRC32=270846fb
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.67.1
|
||||
|
@ -1,4 +1,4 @@
|
||||
#Thu, 25 Aug 2011 20:26:49 +0200
|
||||
javac.source=1.5
|
||||
javac.source=1.6
|
||||
javac.compilerargs=-Xlint -Xlint\:-serial
|
||||
spec.version.base=3.1.0
|
||||
|
@ -8,6 +8,8 @@
|
||||
<module-dependencies>
|
||||
<dependency>
|
||||
<code-name-base>org.netbeans.modules.autoupdate.services</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>1.47.2</specification-version>
|
||||
</run-dependency>
|
||||
|
@ -0,0 +1 @@
|
||||
com.jme3.gde.core.updatecenters.keystore.JmeKeyStoreProvider
|
@ -1,7 +1,7 @@
|
||||
#jMP update centers
|
||||
com_jme3_gde_core_update_center_nightly=http://updates.jmonkeyengine.org/nightly/3.0/plugins/updates.xml
|
||||
com_jme3_gde_core_update_center_stable=http://updates.jmonkeyengine.org/stable/3.0/plugins/updates.xml
|
||||
com_jme3_jmp_contributions_update_center=http://updates.jmonkeyengine.org/contributions/updates.xml
|
||||
com_jme3_gde_core_update_center_nightly=http://updates.jmonkeyengine.org/nightly/3.1/plugins/updates.xml
|
||||
com_jme3_gde_core_update_center_stable=http://updates.jmonkeyengine.org/stable/3.1/plugins/updates.xml
|
||||
com_jme3_jmp_contributions_update_center=http://updates.jmonkeyengine.org/contrib/3.1/updates.xml
|
||||
|
||||
#jMP update centers
|
||||
Services/AutoupdateType/com_jme3_gde_core_update_center_nightly.instance=jMonkeyEngine SDK Nightly (Breaks!)
|
||||
|
@ -0,0 +1,47 @@
|
||||
package com.jme3.gde.core.updatecenters.keystore;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.security.KeyStore;
|
||||
import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.cert.CertificateException;
|
||||
import org.netbeans.spi.autoupdate.KeyStoreProvider;
|
||||
import org.openide.util.Exceptions;
|
||||
|
||||
/**
|
||||
* Loads the jMonkeyEngine SDK Plugins certificates into the AutoUpdate system.
|
||||
*
|
||||
* @author Kirill Vainer
|
||||
*/
|
||||
public class JmeKeyStoreProvider implements KeyStoreProvider {
|
||||
|
||||
@Override
|
||||
public KeyStore getKeyStore() {
|
||||
InputStream in = null;
|
||||
try {
|
||||
in = JmeKeyStoreProvider.class.getResourceAsStream("trustedcerts.jks");
|
||||
KeyStore store = KeyStore.getInstance("JKS");
|
||||
store.load(in, "trustedcerts".toCharArray());
|
||||
return store;
|
||||
} catch (KeyStoreException ex) {
|
||||
Exceptions.printStackTrace(ex);
|
||||
} catch (IOException ex) {
|
||||
Exceptions.printStackTrace(ex);
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
Exceptions.printStackTrace(ex);
|
||||
} catch (CertificateException ex) {
|
||||
Exceptions.printStackTrace(ex);
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException ex) {
|
||||
Exceptions.printStackTrace(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
@ -1,10 +1,10 @@
|
||||
#Thu, 25 Aug 2011 20:26:48 +0200
|
||||
file.reference.DDSUtils.jar=release/modules/ext/DDSUtils.jar
|
||||
#Thu, 25 Aug 2011 19:32:54 +0200
|
||||
javac.source=1.5
|
||||
javac.source=1.6
|
||||
javac.compilerargs=-Xlint -Xlint\:-serial
|
||||
license.file=../license-jme.txt
|
||||
nbm.homepage=http\://www.jmonkeyengine.com
|
||||
nbm.homepage=http\://www.jmonkeyengine.org
|
||||
nbm.module.author=Normen Hansen
|
||||
nbm.needs.restart=true
|
||||
project.license=jme
|
||||
|
10
sdk/jme3-dark-laf/README.md
Normal file
10
sdk/jme3-dark-laf/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# DarkMonkey
|
||||
Netbeans LAF and FAC combo - uses NimROD and Obsidian
|
||||
|
||||
This is a plug-in for for Netbeans 8+ (well, the version it was developed for is 8.0.2). We wanted a dark theme variant for the jMonkeyEngine 3.1 sdk, so we made one. Enjoy!
|
||||
|
||||

|
||||
|
||||
## Features
|
||||
- Adds the DarkMonkey LaF to the Netbeans 8 environment under appearance - It's NimROD with a couple of tweaks. We've just adapted Nilo's wonderful project for the look we were going for.
|
||||
- Adds the DarkMonkey FaC to the editor profile listing - It's Obsidian with some tweaks. DejaVu Sans Mono brings some sophistication to an otherwise courier world.
|
8
sdk/jme3-dark-laf/build.xml
Normal file
8
sdk/jme3-dark-laf/build.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
|
||||
<!-- for some information on what you could do (e.g. targets to override). -->
|
||||
<!-- If you delete this file and reopen the project it will be recreated. -->
|
||||
<project name="org.jme3.netbeans.plaf.darkmonkey" default="netbeans" basedir=".">
|
||||
<description>Builds, tests, and runs the project org.jme3.netbeans.plaf.darkmonkey.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
</project>
|
7
sdk/jme3-dark-laf/manifest.mf
Normal file
7
sdk/jme3-dark-laf/manifest.mf
Normal file
@ -0,0 +1,7 @@
|
||||
Manifest-Version: 1.0
|
||||
OpenIDE-Module: org.jme3.netbeans.plaf.darkmonkey/1
|
||||
OpenIDE-Module-Implementation-Version: 0
|
||||
OpenIDE-Module-Install: org/jme3/netbeans/plaf/darkmonkey/Installer.class
|
||||
OpenIDE-Module-Layer: org/jme3/netbeans/plaf/darkmonkey/layer.xml
|
||||
OpenIDE-Module-Localizing-Bundle: org/jme3/netbeans/plaf/darkmonkey/Bundle.properties
|
||||
|
45
sdk/jme3-dark-laf/nbproject/build-impl.xml
Normal file
45
sdk/jme3-dark-laf/nbproject/build-impl.xml
Normal file
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
||||
*** EDIT ../build.xml INSTEAD ***
|
||||
-->
|
||||
<project name="org.jme3.netbeans.plaf.darkmonkey-impl" basedir="..">
|
||||
<fail message="Please build using Ant 1.7.1 or higher.">
|
||||
<condition>
|
||||
<not>
|
||||
<antversion atleast="1.7.1"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<property file="nbproject/private/suite-private.properties"/>
|
||||
<property file="nbproject/suite.properties"/>
|
||||
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
|
||||
<property file="${suite.dir}/nbproject/private/platform-private.properties"/>
|
||||
<property file="${suite.dir}/nbproject/platform.properties"/>
|
||||
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="name"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{name}" value="${@{value}}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||
<attribute name="property"/>
|
||||
<attribute name="value"/>
|
||||
<sequential>
|
||||
<property name="@{property}" value="@{value}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
<property file="${user.properties.file}"/>
|
||||
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
|
||||
<condition>
|
||||
<not>
|
||||
<contains string="${cluster.path.evaluated}" substring="platform"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<import file="${harness.dir}/build.xml"/>
|
||||
</project>
|
8
sdk/jme3-dark-laf/nbproject/genfiles.properties
Normal file
8
sdk/jme3-dark-laf/nbproject/genfiles.properties
Normal file
@ -0,0 +1,8 @@
|
||||
build.xml.data.CRC32=8f3042a8
|
||||
build.xml.script.CRC32=c15f5ee0
|
||||
build.xml.stylesheet.CRC32=a56c6a5b@2.67.1
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=8f3042a8
|
||||
nbproject/build-impl.xml.script.CRC32=4524e469
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.67.1
|
8
sdk/jme3-dark-laf/nbproject/project.properties
Normal file
8
sdk/jme3-dark-laf/nbproject/project.properties
Normal file
@ -0,0 +1,8 @@
|
||||
file.reference.nimrodlf.jar=release/modules/ext/nimrodlf.jar
|
||||
javac.source=1.7
|
||||
javac.compilerargs=-Xlint -Xlint:-serial
|
||||
license.file=../license-jme.txt
|
||||
nbm.homepage=http://www.jmonkeyengine.org
|
||||
nbm.module.author=Charles Anderson, R\u00e9my Bouquet
|
||||
nbm.needs.restart=true
|
||||
spec.version.base=3.1.0
|
49
sdk/jme3-dark-laf/nbproject/project.xml
Normal file
49
sdk/jme3-dark-laf/nbproject/project.xml
Normal file
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.apisupport.project</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
|
||||
<code-name-base>org.jme3.netbeans.plaf.darkmonkey</code-name-base>
|
||||
<suite-component/>
|
||||
<module-dependencies>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.awt</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.62.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.modules</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>7.43.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.util</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>8.39.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<code-name-base>org.openide.windows</code-name-base>
|
||||
<build-prerequisite/>
|
||||
<compile-dependency/>
|
||||
<run-dependency>
|
||||
<specification-version>6.71.1</specification-version>
|
||||
</run-dependency>
|
||||
</dependency>
|
||||
</module-dependencies>
|
||||
<public-packages/>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/nimrodlf.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/nimrodlf.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
1
sdk/jme3-dark-laf/nbproject/suite.properties
Normal file
1
sdk/jme3-dark-laf/nbproject/suite.properties
Normal file
@ -0,0 +1 @@
|
||||
suite.dir=${basedir}/..
|
BIN
sdk/jme3-dark-laf/release/modules/ext/nimrodlf.jar
Normal file
BIN
sdk/jme3-dark-laf/release/modules/ext/nimrodlf.jar
Normal file
Binary file not shown.
@ -0,0 +1,10 @@
|
||||
OpenIDE-Module-Name=DarkMonkey
|
||||
OpenIDE-Module-Display-Category=Appearance
|
||||
OpenIDE-Module-Short-Description=Contains DarkMonkey theme for the JME3.1 stable release
|
||||
OpenIDE-Module-Long-Description=\
|
||||
<div style="background:#333333;color:#995500; font-family:'Kreon',serif;margin: 3px, #777777;"/> <img src="http://hub.jmonkeyengine.org/uploads/default/1252/91fcc91347189c84.png" style="margin-left:auto;margin-right:auto"/><br/><h1 style="font-weight:bold;text-align:center;">DarkMonkey Theme</h1> <p style="color:#aaaaaa;">This is a Fonts/Colors and LookAndFeel combo that utilizes <a style="color:#999900" href="http://jamesmcfadden.co.uk/netbeans-obsidian-theme/" target="new">James McFadden's Obsidian Fonts/Colors</a>and <a style="color:#999900" href="http://nilogonzalez.es/nimrodlf/download-en.html" target="new">Nilo Gonzalez's Nimrod LookAndFeel</a> which isbased on the Metal LookAndFeel. \
|
||||
This module just checks and sees if the user already has the components, and if not, installs the theme and activates a few options:\n</p><UL> <LI> under Tools - Options - Appearance - LookAndFeel it will have "DarkMonkey" , available.\
|
||||
</LI><LI> It also adds a Fonts/Colors Profile called "Dark Monkey".\
|
||||
</LI></UL> <p style="color:#aaaaaa;"> We hope you like it!\
|
||||
</p> For More Information visit: <a style="color:#999900" href="http://hub.jmonkeyengine.org/t/darkmonkey-dev-blog/31566" target="new"> DarkMonkey Development Thread </a> </div>
|
||||
|
@ -0,0 +1,288 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.jme3.netbeans.plaf.darkmonkey;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.awt.FontFormatException;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.image.BandedSampleModel;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DataBuffer;
|
||||
import java.awt.image.DataBufferFloat;
|
||||
import java.awt.image.Raster;
|
||||
import java.awt.image.WritableRaster;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
/**
|
||||
* I figured it would be best to have a Utilities type class to store the
|
||||
* Methods I commonly use. Resources, registering stuff, resolving, transforming
|
||||
* and so on...
|
||||
*
|
||||
* @author charles
|
||||
*/
|
||||
public class DMUtils {
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* This method loads a picture from a relative path string. The relative
|
||||
* path's root directory is understood to be inside of a jar... and in
|
||||
* relation to the package of the referring Object instance.
|
||||
* </p>
|
||||
* <p>
|
||||
* For example: if the object is an instance of
|
||||
* org.jme3.netbeans.plaf.darkmonkey.DarkMonkeyIconFactory.class, and the
|
||||
* string is "icons/MyCloseIcon.png", it will attempt to load
|
||||
* org/jme3/netbeans/plaf/darkmonkey/icons/MyCloseIcon.png from
|
||||
* DarkMonkeyIconFactory's jar file.
|
||||
* </p>
|
||||
* It will print a stack trace if you get the relative path wrong.
|
||||
*
|
||||
* @param refObj - Reference Object(Object) - meant for a standard 'this'
|
||||
* call, though any Instantiated class can be used. This is part of a
|
||||
* workaround for Netbean's multiple class loader system.
|
||||
* @param fileName - File Name(String) - the path to an image relative to
|
||||
* the Reference Object's location in a jar file.
|
||||
* @return BufferedImage - Freshly converted from the image file found at
|
||||
* the location.
|
||||
*/
|
||||
public static BufferedImage loadImagefromJar(Object refObj, String fileName) {
|
||||
BufferedImage bi = null;
|
||||
try {
|
||||
bi = ImageIO.read(refObj.getClass().getResourceAsStream(fileName));
|
||||
} catch (IOException e) {
|
||||
// File is probably referenced wrong or "mispleled"... lol.
|
||||
e.printStackTrace();
|
||||
}
|
||||
return bi;
|
||||
}
|
||||
|
||||
/**<p>
|
||||
* This utility method is designed to Load OpenType/TrueType fonts into the
|
||||
* current Runtime Environment without installing them to the OS. It takes
|
||||
* the base path of the refObj and loads font files located relative to it.
|
||||
* It checks to make sure that the fonts are not already installed in the system
|
||||
* OS, first. If they are already installed, it does nothing more.
|
||||
* </p><p>
|
||||
* Typical Usage - DMUtils.loadFontsFromJar(this, someFontFiles);<br/>
|
||||
* and then someFontFiles[0] would contain something like "myfonts/DisFontPlain.ttf"
|
||||
* </p>
|
||||
* @param refObj - Object - Usually just a *this*, but useful for a multiClassLoader
|
||||
* type situation.
|
||||
* @param fileNames - String[] - an array of {relative path + filename} strings for loading
|
||||
* TrueType or OpenType fonts
|
||||
*/
|
||||
public static void loadFontsFromJar(Object refObj, String[] fileNames) {
|
||||
//first, we grab ahold of what all fonts are in the JRE's system
|
||||
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
Font[] fontsListing = ge.getAllFonts();
|
||||
|
||||
/* // this can be uncommented if you want to see all the fonts in the JRE
|
||||
for (Font fontInListing : fontsListing) {
|
||||
System.out.println(fontInListing.getFontName() + " : " + fontInListing.getFamily());
|
||||
}
|
||||
*/
|
||||
|
||||
// Then we go and process the incoming streams
|
||||
InputStream inStream;
|
||||
Font checkFont;
|
||||
try {
|
||||
toNextFileName:
|
||||
for (String fileName : fileNames) {// load up the fileName to process...
|
||||
checkFont = Font.createFont(Font.TRUETYPE_FONT, refObj.getClass().getResourceAsStream(fileName));
|
||||
for (Font fontInListing : fontsListing) {// check if it's already on the list
|
||||
if (fontInListing.getFontName().equals(checkFont.getFontName())) {
|
||||
continue toNextFileName; //head to the next file if we find it...
|
||||
}
|
||||
}
|
||||
ge.registerFont(checkFont);// and register it if we don't....
|
||||
}
|
||||
} catch (FontFormatException | IOException e) {
|
||||
// a File is probably referenced wrong or "mispleled"... lol.
|
||||
// you can alternativly send a single String for debugging purposes
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method transforms the inputed BufferedImage by the supplied Color[].
|
||||
* The behavior treats the Color[] as Ordered Passes A, R, G, B for .length
|
||||
* 4 or more. It treats it as Ordered Passes R, G, B only for .length 3 or
|
||||
* less.
|
||||
*
|
||||
* @param colorSet Color[] - that processes [1..4] up to four palette
|
||||
* colors. 3 or less uses R,G,B passes only. 4 uses A,R,G,B and ignores
|
||||
* anything more.
|
||||
* @param clearToColorRequested - Color - A color to Blend with the First
|
||||
* Translucent Pass - Optional
|
||||
* @param argbMappedBufferedImage - BufferedImage - The image containing
|
||||
* Channels as Alpha for the Palette
|
||||
* @return BufferedImage - a new BufferedImage() transformed by the palette.
|
||||
*/
|
||||
public static BufferedImage paletteSwapARGB8(Color[] colorSet, Color clearToColorRequested, BufferedImage argbMappedBufferedImage) {
|
||||
if (argbMappedBufferedImage == null) {
|
||||
return null; //S.E.P.
|
||||
}
|
||||
final Color BLACK_NO_ALPHA = new Color(0x00000000);
|
||||
final Color WHITE_NO_ALPHA = new Color(0x00FFFFFF);
|
||||
final int ALPHA = 3; // this is some static mapping for...
|
||||
final int RED = 0; // readability in the following...
|
||||
final int GREEN = 1; // Magic code section of band processing.
|
||||
final int BLUE = 2;
|
||||
final int[] orderedBands = {ALPHA, RED, GREEN, BLUE};
|
||||
//first we prep a cmap with blank passes and
|
||||
Color[] cMap = {BLACK_NO_ALPHA, BLACK_NO_ALPHA, BLACK_NO_ALPHA, BLACK_NO_ALPHA};
|
||||
boolean clearColorFound = false;
|
||||
Color clearToColor = BLACK_NO_ALPHA;
|
||||
if (colorSet != null) { //if we get a null colorSet... it's all mapped to clear.
|
||||
if (colorSet.length > cMap.length) { // if colorSet is more than 4, we only proces up to 4
|
||||
for (int i = 0; i < cMap.length; i++) {
|
||||
if (colorSet[i] != null) {
|
||||
if (!clearColorFound) {
|
||||
clearColorFound = true;
|
||||
clearToColor = colorSet[i];
|
||||
}
|
||||
cMap[orderedBands[i]] = colorSet[i]; // and finally, if any of the Colors are null... invisible pass...
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int startOffset = 0;
|
||||
if (colorSet.length < 4) // if less than standard size, assume RGB model
|
||||
{
|
||||
startOffset++; // and "blank" the alpha color pass.
|
||||
}
|
||||
for (int i = 0; i < colorSet.length; i++) {
|
||||
if (colorSet[i] != null) {
|
||||
if (!clearColorFound) {
|
||||
clearColorFound = true;
|
||||
clearToColor = colorSet[i];
|
||||
}
|
||||
cMap[orderedBands[i + startOffset]] = colorSet[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// finally adjust the clearToColor if one was requested
|
||||
if (clearToColorRequested != null) {
|
||||
clearToColor = clearToColorRequested;
|
||||
}
|
||||
//Next we'll switch to Rasters to easily handle floating point precision
|
||||
// operations upon the individual channels.
|
||||
|
||||
WritableRaster outRaster, inRaster;
|
||||
int w = argbMappedBufferedImage.getWidth();
|
||||
int h = argbMappedBufferedImage.getHeight();
|
||||
BandedSampleModel inSM = new BandedSampleModel(DataBuffer.TYPE_FLOAT, w, h, 4);
|
||||
DataBufferFloat inDBF = new DataBufferFloat((w * h), 4);//4 banks, and total size
|
||||
inRaster = Raster.createWritableRaster(inSM, inDBF, null); // that null just means point 0, 0 (top/left)
|
||||
outRaster = inRaster.createCompatibleWritableRaster(w, h);
|
||||
float[] cMaptoFlArray, outColortoFlArray, clearColortoFlArray;
|
||||
float inBandAsAlpha;
|
||||
Color paletteColor;
|
||||
// now we convert from W/E the argbMappedBufferedImage's format to
|
||||
// our normalized [0f..1f] RGBA raster
|
||||
outColortoFlArray = new float[]{0f, 0f, 0f, 0f}; // or new float[4]... w/e
|
||||
clearColortoFlArray = clearToColor.getRGBComponents(new float[4]);
|
||||
clearColortoFlArray[ALPHA] = 0f;
|
||||
for (int y = 0; y < h; y++) {
|
||||
for (int x = 0; x < w; x++) {
|
||||
int packedPixel = argbMappedBufferedImage.getRGB(x, y);
|
||||
int testing;
|
||||
float ftesting;
|
||||
//outColortoFlArray[ALPHA] = (((packedPixel >> 24) & 0xFF) / 255);
|
||||
testing = packedPixel;
|
||||
testing = testing >> 24;
|
||||
testing = testing & 0xFF;
|
||||
ftesting = testing;
|
||||
ftesting = ftesting / 255;
|
||||
outColortoFlArray[ALPHA] = ftesting;
|
||||
|
||||
//outColortoFlArray[RED] = (((packedPixel >> 16) & 0xFF) / 255);
|
||||
testing = packedPixel;
|
||||
testing = testing >> 16;
|
||||
testing = testing & 0xFF;
|
||||
ftesting = testing;
|
||||
ftesting = ftesting / 255;
|
||||
outColortoFlArray[RED] = ftesting;
|
||||
|
||||
//outColortoFlArray[GREEN] = (((packedPixel >> 8) & 0xFF) / 255);
|
||||
testing = packedPixel;
|
||||
testing = testing >> 8;
|
||||
testing = testing & 0xFF;
|
||||
ftesting = testing;
|
||||
ftesting = ftesting / 255;
|
||||
outColortoFlArray[GREEN] = ftesting;
|
||||
|
||||
//outColortoFlArray[BLUE] = ( (packedPixel & 0xFF) / 255);
|
||||
testing = packedPixel;
|
||||
testing = testing & 0xFF;
|
||||
ftesting = testing;
|
||||
ftesting = ftesting / 255;
|
||||
outColortoFlArray[BLUE] = ftesting;
|
||||
|
||||
inRaster.setPixel(x, y, outColortoFlArray);
|
||||
outRaster.setPixel(x, y, clearColortoFlArray);
|
||||
}
|
||||
}
|
||||
// next, we process all bands in order - a "band" being one channel of A,R,G,B.
|
||||
// as each band is processed the outRaster keeps getting "resampled" to apply
|
||||
// the next band properly. all values are considered normalized [0f..1f]
|
||||
for (int band : orderedBands) {
|
||||
paletteColor = cMap[band];
|
||||
cMaptoFlArray = paletteColor.getRGBComponents(new float[4]);// this nullifies translucency
|
||||
if (paletteColor != BLACK_NO_ALPHA) {
|
||||
for (int y = 0; y < h; y++) {
|
||||
for (int x = 0; x < w; x++) {
|
||||
//inBandAsAlpha = inRaster.getSample(x, y, band);
|
||||
inBandAsAlpha = inRaster.getSampleFloat(x, y, band);
|
||||
outColortoFlArray = outRaster.getPixel(x, y, new float[4]);
|
||||
outColortoFlArray[RED] = (outColortoFlArray[RED]
|
||||
* (1f - (inBandAsAlpha * cMaptoFlArray[ALPHA])))
|
||||
+ (cMaptoFlArray[RED] * (inBandAsAlpha * cMaptoFlArray[ALPHA]));
|
||||
outColortoFlArray[GREEN] = (outColortoFlArray[GREEN]
|
||||
* (1f - (inBandAsAlpha * cMaptoFlArray[ALPHA])))
|
||||
+ (cMaptoFlArray[GREEN] * (inBandAsAlpha * cMaptoFlArray[ALPHA]));
|
||||
outColortoFlArray[BLUE] = (outColortoFlArray[BLUE]
|
||||
* (1f - (inBandAsAlpha * cMaptoFlArray[ALPHA])))
|
||||
+ (cMaptoFlArray[BLUE] * (inBandAsAlpha * cMaptoFlArray[ALPHA]));
|
||||
|
||||
outColortoFlArray[ALPHA] = (outColortoFlArray[ALPHA]
|
||||
* (1f - (inBandAsAlpha * cMaptoFlArray[ALPHA])))
|
||||
+ (cMaptoFlArray[ALPHA] * (inBandAsAlpha * cMaptoFlArray[ALPHA]));
|
||||
|
||||
outRaster.setPixel(x, y, outColortoFlArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//then we convert n' ship
|
||||
BufferedImage returnBI = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
|
||||
for (int y = 0; y < h; y++) {
|
||||
for (int x = 0; x < w; x++) {
|
||||
outColortoFlArray = outRaster.getPixel(x, y, new float[4]);
|
||||
int packedColor = ((int) (outColortoFlArray[ALPHA] * 255f) << 24)
|
||||
| ((int) (outColortoFlArray[RED] * 255f) << 16)
|
||||
| ((int) (outColortoFlArray[GREEN] * 255f) << 8)
|
||||
| ((int) (outColortoFlArray[BLUE] * 255f));
|
||||
returnBI.setRGB(x, y, packedColor);
|
||||
}
|
||||
}
|
||||
|
||||
return returnBI;
|
||||
}
|
||||
|
||||
public static BufferedImage paletteSwapARGB8(Color[] colorSet, BufferedImage argbMappedBufferedImage) {
|
||||
|
||||
return paletteSwapARGB8(colorSet, null, argbMappedBufferedImage);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
nimrodlf.p1=#77411D
|
||||
nimrodlf.p2=#9E5F28
|
||||
nimrodlf.p3=#948519
|
||||
nimrodlf.s1=#303030
|
||||
nimrodlf.s2=#3A3A3A
|
||||
nimrodlf.s3=#515151
|
||||
nimrodlf.w=#262626
|
||||
nimrodlf.b=#E8EAE0
|
||||
nimrodlf.menuOpacity=219
|
||||
nimrodlf.frameOpacity=180
|
||||
nimrodlf.font=DejaVu Sans Condensed-BOLD-12
|
@ -0,0 +1,153 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.jme3.netbeans.plaf.darkmonkey;
|
||||
|
||||
import com.nilo.plaf.nimrod.NimRODIconFactory;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Image;
|
||||
import java.awt.image.BandedSampleModel;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DataBuffer;
|
||||
import java.awt.image.DataBufferFloat;
|
||||
import java.awt.image.Raster;
|
||||
import java.awt.image.WritableRaster;
|
||||
import java.io.Serializable;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.plaf.UIResource;
|
||||
|
||||
/**
|
||||
* This class provides for overrides on the system Icons from the
|
||||
* NimROD look and feel
|
||||
* @author charles
|
||||
*/
|
||||
public class DarkMonkeyIconFactory extends NimRODIconFactory{
|
||||
private static Icon treeCollapsedIcon;
|
||||
private static Icon treeExpandedIcon;
|
||||
|
||||
public static Icon getTreeCollapsedIcon(){
|
||||
if(treeCollapsedIcon == null){
|
||||
treeCollapsedIcon = new TreeCollapsedIcon();
|
||||
}
|
||||
|
||||
return treeCollapsedIcon;
|
||||
}
|
||||
public static Icon getTreeExpandedIcon(){
|
||||
if(treeExpandedIcon == null){
|
||||
treeExpandedIcon = new TreeExpandedIcon();
|
||||
}
|
||||
|
||||
return treeExpandedIcon;
|
||||
}
|
||||
|
||||
|
||||
private static class TreeCollapsedIcon implements Icon, UIResource, Serializable{
|
||||
private int w, h;
|
||||
ImageIcon preProcessed;
|
||||
{
|
||||
w = 18;
|
||||
h = 18;
|
||||
preProcessed = null;
|
||||
}
|
||||
|
||||
public TreeCollapsedIcon(){ //maybe THIS is all I need, eh?
|
||||
w = 18;
|
||||
h = 18;
|
||||
preProcessed = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
if(preProcessed != null){
|
||||
preProcessed.paintIcon(c, g, x, y);
|
||||
return;
|
||||
}
|
||||
|
||||
//process for first time, unless this gets "uninitialized" by
|
||||
// UIResource calls;
|
||||
BufferedImage bi = DMUtils.loadImagefromJar(this, "icons/nehonC2.png");
|
||||
// start the experiments!
|
||||
|
||||
Color[] normColorSet = {null, DarkMonkeyLookAndFeel.getWhite(),
|
||||
null, DarkMonkeyLookAndFeel.getPrimaryControl()};
|
||||
bi = DMUtils.paletteSwapARGB8(normColorSet, bi);
|
||||
// end experiment, back to old code
|
||||
ImageIcon ii = new ImageIcon(bi);
|
||||
Image scaled = ii.getImage();
|
||||
ImageIcon preProcess = new ImageIcon(scaled.getScaledInstance(w, h, Image.SCALE_SMOOTH));
|
||||
preProcess.paintIcon(c, g, x, y);
|
||||
preProcessed = preProcess;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth() {
|
||||
return w;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight() {
|
||||
return h;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TreeExpandedIcon implements Icon, UIResource, Serializable{
|
||||
private int w, h;
|
||||
ImageIcon preProcessed;
|
||||
{
|
||||
w = 18;
|
||||
h = 18;
|
||||
preProcessed = null;
|
||||
}
|
||||
|
||||
|
||||
public TreeExpandedIcon(){ //maybe THIS is all I need, eh?
|
||||
w = 18;
|
||||
h = 18;
|
||||
preProcessed = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
if(preProcessed != null){
|
||||
preProcessed.paintIcon(c, g, x, y);
|
||||
return;
|
||||
}
|
||||
|
||||
//process for first time, unless this gets "uninitialized" by
|
||||
// UIResource calls;
|
||||
|
||||
BufferedImage bi = DMUtils.loadImagefromJar(this, "icons/nehonE2.png");
|
||||
Color[] normColorSet = { DarkMonkeyLookAndFeel.getWhite(),
|
||||
null, DarkMonkeyLookAndFeel.getPrimaryControl()};
|
||||
bi = DMUtils.paletteSwapARGB8(normColorSet, bi);
|
||||
|
||||
ImageIcon ii = new ImageIcon(bi);
|
||||
Image scaled = ii.getImage();
|
||||
|
||||
ImageIcon preProcess = new ImageIcon(scaled.getScaledInstance(w, h, Image.SCALE_DEFAULT));
|
||||
|
||||
preProcess.paintIcon(c, g, x, y);
|
||||
preProcessed = preProcess;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth() {
|
||||
return w;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight() {
|
||||
return h;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.jme3.netbeans.plaf.darkmonkey;
|
||||
|
||||
import com.nilo.plaf.nimrod.NimRODTheme;
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.util.Enumeration;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.UIDefaults;
|
||||
|
||||
/**
|
||||
* The DarkMonkey look and feel class Extends the Nimrod LAF, which in turn,
|
||||
* extends Metal. The version of Nimrod used is 1.2b obtained from: <br/>
|
||||
* <a src="http://nilogonzalez.es/nimrodlf/download-en.html">
|
||||
* http://nilogonzalez.es/nimrodlf/download-en.html</a>
|
||||
* <p> A copy of the jar and source used for this project is in the ext/ folder.
|
||||
* </p>
|
||||
*
|
||||
* @author Charles Anderson
|
||||
*/
|
||||
public class DarkMonkeyLookAndFeel extends com.nilo.plaf.nimrod.NimRODLookAndFeel{
|
||||
|
||||
public static final String dmLAFDefault = "DarkMonkey.theme";
|
||||
protected static NimRODTheme nrTheme = new NimRODTheme();
|
||||
|
||||
public DarkMonkeyLookAndFeel(){
|
||||
super();
|
||||
// Todo: replace following code with proper loading
|
||||
// From DarkMonkey.theme
|
||||
NimRODTheme nt = new NimRODTheme();
|
||||
|
||||
nt.setBlack(Color.decode("#E8EAE0"));
|
||||
nt.setWhite(Color.decode("#262626"));
|
||||
nt.setPrimary1(Color.decode("#77411D"));
|
||||
nt.setPrimary2(Color.decode("#9E5F28"));
|
||||
nt.setPrimary3(Color.decode("#948519"));
|
||||
nt.setSecondary1(Color.decode("#303030"));
|
||||
nt.setSecondary2(Color.decode("#3A3A3A"));
|
||||
nt.setSecondary3(Color.decode("#515151"));
|
||||
nt.setFrameOpacity(180);
|
||||
nt.setMenuOpacity(219);
|
||||
nt.setFont(Font.decode("DejaVu Sans Condensed-PLAIN-12"));
|
||||
|
||||
setCurrentTheme(nt);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method override, getID() returns the String "DarkMonkey" for
|
||||
* registering this Look And Feel with the UImanager.
|
||||
* @return String "DarkMonkey"
|
||||
*/
|
||||
@Override
|
||||
public String getID() {
|
||||
return "DarkMonkey";
|
||||
}
|
||||
|
||||
/**
|
||||
* This method override, getName() returns the String "DarkMonkey" for
|
||||
* its Look and Feel Name. I don't know that this is important, but is
|
||||
* overridden anyway, for completion.
|
||||
* @return String "DarkMonkey"
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return "DarkMonkey";
|
||||
}
|
||||
|
||||
/**
|
||||
* This method override, getDescription() returns the String
|
||||
* "Look and Feel DarkMonkey - 2015, based on NimROD 2007" for
|
||||
* instances of future programming that might use it as a tool tip or
|
||||
* small descriptor in their Look and Feel modules.
|
||||
* @return String "Look and Feel DarkMonkey - 2015, based on NimROD 2007"
|
||||
*/
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Look and Feel DarkMonkey - 2015, based on NimROD 2007";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initClassDefaults( UIDefaults table) {
|
||||
super.initClassDefaults( table);
|
||||
/*
|
||||
for( Enumeration en = table.keys(); en.hasMoreElements(); ) {
|
||||
System.out.println( "[" + en.nextElement() + "]");
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initComponentDefaults( UIDefaults table) {
|
||||
super.initComponentDefaults( table);
|
||||
|
||||
table.put("Tree.collapsedIcon", DarkMonkeyIconFactory.getTreeCollapsedIcon());
|
||||
table.put("Tree.expandedIcon", DarkMonkeyIconFactory.getTreeExpandedIcon());
|
||||
//
|
||||
/*
|
||||
for( Enumeration en = table.keys(); en.hasMoreElements(); ) {
|
||||
System.out.println( "[" + en.nextElement() + "]");
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user