Skip to content

Commit

Permalink
many javadoc improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Nov 4, 2024
1 parent dfa3081 commit 511b45a
Show file tree
Hide file tree
Showing 142 changed files with 371 additions and 361 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/github/stephengold/joltjni/AaBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public AaBox() {
*
* @param boxVa the virtual address of the native object to assign (not
* zero)
* @param owner {@code true} → make the current object the owner,
* {@code false} → the current object isn't the owner
* @param owner {@code true} → make the JVM object the owner,
* {@code false} → it isn't the owner
*/
AaBox(long boxVa, boolean owner) {
Runnable freeingAction = owner ? () -> free(boxVa) : null;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/github/stephengold/joltjni/Body.java
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ public void setIsSensor(boolean setting) {
/**
* Directly alter the body's linear velocity.
*
* @param velocity the desired linear velocity (in meters/second, not null,
* unaffected, default=(0,0,0))
* @param velocity the desired linear velocity (in meters per second, not
* null, unaffected, default=(0,0,0))
*/
public void setLinearVelocity(Vec3Arg velocity) {
long bodyVa = va();
Expand All @@ -357,8 +357,8 @@ public void setLinearVelocity(Vec3Arg velocity) {
/**
* Alter the body's linear velocity within limits.
*
* @param velocity the desired linear velocity (in meters/second, not null,
* unaffected, default=(0,0,0))
* @param velocity the desired linear velocity (in meters per second, not
* null, unaffected, default=(0,0,0))
*/
public void setLinearVelocityClamped(Vec3Arg velocity) {
long bodyVa = va();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public BodyCreationSettings(ConstShape shape, RVec3Arg loc, QuatArg orient,
*
* @param bodySettingsVa the virtual address of the native object to assign
* (not zero)
* @param owner true → make the current object the owner, false →
* the current object isn't the owner
* @param owner {@code true} → make the JVM object the owner,
* {@code false} → it isn't the owner
*/
BodyCreationSettings(long bodySettingsVa, boolean owner) {
Runnable freeingAction = owner ? () -> free(bodySettingsVa) : null;
Expand Down Expand Up @@ -185,7 +185,7 @@ public void setAllowSleeping(boolean allow) {
/**
* Alter the angular damping constant. (native attribute: mAngularDamping)
*
* @param damping the desired value (in units of 1/second, ≥0, ≤1,
* @param damping the desired value (in units of per second, ≥0, ≤1,
* default=0.05)
*/
public void setAngularDamping(float damping) {
Expand Down Expand Up @@ -253,7 +253,8 @@ public void setGravityFactor(float factor) {
/**
* Alter whether the body will be a sensor. (native attribute: mIsSensor)
*
* @param setting true for a sensor, otherwise false (default=false)
* @param setting {@code true} for a sensor, otherwise {@code false}
* (default=false)
*/
public void setIsSensor(boolean setting) {
long bodySettingsVa = va();
Expand All @@ -263,7 +264,7 @@ public void setIsSensor(boolean setting) {
/**
* Alter the linear damping constant. (native attribute: mLinearDamping)
*
* @param damping the desired value (in units of 1/second, ≥0, ≤1,
* @param damping the desired value (in units of per second, ≥0, ≤1,
* default=0.05)
*/
public void setLinearDamping(float damping) {
Expand Down Expand Up @@ -298,7 +299,7 @@ public void setMassPropertiesOverride(MassProperties properties) {
/**
* Alter the maximum angular speed. (native attribute: mMaxAngularVelocity)
*
* @param maxSpeed the desired maximum speed (in radians/second, ≥0,
* @param maxSpeed the desired maximum speed (in radians per second, ≥0,
* default=15*pi)
*/
public void setMaxAngularVelocity(float maxSpeed) {
Expand All @@ -309,7 +310,7 @@ public void setMaxAngularVelocity(float maxSpeed) {
/**
* Alter the maximum linear speed. (native attribute: mMaxLinearVelocity)
*
* @param maxSpeed the desired maximum speed (in meters/second, ≥0,
* @param maxSpeed the desired maximum speed (in meters per second, ≥0,
* default=500)
*/
public void setMaxLinearVelocity(float maxSpeed) {
Expand Down Expand Up @@ -454,7 +455,7 @@ public void setShapeSettings(ShapeSettingsRef shapeSettingsRef) {
* Test whether the created body will be allowed to fall asleep. The
* settings are unaffected. (native attribute: mAllowSleeping)
*
* @return true if allowed, otherwise false
* @return {@code true} if allowed, otherwise {@code false}
*/
@Override
public boolean getAllowSleeping() {
Expand All @@ -468,7 +469,7 @@ public boolean getAllowSleeping() {
* Return the angular damping constant. The settings are unaffected. (native
* attribute: mAngularDamping)
*
* @return the constant (in units of 1/second, ≥0, ≤1)
* @return the constant (in units of per second, ≥0, ≤1)
*/
@Override
public float getAngularDamping() {
Expand Down Expand Up @@ -541,7 +542,7 @@ public float getGravityFactor() {
* Test whether the body will be a sensor. The settings are unaffected.
* (native attribute: mIsSensor)
*
* @return true for a sensor, otherwise false
* @return {@code true} for a sensor, otherwise {@code false}
*/
@Override
public boolean getIsSensor() {
Expand All @@ -555,7 +556,7 @@ public boolean getIsSensor() {
* Return the linear damping constant. The settings are unaffected. (native
* attribute: mLinearDamping)
*
* @return the constant (in units of 1/second, ≥0, ≤1)
* @return the constant (in units of per second, ≥0, ≤1)
*/
@Override
public float getLinearDamping() {
Expand Down Expand Up @@ -616,7 +617,7 @@ public MassProperties getMassPropertiesOverride() {
* Return the maximum angular speed. The settings are unaffected. (native
* attribute: mMaxAngularVelocity)
*
* @return the maximum speed (in radians/second)
* @return the maximum speed (in radians per second)
*/
@Override
public float getMaxAngularVelocity() {
Expand All @@ -630,7 +631,7 @@ public float getMaxAngularVelocity() {
* Return the maximum linear speed. The settings are unaffected. (native
* attribute: mMaxLinearVelocity)
*
* @return the maximum speed (in meters/second)
* @return the maximum speed (in meters per second)
*/
@Override
public float getMaxLinearVelocity() {
Expand Down Expand Up @@ -775,7 +776,7 @@ public ConstShape getShape() {
* Test whether the body's mass properties will be calculated. The settings
* are unaffected.
*
* @return true if calculated, otherwise false
* @return {@code true} if calculated, otherwise {@code false}
*/
@Override
public boolean hasMassProperties() {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/github/stephengold/joltjni/BodyFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public BodyFilter() {
* is unaffected.
*
* @param bodyId the body to test (not null, unaffected)
* @return true if may collide, false if filtered out
* @return {@code true} if may collide, {@code false} if filtered out
*/
public boolean shouldCollide(ConstBodyId bodyId) {
long filterVa = va();
Expand All @@ -72,8 +72,8 @@ public boolean shouldCollide(ConstBodyId bodyId) {
*
* @param filterVa the virtual address of the native object to assign (not
* zero)
* @param owner true → make the JVM object the owner, false → it
* isn't the owner
* @param owner {@code true} → make the JVM object the owner,
* {@code false} → it isn't the owner
*/
final void setVirtualAddress(long filterVa, boolean owner) {
Runnable freeingAction = owner ? () -> free(filterVa) : null;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/github/stephengold/joltjni/BodyId.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public BodyId(long idVa) {
* Instantiate with the specified native object assigned.
*
* @param idVa the virtual address of the native object to assign (not zero)
* @param owner true → make the JVM object the owner, false → it
* isn't the owner
* @param owner {@code true} → make the JVM object the owner,
* {@code false} → it isn't the owner
*/
BodyId(long idVa, boolean owner) {
Runnable freeingAction = owner ? () -> free(idVa) : null;
Expand Down Expand Up @@ -136,7 +136,7 @@ public int getSequenceNumber() {
* unaffected.
*
* @param id2 the 2nd ID to test (not null, unaffected)
* @return true if equal, false if unequal
* @return {@code true} if equal, {@code false} if unequal
*/
@Override
public boolean isEqual(ConstBodyId id2) {
Expand All @@ -150,7 +150,7 @@ public boolean isEqual(ConstBodyId id2) {
/**
* Test whether the ID is valid. It is unaffected.
*
* @return true if invalid, false if valid
* @return {@code true} if invalid, {@code false} if valid
*/
@Override
public boolean isInvalid() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ public PhysicsSystem getSystem() {
* Test whether the specified body is active.
*
* @param bodyId the ID of the body to test (not null, unaffected)
* @return true if active, otherwise false
* @return {@code true} if active, otherwise {@code false}
*/
public boolean isActive(ConstBodyId bodyId) {
long bodyIdVa = bodyId.va();
Expand All @@ -536,7 +536,7 @@ public boolean isActive(ConstBodyId bodyId) {
* Test whether the specified body is added to the system.
*
* @param bodyId the ID of the body to test (not null, unaffected)
* @return true if added, otherwise false
* @return {@code true} if added, otherwise {@code false}
*/
public boolean isAdded(ConstBodyId bodyId) {
long bodyInterfaceVa = va();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void releaseLock() {
/**
* Test whether the lock was successfully acquired.
*
* @return true if acquired, otherwise false
* @return {@code true} if acquired, otherwise {@code false}
*/
public boolean succeeded() {
long lockVa = va();
Expand All @@ -83,7 +83,7 @@ public boolean succeeded() {
/**
* Test whether the lock was acquired and the body is still in broadphase.
*
* @return true if both conditions are met, otherwise false
* @return {@code true} if both conditions are met, otherwise {@code false}
*/
public boolean succeededAndIsInBroadPhase() {
long lockVa = va();
Expand All @@ -99,8 +99,8 @@ public boolean succeededAndIsInBroadPhase() {
*
* @param lockVa the virtual address of the native object to assign (not
* zero)
* @param owner true → make the JVM object the owner, false → it
* isn't the owner
* @param owner {@code true} → make the JVM object the owner,
* {@code false} → it isn't the owner
*/
final void setVirtualAddress(long lockVa, boolean owner) {
Runnable freeingAction = owner ? () -> free(lockVa) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void releaseLock() {
/**
* Test whether the lock was successfully acquired.
*
* @return true if acquired, otherwise false
* @return {@code true} if acquired, otherwise {@code false}
*/
public boolean succeeded() {
long lockVa = va();
Expand All @@ -83,7 +83,7 @@ public boolean succeeded() {
/**
* Test whether the lock was acquired and the body is still in broadphase.
*
* @return true if both conditions are met, otherwise false
* @return {@code true} if both conditions are met, otherwise {@code false}
*/
public boolean succeededAndIsInBroadPhase() {
long lockVa = va();
Expand All @@ -99,8 +99,8 @@ public boolean succeededAndIsInBroadPhase() {
*
* @param lockVa the virtual address of the native object to assign (not
* zero)
* @param owner true → make the JVM object the owner, false → it
* isn't the owner
* @param owner {@code true} → make the JVM object the owner,
* {@code false} → it isn't the owner
*/
final void setVirtualAddress(long lockVa, boolean owner) {
Runnable freeingAction = owner ? () -> free(lockVa) : null;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/github/stephengold/joltjni/BodyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void activateBodies(ConstBodyId[] idArray, int number) {
* Add a body, assigning the next available ID.
*
* @param body (not null, modified)
* @return true if successful, false if no ID is available
* @return {@code true} if successful, {@code false} if no ID is available
*/
public boolean addBody(Body body) {
long managerVa = va();
Expand Down Expand Up @@ -228,8 +228,8 @@ public void init(int maxBodies, int numBodyMutexes,
*
* @param managerVa the virtual address of the native object to assign (not
* zero)
* @param owner true → make the JVM object the owner, false → it
* isn't the owner
* @param owner {@code true} → make the JVM object the owner,
* {@code false} → it isn't the owner
*/
final void setVirtualAddress(long managerVa, boolean owner) {
Runnable freeingAction = owner ? () -> free(managerVa) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void notifyBodiesAabbChanged(BodyId[] bodyIds, int numBodies) {
*
* @param bodyIds the IDs of the bodies to be notified (not null)
* @param numBodies the number of bodies to be notified (≥0)
* @param takeLock true to acquire a lock, otherwise false
* @param takeLock {@code true} to acquire a lock, otherwise {@code false}
*/
public void notifyBodiesAabbChanged(
BodyId[] bodyIds, int numBodies, boolean takeLock) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ public float getFraction() {
*
* @param castResultVa the virtual address of the native object to assign
* (not zero)
* @param owner true → make the JVM object the owner, false → it
* isn't the owner
* @param owner {@code true} → make the JVM object the owner,
* {@code false} → it isn't the owner
*/
void setVirtualAddress(long castResultVa, boolean owner) {
Runnable freeingAction = owner ? () -> free(castResultVa) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public BroadPhaseLayerFilter() {
* filter is unaffected.
*
* @param bpLayerIndex the index of the broad-phase layer to test
* @return true if may collide, false if filtered out
* @return {@code true} if may collide, {@code false} if filtered out
*/
public boolean shouldCollide(int bpLayerIndex) {
long filterVa = va();
Expand All @@ -69,8 +69,8 @@ public boolean shouldCollide(int bpLayerIndex) {
*
* @param filterVa the virtual address of the native object to assign (not
* zero)
* @param owner true → make the JVM object the owner, false → it
* isn't the owner
* @param owner {@code true} → make the JVM object the owner,
* {@code false} → it isn't the owner
*/
final void setVirtualAddress(long filterVa, boolean owner) {
Runnable freeingAction = owner ? () -> free(filterVa) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ public PhysicsSystem getSystem() {
*
* @param queryVa the virtual address of the native object to assign (not
* zero)
* @param owner true → make the JVM object the owner, false → it
* isn't the owner
* @param owner {@code true} → make the JVM object the owner,
* {@code false} → it isn't the owner
*/
final void setVirtualAddress(long queryVa, boolean owner) {
Runnable freeingAction = owner ? () -> free(queryVa) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ abstract public class CastRayCollector extends JoltPhysicsObject {
*
* @param collectorVa the virtual address of the native object to assign
* (not zero)
* @param owner true → make the JVM object the owner, false → it
* isn't the owner
* @param owner {@code true} → make the JVM object the owner,
* {@code false} → it isn't the owner
*/
void setVirtualAddress(long collectorVa, boolean owner) {
Runnable freeingAction = owner ? () -> free(collectorVa) : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ abstract public class CastShapeCollector extends JoltPhysicsObject {
*
* @param collectorVa the virtual address of the native object to assign
* (not zero)
* @param owner true → make the JVM object the owner, false → it
* isn't the owner
* @param owner {@code true} → make the JVM object the owner,
* {@code false} → it isn't the owner
*/
void setVirtualAddress(long collectorVa, boolean owner) {
Runnable freeingAction = owner ? () -> free(collectorVa) : null;
Expand Down
Loading

0 comments on commit 511b45a

Please sign in to comment.