Package mgui.geometry

Class Vector3D

java.lang.Object
mgui.geometry.Shape3D
mgui.geometry.Vector3D
All Implemented Interfaces:
java.lang.Cloneable, Shape, XMLObject

public class Vector3D
extends Shape3D
Represents a 3D vector, defined by an end-point and a vector.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Field Details

    • start

      public org.jogamp.vecmath.Point3f start
    • vector

      public org.jogamp.vecmath.Vector3f vector
  • Constructor Details

    • Vector3D

      public Vector3D​(org.jogamp.vecmath.Point3f start, org.jogamp.vecmath.Vector3f vector)
    • Vector3D

      public Vector3D​(float x_start, float y_start, float z_start, float x_vector, float y_vector, float z_vector)
    • Vector3D

      public Vector3D​(Vector3D vector)
  • Method Details

    • getStart

      public org.jogamp.vecmath.Point3f getStart()
    • setStart

      public void setStart​(org.jogamp.vecmath.Point3f p)
    • getEndPoint

      public org.jogamp.vecmath.Point3f getEndPoint()
    • getVector

      public org.jogamp.vecmath.Vector3f getVector()
    • setVector

      public void setVector​(org.jogamp.vecmath.Vector3f v)
    • getVertices

      public java.util.ArrayList<org.jogamp.vecmath.Point3f> getVertices()
      Description copied from class: Shape3D
      Returns a list of this shape's nodes as Point3f's. This list is a copy, so operations performed on these nodes will not affect this shape.
      Specified by:
      getVertices in class Shape3D
      Returns:
    • getLength

      public float getLength()
    • getCoords

      public float[] getCoords()
      Specified by:
      getCoords in interface Shape
      Specified by:
      getCoords in class Shape3D
    • getVertex

      public org.jogamp.vecmath.Point3f getVertex​(int index)
      Description copied from class: Shape3D
      Returns the vertex at the specified index as a Point3f. This vertex is a copy, so operations performed on it will not affect this shape.

      Note: subclasses may want to provide a more efficient implementation of this method.

      Specified by:
      getVertex in class Shape3D
      Returns:
    • setCoords

      public void setCoords​(float[] coords)
      Specified by:
      setCoords in interface Shape
      Specified by:
      setCoords in class Shape3D
    • setVertices

      public void setVertices​(java.util.ArrayList<org.jogamp.vecmath.Point3f> nodes)
      Specified by:
      setVertices in class Shape3D
    • clone

      public java.lang.Object clone()
      Overrides:
      clone in class Shape3D