com.bulletphysics.extras.gimpact
Class PrimitiveTriangle

java.lang.Object
  extended by com.bulletphysics.extras.gimpact.PrimitiveTriangle

public class PrimitiveTriangle
extends Object


Field Summary
 float margin
           
 Vector4f plane
           
 Vector3f[] vertices
           
 
Constructor Summary
PrimitiveTriangle()
           
 
Method Summary
 void applyTransform(Transform t)
           
 void buildTriPlane()
           
 int clip_triangle(PrimitiveTriangle other, ObjectArrayList<Vector3f> clipped_points)
          Clips the triangle against this.
 boolean find_triangle_collision_clip_method(PrimitiveTriangle other, TriangleContact contacts)
          Find collision using the clipping method.
 void get_edge_plane(int edge_index, Vector4f plane)
          Calcs the plane which is paralele to the edge and perpendicular to the triangle plane.
 boolean overlap_test_conservative(PrimitiveTriangle other)
          Test if triangles could collide.
 void set(PrimitiveTriangle tri)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vertices

public final Vector3f[] vertices

plane

public final Vector4f plane

margin

public float margin
Constructor Detail

PrimitiveTriangle

public PrimitiveTriangle()
Method Detail

set

public void set(PrimitiveTriangle tri)

buildTriPlane

public void buildTriPlane()

overlap_test_conservative

public boolean overlap_test_conservative(PrimitiveTriangle other)
Test if triangles could collide.


get_edge_plane

public void get_edge_plane(int edge_index,
                           Vector4f plane)
Calcs the plane which is paralele to the edge and perpendicular to the triangle plane. This triangle must have its plane calculated.


applyTransform

public void applyTransform(Transform t)

clip_triangle

public int clip_triangle(PrimitiveTriangle other,
                         ObjectArrayList<Vector3f> clipped_points)
Clips the triangle against this.

Parameters:
clipped_points - must have MAX_TRI_CLIPPING size, and this triangle must have its plane calculated.
Returns:
the number of clipped points

find_triangle_collision_clip_method

public boolean find_triangle_collision_clip_method(PrimitiveTriangle other,
                                                   TriangleContact contacts)
Find collision using the clipping method. This triangle and other must have their triangles calculated.