|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jmonkeyengine.tralala.Utilities
public final class Utilities
Field Summary | |
---|---|
static com.jme3.scene.shape.Quad |
IDENTITY_QUAD
|
static float |
MAX_ANGLE_X
|
static float |
MIN_ANGLE_X
We force character to not be able to exceed rotation limits. |
static java.lang.String |
NEW_LINE_CHARACTER
|
Constructor Summary | |
---|---|
Utilities()
|
Method Summary | |
---|---|
static void |
addInList(com.jme3.math.Quaternion p1,
java.util.List<java.lang.Float> array)
|
static void |
addInList(com.jme3.math.Vector2f p1,
java.util.List<java.lang.Float> array)
|
static void |
addInList(com.jme3.math.Vector3f p1,
java.util.List<java.lang.Float> array)
|
static void |
appendSpaces(java.lang.StringBuilder sb,
int numberOfSpaces)
|
static com.jme3.scene.Geometry |
createArrow(com.jme3.material.Material mat,
com.jme3.math.Vector3f pos,
com.jme3.math.Vector3f dir)
|
static com.jme3.scene.Node |
createBillboard(com.jme3.material.Material mat,
float radius)
|
static com.jme3.scene.Node |
createDebugNormals(com.jme3.scene.Mesh mesh,
com.jme3.material.Material mat,
float scale)
|
static com.jme3.scene.Geometry |
createHorizontalQuad(float x,
float y,
float z,
float width,
float length)
|
static com.jme3.scene.Geometry |
createLine(com.jme3.material.Material mat,
com.jme3.math.Vector3f startPosition,
com.jme3.math.Vector3f endPosition)
|
static com.jme3.scene.Geometry |
createLine(java.lang.String name,
com.jme3.material.Material mat,
com.jme3.math.Vector3f startPosition,
com.jme3.math.Vector3f endPosition)
|
static com.jme3.scene.shape.Box |
createLowerLeftBox(float x,
float y,
float z)
Lower left corner is at (0,0,0) and top right corner is at (x,y,z) |
static com.jme3.math.Plane |
createPlane(com.jme3.math.Vector3f planeOrigin,
com.jme3.math.Vector3f planeNormal)
|
static com.jme3.scene.Geometry |
createPoint(com.jme3.material.Material mat,
com.jme3.math.Vector3f position)
|
static com.jme3.scene.Node |
createSelectionCircle(com.jme3.material.Material mat,
float scale,
int points)
|
static com.jme3.scene.Node |
createWorldGrid(com.jme3.material.Material mat,
int xi,
int yi)
|
static com.jme3.scene.Node |
createWorldGrid(com.jme3.material.Material mat,
com.jme3.material.Material axisMat,
int xi,
int yi,
boolean centered)
Debug Lines |
static java.util.ArrayList<java.lang.Byte> |
getAsList(byte[] array)
|
static java.util.ArrayList<java.lang.Float> |
getAsList(float[] array)
|
static java.util.ArrayList<java.lang.Float>[] |
getAsList(float[][] array)
|
static java.util.ArrayList<java.lang.Short> |
getAsList(short[] array)
|
static byte[] |
getByteArray(java.nio.ByteBuffer buff)
Create a new byte[] array and populate it with the given ByteBuffer's contents. |
static float |
getDistanceOfPointFromPlane(com.jme3.math.Vector3f pointToBeMeasured,
com.jme3.math.Vector3f anyPointOfPlane,
com.jme3.math.Vector3f planeNormal)
Distance formula from Koen Samyn : http://knol.google.com/k/plane-equation-in-3d# |
static java.lang.String |
getExtension(java.io.File f)
|
static com.jme3.material.Material |
getLightingMaterial(java.lang.String texturePath,
java.lang.String normalPath,
java.lang.String parallaxPath,
float shiness,
com.jme3.asset.AssetManager assetManager)
|
static java.net.InetAddress |
getMyIpAddress()
|
static com.jme3.math.Vector3f |
getPositionOnPlane(com.jme3.math.Vector3f pointToBeCentered,
com.jme3.math.Vector3f planeOrigin,
com.jme3.math.Vector3f planeNormal)
|
static java.lang.String |
getPrefix(java.lang.String name)
|
static com.jme3.math.Quaternion |
getQuaternionFromArray(java.util.List<java.lang.Float> array,
int i)
|
static short[] |
getShortArray(java.nio.ShortBuffer buff)
Create a new short[] array and populate it with the given ShortBuffer's contents. |
static java.util.List<java.io.File> |
getSubfiles(java.io.File file)
|
static java.util.List<java.io.File> |
getSubfiles(java.io.File file,
java.util.List<java.io.File> fileList)
|
static com.jme3.math.Vector3f |
getSummetricPosition(com.jme3.math.Vector3f pointToBeMirrored,
com.jme3.math.Vector3f planeOrigin,
com.jme3.math.Vector3f planeNormal)
Symmetry formula from Koen Samyn : http://knol.google.com/k/mirroring-a-point-on-a-3d-plane# Same info on wikipedia : http://en.wikipedia.org/wiki/Reflection_%28mathematics%29 |
static com.jme3.scene.VertexBuffer.Type |
getTexCoordType(int i)
|
static com.jme3.material.Material |
getUnshadedMaterial(java.lang.String texturePath,
com.jme3.math.ColorRGBA color,
com.jme3.asset.AssetManager assetManager)
|
static com.jme3.material.Material |
getUnshadedMaterial(com.jme3.texture.Texture texture,
com.jme3.math.ColorRGBA color,
com.jme3.material.RenderState.BlendMode mode,
com.jme3.asset.AssetManager assetManager)
|
static com.jme3.math.Vector2f |
getVector2FromArray(float[] array,
int i)
|
static com.jme3.math.Vector2f[] |
getVector2FromArray(java.util.List<java.lang.Float>[] array,
int i)
|
static com.jme3.math.Vector2f |
getVector2FromArray(java.util.List<java.lang.Float> array,
int i)
|
static com.jme3.math.Vector3f |
getVector3FromArray(float[] array,
int i)
|
static com.jme3.math.Vector3f |
getVector3FromArray(java.util.List<java.lang.Float> array,
int i)
|
static java.lang.String |
IpToString(java.net.InetSocketAddress address)
|
static boolean |
isBlank(java.lang.String str)
|
static com.jme3.math.Vector3f |
localToWorldCoordinatesIgnoreHeight(float dx,
float dy,
float dz,
float rotationX,
float rotationY)
Converts local cordinates "(dx,dy,dz)" to world coordinates based on Vector3D "rotation". |
static byte[] |
merge(byte[] f1,
byte[] f2)
|
static float[] |
merge(float[] f1,
float[] f2)
|
static java.nio.FloatBuffer |
merge(java.nio.FloatBuffer f1,
java.nio.FloatBuffer f2)
|
static short[] |
merge(short[] f1,
short[] f2)
|
static java.nio.ShortBuffer |
merge(java.nio.ShortBuffer f1,
java.nio.ShortBuffer f2)
|
static void |
printErrorLine()
|
static java.util.ArrayList<java.lang.String> |
readFile(java.io.File file)
|
static java.util.ArrayList<java.lang.String> |
readFile(java.io.File file,
java.lang.String encoding)
|
static java.lang.String |
readFileAsString(java.io.File file)
|
static java.lang.String |
readFileAsString(java.io.File file,
java.lang.String encoding)
|
static java.lang.String |
readFileAsString(java.lang.String file)
|
static void |
saveFile(java.io.File file,
java.lang.String whatToSave)
|
static void |
saveFile(java.io.File file,
java.lang.String whatToSave,
java.lang.String encoding)
|
static void |
setInArray(com.jme3.math.Vector2f p1,
float[] array,
int i)
|
static void |
setInArray(com.jme3.math.Vector3f p1,
float[] array,
int i)
|
static void |
sleep(int millis)
|
static java.io.InputStream |
StringToInputStream(java.lang.String s)
|
static byte[] |
toByteArray(java.util.Collection<java.lang.Byte> array)
|
static float[] |
toFloatArray(java.util.Collection<java.lang.Float> array)
|
static float[][] |
toFloatArray(java.util.Collection<java.lang.Float>[] array)
|
static short[] |
toShortArray(java.util.Collection<java.lang.Short> array)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float MIN_ANGLE_X
public static final float MAX_ANGLE_X
public static final com.jme3.scene.shape.Quad IDENTITY_QUAD
public static final java.lang.String NEW_LINE_CHARACTER
Constructor Detail |
---|
public Utilities()
Method Detail |
---|
public static com.jme3.scene.Node createBillboard(com.jme3.material.Material mat, float radius)
public static com.jme3.material.Material getUnshadedMaterial(java.lang.String texturePath, com.jme3.math.ColorRGBA color, com.jme3.asset.AssetManager assetManager)
public static com.jme3.material.Material getUnshadedMaterial(com.jme3.texture.Texture texture, com.jme3.math.ColorRGBA color, com.jme3.material.RenderState.BlendMode mode, com.jme3.asset.AssetManager assetManager)
public static com.jme3.material.Material getLightingMaterial(java.lang.String texturePath, java.lang.String normalPath, java.lang.String parallaxPath, float shiness, com.jme3.asset.AssetManager assetManager)
public static void printErrorLine()
public static java.util.List<java.io.File> getSubfiles(java.io.File file)
public static java.util.List<java.io.File> getSubfiles(java.io.File file, java.util.List<java.io.File> fileList)
public static boolean isBlank(java.lang.String str)
public static java.io.InputStream StringToInputStream(java.lang.String s)
public static void appendSpaces(java.lang.StringBuilder sb, int numberOfSpaces)
public static java.lang.String IpToString(java.net.InetSocketAddress address)
public static java.net.InetAddress getMyIpAddress()
public static void sleep(int millis)
public static java.lang.String getPrefix(java.lang.String name)
public static java.lang.String getExtension(java.io.File f)
public static java.util.ArrayList<java.lang.String> readFile(java.io.File file)
public static java.util.ArrayList<java.lang.String> readFile(java.io.File file, java.lang.String encoding)
public static java.lang.String readFileAsString(java.lang.String file)
public static java.lang.String readFileAsString(java.io.File file)
public static java.lang.String readFileAsString(java.io.File file, java.lang.String encoding)
public static void saveFile(java.io.File file, java.lang.String whatToSave)
public static void saveFile(java.io.File file, java.lang.String whatToSave, java.lang.String encoding)
public static float getDistanceOfPointFromPlane(com.jme3.math.Vector3f pointToBeMeasured, com.jme3.math.Vector3f anyPointOfPlane, com.jme3.math.Vector3f planeNormal)
pointToBeMeasured
- the Point you want to find its distance from
plane.anyPointOfPlane
- any plane's point e.g plane's originplaneNormal
- the plane's Normal at the "anyPointOfPlane"public static com.jme3.math.Vector3f getSummetricPosition(com.jme3.math.Vector3f pointToBeMirrored, com.jme3.math.Vector3f planeOrigin, com.jme3.math.Vector3f planeNormal)
pointToBeMirrored
- the Point you want to find its symmetricplaneOrigin
- the planeOrigin e.g (0,0,0)planeNormal
- the planeNormal is a vector that points upward from the plane e.g Vector3f.UNIT_Zpublic static com.jme3.math.Vector3f getPositionOnPlane(com.jme3.math.Vector3f pointToBeCentered, com.jme3.math.Vector3f planeOrigin, com.jme3.math.Vector3f planeNormal)
public static float[] merge(float[] f1, float[] f2)
public static short[] merge(short[] f1, short[] f2)
public static byte[] merge(byte[] f1, byte[] f2)
public static java.nio.FloatBuffer merge(java.nio.FloatBuffer f1, java.nio.FloatBuffer f2)
public static java.nio.ShortBuffer merge(java.nio.ShortBuffer f1, java.nio.ShortBuffer f2)
public static com.jme3.scene.VertexBuffer.Type getTexCoordType(int i)
public static com.jme3.math.Vector3f getVector3FromArray(float[] array, int i)
public static com.jme3.math.Vector3f getVector3FromArray(java.util.List<java.lang.Float> array, int i)
public static com.jme3.math.Vector2f getVector2FromArray(float[] array, int i)
public static com.jme3.math.Vector2f getVector2FromArray(java.util.List<java.lang.Float> array, int i)
public static com.jme3.math.Vector2f[] getVector2FromArray(java.util.List<java.lang.Float>[] array, int i)
public static com.jme3.math.Quaternion getQuaternionFromArray(java.util.List<java.lang.Float> array, int i)
public static java.util.ArrayList<java.lang.Byte> getAsList(byte[] array)
public static java.util.ArrayList<java.lang.Short> getAsList(short[] array)
public static java.util.ArrayList<java.lang.Float> getAsList(float[] array)
public static java.util.ArrayList<java.lang.Float>[] getAsList(float[][] array)
public static byte[] toByteArray(java.util.Collection<java.lang.Byte> array)
public static short[] toShortArray(java.util.Collection<java.lang.Short> array)
public static float[] toFloatArray(java.util.Collection<java.lang.Float> array)
public static float[][] toFloatArray(java.util.Collection<java.lang.Float>[] array)
public static void addInList(com.jme3.math.Quaternion p1, java.util.List<java.lang.Float> array)
public static void addInList(com.jme3.math.Vector3f p1, java.util.List<java.lang.Float> array)
public static void addInList(com.jme3.math.Vector2f p1, java.util.List<java.lang.Float> array)
public static void setInArray(com.jme3.math.Vector3f p1, float[] array, int i)
public static void setInArray(com.jme3.math.Vector2f p1, float[] array, int i)
public static com.jme3.scene.Geometry createPoint(com.jme3.material.Material mat, com.jme3.math.Vector3f position)
public static com.jme3.math.Plane createPlane(com.jme3.math.Vector3f planeOrigin, com.jme3.math.Vector3f planeNormal)
public static com.jme3.scene.Geometry createArrow(com.jme3.material.Material mat, com.jme3.math.Vector3f pos, com.jme3.math.Vector3f dir)
public static com.jme3.scene.Geometry createLine(com.jme3.material.Material mat, com.jme3.math.Vector3f startPosition, com.jme3.math.Vector3f endPosition)
public static com.jme3.scene.Geometry createLine(java.lang.String name, com.jme3.material.Material mat, com.jme3.math.Vector3f startPosition, com.jme3.math.Vector3f endPosition)
public static com.jme3.scene.shape.Box createLowerLeftBox(float x, float y, float z)
public static com.jme3.scene.Geometry createHorizontalQuad(float x, float y, float z, float width, float length)
public static com.jme3.scene.Node createDebugNormals(com.jme3.scene.Mesh mesh, com.jme3.material.Material mat, float scale)
public static com.jme3.scene.Node createSelectionCircle(com.jme3.material.Material mat, float scale, int points)
public static com.jme3.scene.Node createWorldGrid(com.jme3.material.Material mat, int xi, int yi)
public static com.jme3.scene.Node createWorldGrid(com.jme3.material.Material mat, com.jme3.material.Material axisMat, int xi, int yi, boolean centered)
public static short[] getShortArray(java.nio.ShortBuffer buff)
buff
- the ShortBuffer to read from
public static byte[] getByteArray(java.nio.ByteBuffer buff)
buff
- the ByteBuffer to read from
public static com.jme3.math.Vector3f localToWorldCoordinatesIgnoreHeight(float dx, float dy, float dz, float rotationX, float rotationY)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |