|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.scene.Spatial
com.jme.scene.Geometry
com.jme.scene.TriMesh
com.jme.effects.cloth.ClothPatch
com.jme.effects.cloth.CollidingClothPatch
CollidingClothPatch is a ClothPatch with the ability to interact
with other objects. Override handleCollision to change collision behavior.
| Field Summary | |
protected Vector3f |
calcTemp
|
protected java.util.ArrayList |
colliders
Array of TriMesh objects to check against for collision. |
protected TriangleCollisionResults |
results
Used for storing the results of collisions. |
protected SpringNode[] |
srcTemps
|
protected Vector3f[] |
tgtTemps
|
| Fields inherited from class com.jme.effects.cloth.ClothPatch |
clothNodesX, clothNodesY, sinceLast, springLength, system, timeDilation |
| Fields inherited from class com.jme.scene.TriMesh |
indices, triangleQuantity |
| Fields inherited from class com.jme.scene.Geometry |
bound, color, colorBuf, normal, normBuf, texBuf, texture, vertBuf, vertex, vertQuantity |
| Fields inherited from class com.jme.scene.Spatial |
currentStates, defaultStateList, forceCull, forceView, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, name, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder |
| Constructor Summary | |
CollidingClothPatch(java.lang.String name,
int nodesX,
int nodesY,
float springLength,
float nodeMass)
Public constructor. |
|
| Method Summary | |
void |
addCollider(TriMesh item)
Adds a TriMesh to check for collision with. |
protected void |
calcForces(float sinceLast)
Calls super and then updates model bound and collision info. |
protected void |
checkForCollisions()
Check each collider for collision with this Cloth. |
protected void |
handleCollision(TriMesh target,
int srcTriIndex,
int tgtTriIndex)
Given the starting triangle index of the two triangles intersecting, decide what to do with those triangles. |
boolean |
removeCollider(TriMesh item)
Remove a given TriMesh from collision consideration. |
| Methods inherited from class com.jme.effects.cloth.ClothPatch |
addForce, doUpdate, getClothNodesX, getClothNodesY, getIndex, getSpringLength, getSystem, getTimeDilation, getTriangleNormal, initCloth, removeForce, setTimeDilation, setupIndices, updateNormals, updateWorldData |
| Methods inherited from class com.jme.scene.TriMesh |
clearBuffers, draw, drawBounds, findCollisions, findTriangleCollision, findTrianglePick, findWorldRotMat, getIndexAsBuffer, getIndices, getMeshAsTriangles, getTriangle, getTriangle, getTriangleQuantity, hasCollision, hasTriangleCollision, putClone, reconstruct, setIndexBuffer, setIndices, updateCollisionTree, updateIndexBuffer |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected TriangleCollisionResults results
protected java.util.ArrayList colliders
protected SpringNode[] srcTemps
protected Vector3f[] tgtTemps
protected Vector3f calcTemp
| Constructor Detail |
public CollidingClothPatch(java.lang.String name,
int nodesX,
int nodesY,
float springLength,
float nodeMass)
name - StringnodesX - number of nodes wide this cloth will be.nodesY - number of nodes high this cloth will be.springLength - distance between each nodenodeMass - mass of an individual node in this Cloth.| Method Detail |
protected void calcForces(float sinceLast)
calcForces in class ClothPatchsinceLast - floatprotected void checkForCollisions()
protected void handleCollision(TriMesh target,
int srcTriIndex,
int tgtTriIndex)
target - TriMeshsrcTriIndex - inttgtTriIndex - intpublic void addCollider(TriMesh item)
item - TriMeshpublic boolean removeCollider(TriMesh item)
item - TriMesh
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||