Class SoftBodyVertex

java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SoftBodyVertex
All Implemented Interfaces:
ConstJoltPhysicsObject, ConstSoftBodyVertex, AutoCloseable, Comparable<JoltPhysicsObject>

public class SoftBodyVertex extends JoltPhysicsObject implements ConstSoftBodyVertex
Run-time information for a single particle in a soft body. (native type: SoftBodyMotionProperties::Vertex)
  • Constructor Details

    • SoftBodyVertex

      public SoftBodyVertex()
      Instantiate a default vertex.
    • SoftBodyVertex

      public SoftBodyVertex(ConstSoftBodyVertex original)
      Instantiate a copy of the specified vertex.
      Parameters:
      original - the vertex to copy (not null, unaffected)
  • Method Details

    • resetCollision

      public void resetCollision()
      Reset the collision data.
    • set

      public void set(ConstSoftBodyVertex source)
      Copy the argument to the current settings.
      Parameters:
      source - the settings to copy (not null, unaffected)
    • setCollidingShapeIndex

      public void setCollidingShapeIndex(int index)
      Alter the index of the colliding shape. (native attribute: mCollidingShapeIndex)
      Parameters:
      index - the desired index
    • setCollisionPlane

      public void setCollisionPlane(ConstPlane plane)
      Alter the collision plane. (native attribute: mCollisionPlane)
      Parameters:
      plane - the desired collision plane (not null, unaffected)
    • setHasContact

      public void setHasContact(boolean setting)
      Alter the "has contact" flag. (native attribute: mHasContact)
      Parameters:
      setting - the desired setting
    • setInvMass

      public void setInvMass(float invMass)
      Alter the inverse mass. (native attribute: mInvMass)
      Parameters:
      invMass - the desired inverse mass (in 1/kilograms)
    • setLargestPenetration

      public void setLargestPenetration(float penetration)
      Alter the amount of penetration. (native attribute: mLargestPenetration)
      Parameters:
      penetration - the desired amount (in meters)
    • setPosition

      public void setPosition(Vec3Arg location)
      Relocate the vertex. (native attribute: mPosition)
      Parameters:
      location - the desired location (not null, unaffected)
    • setPreviousPosition

      public void setPreviousPosition(Vec3Arg location)
      Alter the previous location. (native attribute: mPreviousPosition)
      Parameters:
      location - the desired previous location (not null, unaffected)
    • setVelocity

      public void setVelocity(Vec3Arg velocity)
      Alter the velocity of the vertex. (native attribute: mVelocity)
      Parameters:
      velocity - the desired velocity (in meters per second, not null, unaffected)
    • getCollidingShapeIndex

      public int getCollidingShapeIndex()
      Return the index of the colliding shape. The vertex is unaffected. (native attribute: mCollidingShapeIndex)
      Specified by:
      getCollidingShapeIndex in interface ConstSoftBodyVertex
      Returns:
      the index
    • getCollisionPlane

      public Plane getCollisionPlane()
      Copy the collision plane. The vertex is unaffected. (native attribute: mCollisionPlane)
      Specified by:
      getCollisionPlane in interface ConstSoftBodyVertex
      Returns:
      a new object
    • getInvMass

      public float getInvMass()
      Return the inverse mass. The vertex is unaffected. (native attribute: mInvMass)
      Specified by:
      getInvMass in interface ConstSoftBodyVertex
      Returns:
      the inverse of the mass (in 1/kilograms)
    • getLargestPenetration

      public float getLargestPenetration()
      Return the amount of penetration. The vertex is unaffected. (native attribute: mLargestPenetration)
      Specified by:
      getLargestPenetration in interface ConstSoftBodyVertex
      Returns:
      the depth (in meters)
    • getPosition

      public Vec3 getPosition()
      Copy the location. The vertex is unaffected. (native attribute: mPosition)
      Specified by:
      getPosition in interface ConstSoftBodyVertex
      Returns:
      a new location vector (relative to the body's center of mass)
    • getPreviousPosition

      public Vec3 getPreviousPosition()
      Copy the previous location. The vertex is unaffected. (native attribute: mPreviousPosition)
      Specified by:
      getPreviousPosition in interface ConstSoftBodyVertex
      Returns:
      a new location vector (relative to the body's center of mass)
    • getVelocity

      public Vec3 getVelocity()
      Copy the velocity. The vertex is unaffected. (native attribute: mVelocity)
      Specified by:
      getVelocity in interface ConstSoftBodyVertex
      Returns:
      a new velocity vector (relative to the body's center of mass, in meters per second)
    • hasContact

      public boolean hasContact()
      Test whether the vertex collided during the previous update. The vertex is unaffected. (native attribute: mHasContact)
      Specified by:
      hasContact in interface ConstSoftBodyVertex
      Returns:
      true if it collided, otherwise false