Skip to content

Commit 0a076e3

Browse files
author
Wulfspider
committed
Formatting cleanup, Javadoc column limit edition.
1 parent ed320f9 commit 0a076e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+215
-424
lines changed

src/main/java/org/spout/physics/Utilities.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
package org.spout.physics;
2828

2929
/**
30-
* This class contains static utilities. It was added for the port to implement some C++ code in
31-
* Java.
30+
* This class contains static utilities. It was added for the port to implement some C++ code in Java.
3231
*/
3332
public class Utilities {
3433
/**

src/main/java/org/spout/physics/body/CollisionBody.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
import org.spout.physics.math.Transform;
3232

3333
/**
34-
* Represents a body that is able to collide with others bodies. This class inherits from the Body
35-
* class.
34+
* Represents a body that is able to collide with others bodies. This class inherits from the Body class.
3635
*/
3736
public abstract class CollisionBody extends Body {
3837
protected CollisionShape mCollisionShape;
@@ -118,11 +117,9 @@ public void setActive(boolean mIsActive) {
118117
}
119118

120119
/**
121-
* Returns an interpolated body from the old to the current transform, based on this body's
122-
* interpolation factor.
120+
* Returns an interpolated body from the old to the current transform, based on this body's interpolation factor.
123121
*
124-
* @return A transform interpolated from the old to the current transform based on the
125-
* interpolation factor
122+
* @return A transform interpolated from the old to the current transform based on the interpolation factor
126123
*/
127124
public Transform getInterpolatedTransform() {
128125
return Transform.interpolateTransforms(msnapshotTransform, mliveTransform, mInterpolationFactor);
@@ -193,8 +190,7 @@ public void setCollisionEnabled(boolean isCollisionEnabled) {
193190
}
194191

195192
/**
196-
* Update the old transform with the current one. This is used to compute the interpolated position
197-
* and orientation of the body.
193+
* Update the old transform with the current one. This is used to compute the interpolated position and orientation of the body.
198194
*/
199195
public void snapshotTransform() {
200196
msnapshotTransform.set(mliveTransform);

src/main/java/org/spout/physics/body/GhostImmobileRigidBody.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131
import org.spout.physics.math.Transform;
3232

3333
/**
34-
* Detector body which only informs callbacks of a collision. This body will not incur any collision adjustments nor will it prevent objects from passing through.
35-
* <p>
36-
* Uses for this object are when you want to inform the callbacks of a collision but handle adjustments on your own (ex. Character movement, moving through water, etc.)
34+
* Detector body which only informs callbacks of a collision. This body will not incur any collision adjustments nor will it prevent objects from passing through. <p> Uses for this object are when you
35+
* want to inform the callbacks of a collision but handle adjustments on your own (ex. Character movement, moving through water, etc.)
3736
*/
3837
public class GhostImmobileRigidBody extends ImmobileRigidBody {
3938
/**

src/main/java/org/spout/physics/body/GhostMobileRigidBody.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131
import org.spout.physics.math.Transform;
3232

3333
/**
34-
* Detector body which only informs callbacks of a collision. This body will not incur any collision adjustments nor will it prevent objects from passing through.
35-
* <p>
36-
* Uses for this object are when you want to inform the callbacks of a collision but handle adjustments on your own (ex. Character movement, moving through water, etc.)
34+
* Detector body which only informs callbacks of a collision. This body will not incur any collision adjustments nor will it prevent objects from passing through. <p> Uses for this object are when you
35+
* want to inform the callbacks of a collision but handle adjustments on your own (ex. Character movement, moving through water, etc.)
3736
*/
3837
public class GhostMobileRigidBody extends MobileRigidBody {
3938
/**

src/main/java/org/spout/physics/body/ImmobileRigidBody.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
import org.spout.physics.math.Vector3;
3333

3434
/**
35-
* Represents an immobile rigid body. Such a body cannot move, but has all of the properties of a
36-
* normal rigid body, except for velocities. This can be used for scenery, floors, walls, etc.
35+
* Represents an immobile rigid body. Such a body cannot move, but has all of the properties of a normal rigid body, except for velocities. This can be used for scenery, floors, walls, etc.
3736
*/
3837
public class ImmobileRigidBody extends RigidBody {
3938
private static final Vector3 ZERO = new Vector3(0, 0, 0);
@@ -44,8 +43,7 @@ public class ImmobileRigidBody extends RigidBody {
4443
protected final Vector3 mExternalTorque = new Vector3();
4544

4645
/**
47-
* Constructs a new rigid body from its transform, mass, local inertia tensor, collision shape and
48-
* ID.
46+
* Constructs a new rigid body from its transform, mass, local inertia tensor, collision shape and ID.
4947
*
5048
* @param transform The transform (position and orientation)
5149
* @param mass The mass
@@ -77,7 +75,7 @@ public float getMass() {
7775
*/
7876
@Override
7977
public float getMassInverse() {
80-
return (1/mMass);
78+
return (1 / mMass);
8179
}
8280

8381
/**
@@ -109,10 +107,8 @@ public void setInertiaTensorLocal(Matrix3x3 inertiaTensorLocal) {
109107
}
110108

111109
/**
112-
* Gets the inertia tensor in world coordinates. The inertia tensor I_w in world coordinates is
113-
* computed with the local inertia tensor I_b in body coordinates by I_w = R * I_b * R^T, where R
114-
* is the rotation matrix (and R^T its transpose) of the current orientation quaternion of the
115-
* body.
110+
* Gets the inertia tensor in world coordinates. The inertia tensor I_w in world coordinates is computed with the local inertia tensor I_b in body coordinates by I_w = R * I_b * R^T, where R is the
111+
* rotation matrix (and R^T its transpose) of the current orientation quaternion of the body.
116112
*
117113
* @return The world inertia tensor
118114
*/

src/main/java/org/spout/physics/body/MobileRigidBody.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,15 @@
3232
import org.spout.physics.math.Vector3;
3333

3434
/**
35-
* Represents a mobile rigid body. Such a body can move and has all of the properties of a normal
36-
* rigid body.
35+
* Represents a mobile rigid body. Such a body can move and has all of the properties of a normal rigid body.
3736
*/
3837
public class MobileRigidBody extends ImmobileRigidBody {
3938
private final Vector3 mLinearVelocity = new Vector3();
4039
private final Vector3 mAngularVelocity = new Vector3();
4140
private boolean mIsMotionEnabled = true;
4241

4342
/**
44-
* Constructs a new rigid body from its transform, mass, local inertia tensor, collision shape and
45-
* ID.
43+
* Constructs a new rigid body from its transform, mass, local inertia tensor, collision shape and ID.
4644
*
4745
* @param transform The transform (position and orientation)
4846
* @param mass The mass

src/main/java/org/spout/physics/body/RigidBody.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
import org.spout.physics.math.Vector3;
3333

3434
/**
35-
* Represents a rigid body for the physics engine. A rigid body is a non-deformable body that has a
36-
* constant mass. This class inherits from the CollisionBody class.
35+
* Represents a rigid body for the physics engine. A rigid body is a non-deformable body that has a constant mass. This class inherits from the CollisionBody class.
3736
*/
3837
public abstract class RigidBody extends CollisionBody {
3938
private static final RigidBodyMaterial DEFAULT_MATERIAL = RigidBodyMaterial.asUnmodifiableMaterial(new RigidBodyMaterial());
@@ -107,10 +106,8 @@ protected RigidBody(Transform transform, CollisionShape collisionShape, int id)
107106
public abstract void setExternalTorque(Vector3 torque);
108107

109108
/**
110-
* Gets the inverse of the inertia tensor in world coordinates. The inertia tensor I_w in world
111-
* coordinates is computed with the local inverse inertia tensor I_b^-1 in body coordinates by I_w
112-
* = R * I_b^-1 * R^T, where R is the rotation matrix (and R^T its transpose) of the current
113-
* orientation quaternion of the body.
109+
* Gets the inverse of the inertia tensor in world coordinates. The inertia tensor I_w in world coordinates is computed with the local inverse inertia tensor I_b^-1 in body coordinates by I_w = R *
110+
* I_b^-1 * R^T, where R is the rotation matrix (and R^T its transpose) of the current orientation quaternion of the body.
114111
*
115112
* @return The world inverse inertia tensor
116113
*/

src/main/java/org/spout/physics/body/RigidBodyMaterial.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,14 @@
2929
import org.spout.physics.ReactDefaults;
3030

3131
/**
32-
* Represents a material for a rigid body. The material has the restitution and friction
33-
* coefficients. Altering these constants for a material will alter the constants for all bodies.
32+
* Represents a material for a rigid body. The material has the restitution and friction coefficients. Altering these constants for a material will alter the constants for all bodies.
3433
*/
3534
public class RigidBodyMaterial {
3635
private float mRestitution = ReactDefaults.DEFAULT_RESTITUTION_COEFFICIENT;
3736
private float mFriction = ReactDefaults.DEFAULT_FRICTION_COEFFICIENT;
3837

3938
/**
40-
* Constructs a new rigid body material using {@link ReactDefaults#DEFAULT_RESTITUTION_COEFFICIENT}
41-
* and {@link ReactDefaults#DEFAULT_FRICTION_COEFFICIENT} as the default restitution and friction
39+
* Constructs a new rigid body material using {@link ReactDefaults#DEFAULT_RESTITUTION_COEFFICIENT} and {@link ReactDefaults#DEFAULT_FRICTION_COEFFICIENT} as the default restitution and friction
4240
* coefficients.
4341
*/
4442
public RigidBodyMaterial() {
@@ -95,11 +93,9 @@ public void setFriction(float friction) {
9593
}
9694

9795
/**
98-
* Returns a new unmodifiable rigid body material. Unmodifiable means that the {@link
99-
* #setRestitution(float)} and {@link #setFriction(float)} methods will throw an {@link
100-
* UnsupportedOperationException}. This is does not use a wrapper class, and the original material
101-
* is not linked to the one returned. That is, changes to the original material are not reflected
102-
* by the returned material.
96+
* Returns a new unmodifiable rigid body material. Unmodifiable means that the {@link #setRestitution(float)} and {@link #setFriction(float)} methods will throw an {@link
97+
* UnsupportedOperationException}. This is does not use a wrapper class, and the original material is not linked to the one returned. That is, changes to the original material are not reflected by
98+
* the returned material.
10399
*
104100
* @param material The material to make an unmodifiable copy of
105101
* @return A new unmodifiable rigid body material.

src/main/java/org/spout/physics/collision/CollisionDetection.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@
4949
import org.spout.physics.engine.linked.LinkedDynamicsWorld;
5050

5151
/**
52-
* This class computes the collision detection algorithms. We first perform a broad-phase algorithm
53-
* to know which pairs of bodies can collide and then we run a narrow-phase algorithm to compute the
52+
* This class computes the collision detection algorithms. We first perform a broad-phase algorithm to know which pairs of bodies can collide and then we run a narrow-phase algorithm to compute the
5453
* collision contacts between the bodies.
5554
*/
5655
public class CollisionDetection {
@@ -176,8 +175,7 @@ private void computeNarrowPhase() {
176175
}
177176

178177
/**
179-
* Allows the broad phase to notify the collision detection about an overlapping pair. This method
180-
* is called by a broad-phase collision detection algorithm.
178+
* Allows the broad phase to notify the collision detection about an overlapping pair. This method is called by a broad-phase collision detection algorithm.
181179
*
182180
* @param addedPair The pair that was added
183181
*/

src/main/java/org/spout/physics/collision/CollisionListener.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,14 @@
2929
import org.spout.physics.body.CollisionBody;
3030

3131
/**
32-
* Reports the collisions between two bodies as they are occurring during the narrow-phase and
33-
* allows for cancellation of the collision. Each collision will result in a call of {@link
34-
* #onCollide(org.spout.physics.body.CollisionBody, org.spout.physics.body.CollisionBody,
35-
* ContactInfo)}. Implement this interface to listen to them. Use {@link
32+
* Reports the collisions between two bodies as they are occurring during the narrow-phase and allows for cancellation of the collision. Each collision will result in a call of {@link
33+
* #onCollide(org.spout.physics.body.CollisionBody, org.spout.physics.body.CollisionBody, ContactInfo)}. Implement this interface to listen to them. Use {@link
3634
* org.spout.physics.engine.CollisionWorld#addListener(CollisionListener)} to add a listener.
3735
*/
3836
public interface CollisionListener {
3937
/**
40-
* This method is called when two bodies are about to collide in a collision detection. Both bodies
41-
* are provided, including the contact information, which includes the contact points on each body,
42-
* the penetration depth, and the normal. The method returns a boolean. If it is true, the
43-
* collision will be canceled.
38+
* This method is called when two bodies are about to collide in a collision detection. Both bodies are provided, including the contact information, which includes the contact points on each body,
39+
* the penetration depth, and the normal. The method returns a boolean. If it is true, the collision will be canceled.
4440
*
4541
* @param body1 The first body
4642
* @param body2 The second body

0 commit comments

Comments
 (0)