-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
229 changed files
with
5,604 additions
and
1,939 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.6.1 | ||
1.7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+379 KB
...b-shader-nodes/jmb-shader-nodes-1.1.1.jar → ...b-shader-nodes/jmb-shader-nodes-1.1.3.jar
Binary file not shown.
Binary file renamed
BIN
+22.8 KB
...jmb-sky-control/jmb-sky-control-1.0.0.jar → ...jmb-sky-control/jmb-sky-control-1.1.0.jar
Binary file not shown.
Binary file renamed
BIN
+137 KB
...egod-emitter/jmb-tonegodemitter-1.0.0.jar → ...god-emitter/jmb-tonegod-emitter-1.0.2.jar
Binary file not shown.
Binary file renamed
BIN
+143 KB
...god-emitter/libs/tonegodemitter-2.4.1.jar → ...god-emitter/libs/tonegodemitter-2.6.3.jar
Binary file not shown.
Binary file renamed
BIN
+83.7 KB
...ee-generator/jmb-tree-generator-1.1.0.jar → ...ee-generator/jmb-tree-generator-1.1.1.jar
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Wed Jan 24 08:56:01 MSK 2018 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-bin.zip |
132 changes: 132 additions & 0 deletions
132
src/main/java/com/jme3/bullet/util/DebugShapeFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
/* | ||
* Copyright (c) 2009-2017 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.bullet.util; | ||
|
||
import com.jme3.bullet.collision.shapes.CollisionShape; | ||
import com.jme3.bullet.collision.shapes.CompoundCollisionShape; | ||
import com.jme3.bullet.collision.shapes.infos.ChildCollisionShape; | ||
import com.jme3.math.Matrix3f; | ||
import com.jme3.math.Vector3f; | ||
import com.jme3.scene.Geometry; | ||
import com.jme3.scene.Mesh; | ||
import com.jme3.scene.Node; | ||
import com.jme3.scene.Spatial; | ||
import com.jme3.scene.VertexBuffer.Type; | ||
import com.jme3.util.TempVars; | ||
import java.util.Iterator; | ||
import java.util.List; | ||
|
||
/** | ||
* | ||
* @author CJ Hare, normenhansen | ||
*/ | ||
public class DebugShapeFactory { | ||
|
||
/** The maximum corner for the aabb used for triangles to include in ConcaveShape processing.*/ | ||
// private static final Vector3f aabbMax = new Vector3f(1e30f, 1e30f, 1e30f); | ||
/** The minimum corner for the aabb used for triangles to include in ConcaveShape processing.*/ | ||
// private static final Vector3f aabbMin = new Vector3f(-1e30f, -1e30f, -1e30f); | ||
|
||
/** | ||
* Creates a debug shape from the given collision shape. This is mostly used internally.<br> | ||
* To attach a debug shape to a physics object, call <code>attachDebugShape(AssetManager manager);</code> on it. | ||
* @param collisionShape | ||
* @return | ||
*/ | ||
public static Spatial getDebugShape(CollisionShape collisionShape) { | ||
if (collisionShape == null) { | ||
return null; | ||
} | ||
Spatial debugShape; | ||
if (collisionShape instanceof CompoundCollisionShape) { | ||
CompoundCollisionShape shape = (CompoundCollisionShape) collisionShape; | ||
List<ChildCollisionShape> children = shape.getChildren(); | ||
Node node = new Node("DebugShapeNode"); | ||
for (Iterator<ChildCollisionShape> it = children.iterator(); it.hasNext();) { | ||
ChildCollisionShape childCollisionShape = it.next(); | ||
CollisionShape ccollisionShape = childCollisionShape.shape; | ||
Geometry geometry = createDebugShape(ccollisionShape); | ||
|
||
// apply translation | ||
geometry.setLocalTranslation(childCollisionShape.location); | ||
|
||
// apply rotation | ||
TempVars vars = TempVars.get(); | ||
Matrix3f tempRot = vars.tempMat3; | ||
|
||
tempRot.set(geometry.getLocalRotation()); | ||
childCollisionShape.rotation.mult(tempRot, tempRot); | ||
geometry.setLocalRotation(tempRot); | ||
geometry.setLocalScale(ccollisionShape.getScale()); | ||
|
||
vars.release(); | ||
|
||
node.attachChild(geometry); | ||
} | ||
debugShape = node; | ||
} else { | ||
debugShape = createDebugShape(collisionShape); | ||
} | ||
if (debugShape == null) { | ||
return null; | ||
} | ||
debugShape.updateGeometricState(); | ||
return debugShape; | ||
} | ||
|
||
private static Geometry createDebugShape(CollisionShape shape) { | ||
Geometry geom = new Geometry(); | ||
geom.setMesh(DebugShapeFactory.getDebugMesh(shape)); | ||
// geom.setLocalScale(shape.getScale()); | ||
geom.updateModelBound(); | ||
return geom; | ||
} | ||
|
||
public static Mesh getDebugMesh(CollisionShape shape) { | ||
Mesh mesh = new Mesh(); | ||
DebugMeshCallback callback = new DebugMeshCallback(); | ||
/* | ||
* Populate the mesh based on an unscaled shape; | ||
* the shape's scale will be applied later, to the geometry. | ||
*/ | ||
Vector3f savedScale = shape.getScale().clone(); | ||
shape.setScale(Vector3f.UNIT_XYZ); | ||
getVertices(shape.getObjectId(), callback); | ||
shape.setScale(savedScale); | ||
|
||
mesh.setBuffer(Type.Position, 3, callback.getVertices()); | ||
mesh.getFloatBuffer(Type.Position).clear(); | ||
return mesh; | ||
} | ||
|
||
private static native void getVertices(long shapeId, DebugMeshCallback buffer); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.