Package com.jme3.math

Class AbstractTriangle

java.lang.Object
com.jme3.math.AbstractTriangle
All Implemented Interfaces:
Collidable
Direct Known Subclasses:
Triangle

public abstract class AbstractTriangle extends Object implements Collidable
A Collidable with a triangular shape.
  • Constructor Details

    • AbstractTriangle

      public AbstractTriangle()
  • Method Details

    • get1

      public abstract Vector3f get1()
      Determine the location of the first vertex.
      Returns:
      a location vector
    • get2

      public abstract Vector3f get2()
      Determine the location of the 2nd vertex.
      Returns:
      a location vector
    • get3

      public abstract Vector3f get3()
      Determine the location of the 3rd vertex.
      Returns:
      a location vector
    • set

      public abstract void set(Vector3f v1, Vector3f v2, Vector3f v3)
      Alter all 3 vertex locations.
      Parameters:
      v1 - the location for the first vertex
      v2 - the location for the 2nd vertex
      v3 - the location for the 3rd vertex
    • collideWith

      public int collideWith(Collidable other, CollisionResults results)
      Generate collision results for this triangle with another Collidable.
      Specified by:
      collideWith in interface Collidable
      Parameters:
      other - the other Collidable
      results - storage for collision results
      Returns:
      the number of collisions found
    • toString

      public String toString()
      Returns a string representation of the triangle, which is unaffected. For example, a Triangle joining (1,0,0) and (0,1,0) with (0,0,1) is represented by:
       Triangle [V1: (1.0, 0.0, 0.0)  V2: (0.0, 1.0, 0.0)  V3: (0.0, 0.0, 1.0)]
       
      Overrides:
      toString in class Object
      Returns:
      the string representation (not null, not empty)