Skip to content

Commit

Permalink
javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jul 13, 2024
1 parent a16839f commit f4c0373
Show file tree
Hide file tree
Showing 32 changed files with 189 additions and 196 deletions.
24 changes: 11 additions & 13 deletions src/main/java/com/github/stephengold/joltjni/AaBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public AaBox(Vec3Arg minimum, Vec3Arg maximum) {
/**
* Instantiate the biggest finite box.
*
* @return a new instance
* @return a new JVM object with a new native object assigned
*/
public static AaBox sBiggest() {
long boxVa = sBiggest(true);
Expand All @@ -94,8 +94,7 @@ public void setEmpty() {
// ConstAaBox methods

/**
* Test whether the box contains the specified point. The current instance
* is unaffected.
* Test whether the box contains the specified point. The box is unaffected.
*
* @param point the point to test (not null, unaffected)
*
Expand All @@ -113,7 +112,7 @@ public boolean contains(Vec3Arg point) {
}

/**
* Locate the center of the box. The current instance is unaffected.
* Locate the center of the box. The box is unaffected.
*
* @return a new location vector
*/
Expand All @@ -129,7 +128,7 @@ public Vec3 getCenter() {
}

/**
* Return the (half) extent of the box. The current instance is unaffected.
* Return the (half) extent of the box. The box is unaffected.
*
* @return a new vector
*/
Expand All @@ -145,8 +144,8 @@ public Vec3 getExtent() {
}

/**
* Return the maximum contained coordinate on each axis. The current
* instance is unaffected.
* Return the maximum contained coordinate on each axis. The box is
* unaffected.
*
* @return a new vector
*/
Expand All @@ -162,8 +161,8 @@ public Vec3 getMax() {
}

/**
* Return the minimum contained coordinate on each axis. The current
* instance is unaffected.
* Return the minimum contained coordinate on each axis. The box is
* unaffected.
*
* @return a new vector
*/
Expand All @@ -179,8 +178,7 @@ public Vec3 getMin() {
}

/**
* Return the size (full extent) on each axis. The current instance is
* unaffected.
* Return the size (full extent) on each axis. The box is unaffected.
*
* @return a new vector
*/
Expand All @@ -196,7 +194,7 @@ public Vec3 getSize() {
}

/**
* Return the volume of the box. The current instance is unaffected.
* Return the volume of the box. The box is unaffected.
*
* @return the volume
*/
Expand All @@ -209,7 +207,7 @@ public float getVolume() {
}

/**
* Test whether the box is valid. The current instance is unaffected.
* Test whether the box is valid. The box is unaffected.
*
* @return true if valid, otherwise false
*/
Expand Down
88 changes: 44 additions & 44 deletions src/main/java/com/github/stephengold/joltjni/Body.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public void addTorque(Vec3Arg torque) {
}

/**
* Test whether the body could be made kinematic or dynamic. The current
* instance is unaffected.
* Test whether the body could be made kinematic or dynamic. The body is
* unaffected.
*
* @return true if possible, otherwise false
*/
Expand All @@ -143,10 +143,9 @@ public boolean canBeKinematicOrDynamic() {
}

/**
* Return the net force acting on the body. The current instance is
* unaffected.
* Return the net force acting on the body. The body is unaffected.
*
* @return a new vector
* @return a new force vector (in physics-system coordinates)
*/
public Vec3 getAccumulatedForce() {
long bodyVa = va();
Expand All @@ -159,10 +158,9 @@ public Vec3 getAccumulatedForce() {
}

/**
* Return the net torque acting on the body. The current instance is
* unaffected.
* Return the net torque acting on the body. The body is unaffected.
*
* @return a new vector
* @return a new torque vector (in physics-system coordinates)
*/
public Vec3 getAccumulatedTorque() {
long bodyVa = va();
Expand All @@ -175,8 +173,7 @@ public Vec3 getAccumulatedTorque() {
}

/**
* Test whether the body is allowed to fall asleep. The current instance is
* unaffected.
* Test whether the body is allowed to fall asleep. The body is unaffected.
*
* @return true if allowed, otherwise false
*/
Expand All @@ -188,9 +185,10 @@ public boolean getAllowSleeping() {
}

/**
* Return the body's angular velocity. The current instance is unaffected.
* Return the body's angular velocity. The body is unaffected.
*
* @return a new vector in physics-system coordinates
* @return a new velocity vector (radians per second in physics-system
* coordinates
*/
public Vec3 getAngularVelocity() {
long bodyVa = va();
Expand All @@ -203,11 +201,11 @@ public Vec3 getAngularVelocity() {
}

/**
* Return the location of the body's center of mass (which might differ from
* its origin). The current instance is unaffected.
* Return the location of the body's center of mass (which might not
* coincide with its origin). The body is unaffected.
*
* @return a new vector in physics-system coordinates (all components
* finite)
* @return a new location vector (in physics-system coordinates, all
* components finite)
*/
public RVec3 getCenterOfMassPosition() {
long bodyVa = va();
Expand All @@ -227,7 +225,7 @@ public RVec3 getCenterOfMassPosition() {
}

/**
* Return the body's friction ratio. The current instance is unaffected.
* Return the body's friction ratio. The body is unaffected.
*
* @return the ratio
*/
Expand All @@ -238,8 +236,8 @@ public float getFriction() {
}

/**
* Acquire the body's ID for use with {@code BodyInterface}. The current
* instance is unaffected.
* Acquire the body's ID for use with {@code BodyInterface}. The body is
* unaffected.
*
* @return the value
*/
Expand All @@ -252,9 +250,10 @@ public ConstBodyId getId() {
}

/**
* Return the body's linear velocity. The current instance is unaffected.
* Return the body's linear velocity. The body is unaffected.
*
* @return a new vector in physics-system coordinates
* @return a new velocity vector (meters per second in physics-system
* coordinates)
*/
public Vec3 getLinearVelocity() {
long bodyVa = va();
Expand All @@ -267,9 +266,10 @@ public Vec3 getLinearVelocity() {
}

/**
* Acquire the body's motion properties.
* Access the body's motion properties.
*
* @return a new instance, or null if none
* @return a new JVM object with the pre-existing native object assigned, or
* null if none
*/
public MotionProperties getMotionProperties() {
MotionProperties result;
Expand All @@ -285,7 +285,7 @@ public MotionProperties getMotionProperties() {
}

/**
* Return the body's motion type. The current instance is unaffected.
* Return the body's motion type. The body is unaffected.
*
* @return an enum value (not null)
*/
Expand All @@ -298,7 +298,7 @@ public EMotionType getMotionType() {
}

/**
* Return the body's object layer. The current instance is unaffected.
* Return the body's object layer. The body is unaffected.
*
* @return a layer index (≥0)
*/
Expand All @@ -310,11 +310,11 @@ public int getObjectLayer() {
}

/**
* Return the location of the body's origin (which might differ from its
* center of mass). The current instance is unaffected.
* Return the location of the body's origin (which not coincide with its
* center of mass). The body is unaffected.
*
* @return a new vector in physics-system coordinates (all components
* finite)
* @return a new location vector (in physics-system coordinates, all
* components finite)
*/
public RVec3 getPosition() {
long bodyVa = va();
Expand All @@ -334,7 +334,7 @@ public RVec3 getPosition() {
}

/**
* Return the body's restitution ratio. The current instance is unaffected.
* Return the body's restitution ratio. The body is unaffected.
*
* @return the value (typically ≥0 and ≤1)
*/
Expand All @@ -347,9 +347,9 @@ public float getRestitution() {

/**
* Return the body's orientation relative to the physics-system axes. The
* current instance is unaffected.
* body is unaffected.
*
* @return a new quaternion
* @return a new rotation quaternion (relative to the physics-system axes)
*/
public Quat getRotation() {
long bodyVa = va();
Expand All @@ -363,9 +363,10 @@ public Quat getRotation() {
}

/**
* Return the body's shape.
* Access the body's shape.
*
* @return a new Java instance
* @return a new JVM object with the pre-existing native object assigned, or
* {@code null} if none
*/
public ConstShape getShape() {
long bodyVa = va();
Expand All @@ -376,8 +377,8 @@ public ConstShape getShape() {
}

/**
* Return the body's user data: can be used for anything. The current
* instance is unaffected.
* Return the body's user data: can be used for anything. The body is
* unaffected.
*
* @return the value
*/
Expand All @@ -389,9 +390,9 @@ public long getUserData() {
}

/**
* Return the body's bounding box. The current instance is unaffected.
* Return the body's bounding box. The body is unaffected.
*
* @return a new JVM instance that references the pre-existing native object
* @return a new JVM object with the pre-existing native object assigned
*/
public ConstAaBox getWorldSpaceBounds() {
long bodyVa = va();
Expand All @@ -402,7 +403,7 @@ public ConstAaBox getWorldSpaceBounds() {
}

/**
* Test whether the body is deactivated. The current instance is unaffected.
* Test whether the body is deactivated. The body is unaffected.
*
* @return false if deactivated, otherwise true
*/
Expand All @@ -414,7 +415,7 @@ public boolean isActive() {
}

/**
* Test whether the body is dynamic. The current instance is unaffected.
* Test whether the body is dynamic. The body is unaffected.
*
* @return true if dynamic, otherwise false
*/
Expand All @@ -426,7 +427,7 @@ public boolean isDynamic() {
}

/**
* Test whether the body is kinematic. The current instance is unaffected.
* Test whether the body is kinematic. The body is unaffected.
*
* @return true if kinematic, otherwise false
*/
Expand All @@ -438,8 +439,7 @@ public boolean isKinematic() {
}

/**
* Test whether the body is a rigid body. The current instance is
* unaffected.
* Test whether the body is a rigid body. The body is unaffected.
*
* @return true if rigid body, otherwise false
*/
Expand All @@ -451,7 +451,7 @@ public boolean isRigidBody() {
}

/**
* Test whether the body is static. The current instance is unaffected.
* Test whether the body is static. The body is unaffected.
*
* @return true if static, otherwise false
*/
Expand Down
Loading

0 comments on commit f4c0373

Please sign in to comment.