com.jme3.math
クラス LineSegment

java.lang.Object
  上位を拡張 com.jme3.math.LineSegment
すべての実装されたインタフェース:
Savable, java.io.Serializable, java.lang.Cloneable

public class LineSegment
extends java.lang.Object
implements java.lang.Cloneable, Savable, java.io.Serializable

LineSegment represents a segment in the space. This is a portion of a Line that has a limited start and end points.

A LineSegment is defined by an origin, a direction and an extent (or length). Direction should be a normalized vector. It is not internally normalized.

This class provides methods to calculate distances between LineSegments, Rays and Vectors. It is also possible to retrieve both end points of the segment getPositiveEnd(Vector3f) and getNegativeEnd(Vector3f). There are also methods to check whether a point is within the segment bounds.

関連項目:
Ray, 直列化された形式

コンストラクタの概要
LineSegment()
           
LineSegment(LineSegment ls)
           
LineSegment(Vector3f start, Vector3f end)
          Creates a new LineSegment with a given origin and end.
LineSegment(Vector3f origin, Vector3f direction, float extent)
          Creates a new LineSegment with the given origin, direction and extent.
 
メソッドの概要
 LineSegment clone()
           
 float distance(LineSegment ls)
           
 float distance(Ray r)
           
 float distance(Vector3f point)
           
 float distanceSquared(LineSegment test)
           
 float distanceSquared(Ray r)
           
 float distanceSquared(Vector3f point)
           
 Vector3f getDirection()
           
 float getExtent()
           
 Vector3f getNegativeEnd(Vector3f store)
           
 Vector3f getOrigin()
           
 Vector3f getPositiveEnd(Vector3f store)
           
 boolean isPointInsideBounds(Vector3f point)
          Evaluates whether a given point is contained within the axis aligned bounding box that contains this LineSegment.
 boolean isPointInsideBounds(Vector3f point, float error)
          Evaluates whether a given point is contained within the axis aligned bounding box that contains this LineSegment.
 void read(JmeImporter e)
           
 void set(LineSegment ls)
           
 void setDirection(Vector3f direction)
           
 void setExtent(float extent)
           
 void setOrigin(Vector3f origin)
           
 void write(JmeExporter e)
           
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

LineSegment

public LineSegment()

LineSegment

public LineSegment(LineSegment ls)

LineSegment

public LineSegment(Vector3f origin,
                   Vector3f direction,
                   float extent)

Creates a new LineSegment with the given origin, direction and extent.

Note that the origin is not one of the ends of the LineSegment, but its center.


LineSegment

public LineSegment(Vector3f start,
                   Vector3f end)

Creates a new LineSegment with a given origin and end. This constructor will calculate the center, the direction and the extent.

メソッドの詳細

set

public void set(LineSegment ls)

distance

public float distance(Vector3f point)

distance

public float distance(LineSegment ls)

distance

public float distance(Ray r)

distanceSquared

public float distanceSquared(Vector3f point)

distanceSquared

public float distanceSquared(LineSegment test)

distanceSquared

public float distanceSquared(Ray r)

getDirection

public Vector3f getDirection()

setDirection

public void setDirection(Vector3f direction)

getExtent

public float getExtent()

setExtent

public void setExtent(float extent)

getOrigin

public Vector3f getOrigin()

setOrigin

public void setOrigin(Vector3f origin)

getPositiveEnd

public Vector3f getPositiveEnd(Vector3f store)

getNegativeEnd

public Vector3f getNegativeEnd(Vector3f store)

write

public void write(JmeExporter e)
           throws java.io.IOException
定義:
インタフェース Savable 内の write
例外:
java.io.IOException

read

public void read(JmeImporter e)
          throws java.io.IOException
定義:
インタフェース Savable 内の read
例外:
java.io.IOException

clone

public LineSegment clone()
オーバーライド:
クラス java.lang.Object 内の clone

isPointInsideBounds

public boolean isPointInsideBounds(Vector3f point)

Evaluates whether a given point is contained within the axis aligned bounding box that contains this LineSegment.

This function is float error aware.


isPointInsideBounds

public boolean isPointInsideBounds(Vector3f point,
                                   float error)

Evaluates whether a given point is contained within the axis aligned bounding box that contains this LineSegment.

This function accepts an error parameter, which is added to the extent of the bounding box.