|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object physics3d.Geometry3D
public class Geometry3D
The Geometry3D library contains procedural abstractions which are useful in modeling the physical interactions between various 3 dimensional objects.
The library is described in terms of these concepts:
The intended use of the Geometry3D library is as follows:
The timeUntilCollision() methods assume constant ball velocity. That is, no force will be acting on the ball, so it will follow a straight-line path. Therefore, if external forces (such as gravity or friction) need to be accounted for, the client must do so before or after the of the "time until / update position / reflect" series of steps - never inbetween those three steps.
Important note: The methods which deal with plane polygon, plane circle and lateral cylinder bouncers do NOT deal with the edges of these surfaces. To ensure realistic behavior, shapes should be constructed from a combination of plane polygons, plane circles, lateral cylinders, spheres and tori. To connect plane polygons together, have zero radius cylinders at the edges and zero radius spheres on the points. To connect plane circles to lateral cylinders, put a zero tube raius torus on the ring.
For example: A ball is located at (0,0,1.5) and is moving in the (1,1,0) direction towards a unit cube parallel to all 3 axes with minimum (x,y,z) = (1,1,1) The ball will hit the ends of both faces at a 45 degree angle and something REALLY WEIRD will happen. However, if a cylinder with zero radius is placed along the edges of the cube, then the ball will bounce off the cylinder in the expected manner. Likewise for points and tori.
maximumForesight
: double // maximum time used to search for a
collision. Default is .03
numSubIntervals
: int // # of subintervals used to search an
interval for a zero. More accurate, but slower for higher values.
Default is 10.
Field Summary | |
---|---|
protected double |
maximumForesight
|
protected int |
numSubIntervals
|
Constructor Summary | |
---|---|
Geometry3D()
|
|
Geometry3D(double maximumForesight,
int numSubIntervals)
|
Method Summary | |
---|---|
Vect3 |
applyReflectionCoeff(Vect3 incidentVect,
Vect3 reflectedVect,
double rCoeff)
Accounts for the effects of inelastic collisions given the intial and resulting velocities of the collision assuming elasticity. |
Vect3 |
findCylinderNormalToBall(LateralCylinder cyl,
Sphere ball)
|
Vect3 |
findSphereNormalToBall(Sphere sphere,
Sphere ball)
|
Vect3 |
findTorusNormalToBall(Torus torus,
Sphere ball)
|
double |
getMaximumForesight()
|
int |
getNumSubIntervals()
|
double |
minQuadraticSolution(double a,
double b,
double c)
|
Vect3 |
pointWherePlaneIntersectsLine(Plane plane,
Line line)
METHODS FOR STATIONARY OBJECTS |
Vect3 |
reflect(PhysicsShape nextShape,
Sphere ball,
Vect3 velocity,
double coref)
convenience method: calls the appropriate reflect method |
Vect3 |
reflectLateralCylinder(LateralCylinder cyl,
Sphere ball,
Vect3 velocity)
Computes the new velocity of a ball reflecting off of a lateral cylinder. |
Vect3 |
reflectLateralCylinder(LateralCylinder cyl,
Sphere ball,
Vect3 velocity,
double reflectionCoeff)
Computes the new velocity of a ball reflecting off of a lateral cylinder. |
Vect3 |
reflectPlaneCircle(PlaneCircle circle,
Sphere ball,
Vect3 velocity)
Computes the new velocity of a ball reflecting off of a plane circle. |
Vect3 |
reflectPlaneCircle(PlaneCircle circle,
Sphere ball,
Vect3 velocity,
double reflectionCoeff)
Computes the new velocity of a ball reflecting off of a plane circle. |
Vect3 |
reflectPlanePolygon(PlanePolygon polygon,
Sphere ball,
Vect3 velocity)
Computes the new velocity of a ball reflecting off of a plane polygon. |
Vect3 |
reflectPlanePolygon(PlanePolygon polygon,
Sphere ball,
Vect3 velocity,
double reflectionCoeff)
Computes the new velocity of a ball reflecting off of a plane polygon. |
Vect3 |
reflectRotating(PhysicsShape nextShape,
Vect3 center,
Vect3 angularVel,
Sphere ball,
Vect3 velocity,
double coref)
convenience method: calls the appropriate reflect method |
Vect3 |
reflectRotatingLateralCylinder(LateralCylinder cyl,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity)
Computes the new velocity of a sphere reflected off of a rotating lateral cylinder. |
Vect3 |
reflectRotatingLateralCylinder(LateralCylinder cyl,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity,
double reflectionCoeff)
Computes the new velocity of a sphere reflected off of a rotating lateral cylinder. |
Vect3 |
reflectRotatingPlaneCircle(PlaneCircle circle,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity)
Computes the new velocity of a sphere reflected off of a rotating plane circle. |
Vect3 |
reflectRotatingPlaneCircle(PlaneCircle circle,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity,
double reflectionCoeff)
Computes the new velocity of a sphere reflected off of a rotating plane circle. |
Vect3 |
reflectRotatingPlanePolygon(PlanePolygon polygon,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity)
Computes the new velocity of a sphere reflected off of a rotating plane polygon. |
Vect3 |
reflectRotatingPlanePolygon(PlanePolygon polygon,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity,
double reflectionCoeff)
Computes the new velocity of a sphere reflected off of a rotating plane polygon. |
Vect3 |
reflectRotatingSphere(Sphere sphere,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity)
Computes the new velocity of a sphere reflected off of a rotating sphere. |
Vect3 |
reflectRotatingSphere(Sphere sphere,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity,
double reflectionCoeff)
Computes the new velocity of a sphere reflected off of a rotating sphere. |
Vect3 |
reflectRotatingTorus(Torus torus,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity)
Computes the new velocity of a sphere reflected off of a rotating torus. |
Vect3 |
reflectRotatingTorus(Torus torus,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity,
double reflectionCoeff)
Computes the new velocity of a sphere reflected off of a rotating torus. |
Vect3 |
reflectSphere(Sphere sphere,
Sphere ball,
Vect3 velocity)
Computes the new velocity of a ball reflecting off of a sphere. |
Vect3 |
reflectSphere(Sphere sphere,
Sphere ball,
Vect3 velocity,
double reflectionCoeff)
Computes the new velocity of a ball reflecting off of a sphere. |
Vect3Pair |
reflectSpheres(Sphere sphere1,
double mass1,
Vect3 velocity1,
Sphere sphere2,
double mass2,
Vect3 velocity2)
Computes the resulting velocities of two spheres which collide. |
Vect3 |
reflectTorus(Torus torus,
Sphere ball,
Vect3 velocity)
Computes the new velocity of a ball reflecting off of a torus. |
Vect3 |
reflectTorus(Torus torus,
Sphere ball,
Vect3 velocity,
double reflectionCoeff)
Computes the new velocity of a ball reflecting off of a torus. |
void |
setForesightAndSubintervals(double maximumForesight,
int numSubIntervals)
Modifies the behavior of this class to use the specified maximumForesight & numSubIntervals . |
double |
timeUntilCollision(PhysicsShape nextShape,
Sphere ball,
Vect3 velocity)
convenience method: calls the appropriate timeUntilCollision method |
double |
timeUntilLateralCylinderCollision(LateralCylinder cyl,
Sphere ball,
Vect3 velocity)
Computes the time until a ball represented by a sphere, travelling at a specified velocity collides with a specified lateral cylinder. |
double |
timeUntilPlaneCircleCollision(PlaneCircle circle,
Sphere ball,
Vect3 velocity)
Computes the time until a ball represented by a sphere, travelling at a specified velocity collides with a specified plane circle. |
double |
timeUntilPlanePolygonCollision(PlanePolygon polygon,
Sphere ball,
Vect3 velocity)
Computes the time until a ball represented by a sphere, travelling at a specified velocity collides with a specified plane polygon. |
double |
timeUntilRotatingCollision(PhysicsShape shape,
Vect3 center,
Vect3 angularVel,
Sphere ballShape,
Vect3 velocity)
|
double |
timeUntilRotatingLateralCylinderCollision(LateralCylinder cyl,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity)
Computes the time until a ball travelling at a specified velocity collides with a rotating lateral cylinder. |
double |
timeUntilRotatingPlaneCircleCollision(PlaneCircle circle,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity)
Computes the time until a ball travelling at a specified velocity collides with a rotating plane circle. |
double |
timeUntilRotatingPlanePolygonCollision(PlanePolygon polygon,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity)
Computes the time until a ball travelling at a specified velocity collides with a rotating plane polygon. |
double |
timeUntilRotatingSphereCollision(Sphere sphere,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity)
Computes the time until a ball travelling at a specified velocity collides with a rotating sphere. |
double |
timeUntilRotatingTorusCollision(Torus torus,
Vect3 center,
Vect3 angularVelocity,
Sphere ball,
Vect3 velocity)
Computes the time until a ball travelling at a specified velocity collides with a rotating torus. |
double |
timeUntilSphereCollision(Sphere sphere,
Sphere ball,
Vect3 velocity)
Computes the time until a ball represented by a sphere, travelling at a specified velocity collides with a specified sphere. |
double |
timeUntilSphereSphereCollision(Sphere sphere1,
Vect3 vel1,
Sphere sphere2,
Vect3 vel2)
Computes the time until two spheres collide. |
double |
timeUntilTorusCollision(Torus torus,
Sphere ball,
Vect3 velocity)
Computes the time until a ball represented by a sphere, travelling at a specified velocity collides with a specified torus. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double maximumForesight
protected int numSubIntervals
Constructor Detail |
---|
public Geometry3D()
public Geometry3D(double maximumForesight, int numSubIntervals)
Method Detail |
---|
public void setForesightAndSubintervals(double maximumForesight, int numSubIntervals)
maximumForesight & numSubIntervals
.
maximumForesight
- The maximal time in the future that a collision will be searched
for. Collisions may still be returned that happen farther than
maximumForesight
in the future, but no extra effort
will be made to find them.numSubIntervals
- used to find roots of polynomials. Finding roots is linear in time
with the number of sub intervals, but too few intervals could lead
to missing a root.public double getMaximumForesight()
public int getNumSubIntervals()
public double minQuadraticSolution(double a, double b, double c)
public Vect3 applyReflectionCoeff(Vect3 incidentVect, Vect3 reflectedVect, double rCoeff)
incidentVect
- the intial velocity of the ballreflectedVect
- the resulting velocity after the collision assuming elasticity.rCoeff
- the reflection coefficent.
rCoeff
>= 0incidentVect
, and the
velocity resulting from an elastic collision,
reflectedVect
, and a reflection coefficient,
rCoeff
, returns the resulting velocity of the
collision had it been inelastic with the given reflection
coefficient. If the reflection coefficient is 1.0, the resulting
velocity will be equal to reflectedVect
. A
reflection coefficient of 0 implies that the collision will absorb
any energy that was reflected in the elastic case.public Vect3 pointWherePlaneIntersectsLine(Plane plane, Line line)
public double timeUntilPlanePolygonCollision(PlanePolygon polygon, Sphere ball, Vect3 velocity)
polygon
- a plane polygon representing the circle with which the ball may
collideball
- a sphere representing the size and initial location of the ballvelocity
- the velocity of the ball before impact
Double.POSITIVE_INFINITY
public Vect3 reflectPlanePolygon(PlanePolygon polygon, Sphere ball, Vect3 velocity, double reflectionCoeff)
polygon
- the plane polygon which is being hitball
- the ballvelocity
- the velocity of the ball before impactreflectionCoeff
- the reflection coefficient
reflectionCoeff
>= 0public Vect3 reflectPlanePolygon(PlanePolygon polygon, Sphere ball, Vect3 velocity)
polygon
- the plane polygon which is being hitball
- the ballvelocity
- the velocity of the ball before impact
public double timeUntilPlaneCircleCollision(PlaneCircle circle, Sphere ball, Vect3 velocity)
circle
- a plane circle representing the circle with which the ball may
collideball
- a sphere representing the size and initial location of the ballvelocity
- the velocity of the ball before impact
Double.POSITIVE_INFINITY
public Vect3 reflectPlaneCircle(PlaneCircle circle, Sphere ball, Vect3 velocity, double reflectionCoeff)
circle
- the plane circle which is being hitball
- the ballvelocity
- the velocity of the ball before impactreflectionCoeff
- the reflection coefficient
reflectionCoeff
>= 0public Vect3 reflectPlaneCircle(PlaneCircle circle, Sphere ball, Vect3 velocity)
circle
- the plane circle which is being hitball
- the ballvelocity
- the velocity of the ball before impact
public double timeUntilSphereCollision(Sphere sphere, Sphere ball, Vect3 velocity)
sphere
- a sphere representing the circle with which the ball may collideball
- a sphere representing the size and initial location of the ballvelocity
- the velocity of the ball before impact
Double.POSITIVE_INFINITY
public Vect3 findSphereNormalToBall(Sphere sphere, Sphere ball)
public Vect3 reflectSphere(Sphere sphere, Sphere ball, Vect3 velocity, double reflectionCoeff)
sphere
- the sphere which is being hitball
- the ballvelocity
- the velocity of the ball before impactreflectionCoeff
- the reflection coefficient
reflectionCoeff
>= 0public Vect3 reflectSphere(Sphere sphere, Sphere ball, Vect3 velocity)
sphere
- the sphere which is being hitball
- the ballvelocity
- the velocity of the ball before impact
public double timeUntilLateralCylinderCollision(LateralCylinder cyl, Sphere ball, Vect3 velocity)
cyl
- a lateral cylinder representing the circle with which the ball may
collideball
- a sphere representing the size and initial location of the ballvelocity
- the velocity of the ball before impact
Double.POSITIVE_INFINITY
public Vect3 findCylinderNormalToBall(LateralCylinder cyl, Sphere ball)
public Vect3 reflectLateralCylinder(LateralCylinder cyl, Sphere ball, Vect3 velocity, double reflectionCoeff)
cyl
- the lateral cylinder which is being hitball
- the ballvelocity
- the velocity of the ball before impactreflectionCoeff
- the reflection coefficient
reflectionCoeff
>= 0public Vect3 reflectLateralCylinder(LateralCylinder cyl, Sphere ball, Vect3 velocity)
cyl
- the lateral cylinder which is being hitball
- the ballvelocity
- the velocity of the ball before impact
public double timeUntilTorusCollision(Torus torus, Sphere ball, Vect3 velocity)
torus
- a torus representing the circle with which the ball may collideball
- a sphere representing the size and initial location of the ballvelocity
- the velocity of the ball before impact
Double.POSITIVE_INFINITY
public Vect3 findTorusNormalToBall(Torus torus, Sphere ball)
public Vect3 reflectTorus(Torus torus, Sphere ball, Vect3 velocity, double reflectionCoeff)
torus
- the torus which is being hitball
- the ballvelocity
- the velocity of the ball before impactreflectionCoeff
- the reflection coefficient
reflectionCoeff
>= 0public Vect3 reflectTorus(Torus torus, Sphere ball, Vect3 velocity)
torus
- the torus which is being hitball
- the ballvelocity
- the velocity of the ball before impact
public double timeUntilRotatingPlanePolygonCollision(PlanePolygon polygon, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity)
polygon
- a plane polygon representing the initial location and size of the
rotating plane polygoncenter
- the point around which the plane polygon is rotatingangularVelocity
- the angular velocity with which polygon
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- a sphere representing the size and initial position of the ballvelocity
- the velocity of the ball before impactDouble.POSITIVE_INFINITY
public Vect3 reflectRotatingPlanePolygon(PlanePolygon polygon, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity)
polygon
- the rotating plane polygoncenter
- the point about which polygon
is rotatingangularVelocity
- the angular velocity with which polygon
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- the size and position of the sphere before impactvelocity
- the velocity of the sphere before impact
public Vect3 reflectRotatingPlanePolygon(PlanePolygon polygon, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity, double reflectionCoeff)
polygon
- the rotating plane polygoncenter
- the point about which polygon
is rotatingangularVelocity
- the angular velocity with which polygon
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- the size and position of the sphere before impactvelocity
- the velocity of the sphere before impactreflectionCoeff
- the reflection coefficient
public double timeUntilRotatingPlaneCircleCollision(PlaneCircle circle, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity)
circle
- a plane circle representing the initial location and size of the
rotating plane circlecenter
- the point around which the plane circle is rotatingangularVelocity
- the angular velocity with which circle
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- a sphere representing the size and initial position of the ballvelocity
- the velocity of the ball before impactDouble.POSITIVE_INFINITY
public Vect3 reflectRotatingPlaneCircle(PlaneCircle circle, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity)
circle
- the rotating plane circlecenter
- the point about which circle
is rotatingangularVelocity
- the angular velocity with which circle
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- the size and position of the sphere before impactvelocity
- the velocity of the sphere before impact
public Vect3 reflectRotatingPlaneCircle(PlaneCircle circle, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity, double reflectionCoeff)
circle
- the rotating plane circlecenter
- the point about which circle
is rotatingangularVelocity
- the angular velocity with which circle
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- the size and position of the sphere before impactvelocity
- the velocity of the sphere before impactreflectionCoeff
- the reflection coefficient
public double timeUntilRotatingSphereCollision(Sphere sphere, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity)
sphere
- a sphere representing the initial location and size of the
rotating spherecenter
- the point around which the sphere is rotatingangularVelocity
- the angular velocity with which sphere
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- a sphere representing the size and initial position of the ballvelocity
- the velocity of the ball before impactDouble.POSITIVE_INFINITY
public Vect3 reflectRotatingSphere(Sphere sphere, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity)
sphere
- the rotating spherecenter
- the point about which sphere
is rotatingangularVelocity
- the angular velocity with which sphere
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- the size and position of the sphere before impactvelocity
- the velocity of the sphere before impact
public Vect3 reflectRotatingSphere(Sphere sphere, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity, double reflectionCoeff)
sphere
- the rotating spherecenter
- the point about which sphere
is rotatingangularVelocity
- the angular velocity with which sphere
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- the size and position of the sphere before impactvelocity
- the velocity of the sphere before impactreflectionCoeff
- the reflection coefficient
public double timeUntilRotatingLateralCylinderCollision(LateralCylinder cyl, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity)
cyl
- a lateral cylinder representing the initial location and size of
the rotating lateral cylindercenter
- the point around which the lateral cylinder is rotatingangularVelocity
- the angular velocity with which cyl
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- a sphere representing the size and initial position of the ballvelocity
- the velocity of the ball before impactDouble.POSITIVE_INFINITY
public Vect3 reflectRotatingLateralCylinder(LateralCylinder cyl, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity)
cyl
- the rotating lateral cylindercenter
- the point about which cyl
is rotatingangularVelocity
- the angular velocity with which cyl
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- the size and position of the sphere before impactvelocity
- the velocity of the sphere before impact
public Vect3 reflectRotatingLateralCylinder(LateralCylinder cyl, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity, double reflectionCoeff)
cyl
- the rotating lateral cylindercenter
- the point about which cyl
is rotatingangularVelocity
- the angular velocity with which cyl
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- the size and position of the sphere before impactvelocity
- the velocity of the sphere before impactreflectionCoeff
- the reflection coefficient
public double timeUntilRotatingTorusCollision(Torus torus, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity)
torus
- a torus representing the initial location and size of the rotating
toruscenter
- the point around which the torus is rotatingangularVelocity
- the angular velocity with which torus
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- a sphere representing the size and initial position of the ballvelocity
- the velocity of the ball before impactDouble.POSITIVE_INFINITY
public Vect3 reflectRotatingTorus(Torus torus, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity)
torus
- the rotating toruscenter
- the point about which torus
is rotatingangularVelocity
- the angular velocity with which torus
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- the size and position of the sphere before impactvelocity
- the velocity of the sphere before impact
public Vect3 reflectRotatingTorus(Torus torus, Vect3 center, Vect3 angularVelocity, Sphere ball, Vect3 velocity, double reflectionCoeff)
torus
- the rotating toruscenter
- the point about which torus
is rotatingangularVelocity
- the angular velocity with which torus
is rotating
about center
, where the length is measured in
radians per second, and the direction is perpendicular to the axis
of rotation using the right hand rule (the standard convention).ball
- the size and position of the sphere before impactvelocity
- the velocity of the sphere before impactreflectionCoeff
- the reflection coefficient
public double timeUntilSphereSphereCollision(Sphere sphere1, Vect3 vel1, Sphere sphere2, Vect3 vel2)
sphere1
- a sphere representing the size and initial position of the first
sphere.vel1
- the velocity of the first sphere before impactsphere2
- a sphere representing the size and initial position of the second
sphere.vel2
- the velocity of the second sphere before impact
Double.POSITIVE_INFINITY
public Vect3Pair reflectSpheres(Sphere sphere1, double mass1, Vect3 velocity1, Sphere sphere2, double mass2, Vect3 velocity2)
sphere1
- the first spheremass1
- the mass of the first spherevelocity1
- the velocity of the first sphere before impactsphere2
- the second spheremass2
- the mass of the second spherevelocity2
- the velocity of the second sphere before impact
Vect3Pair
, where the first Vect3
is the velocity of the first sphere after the collision and the
second Vect3
is the velocity of the second sphere
after the collision.public double timeUntilCollision(PhysicsShape nextShape, Sphere ball, Vect3 velocity)
public Vect3 reflect(PhysicsShape nextShape, Sphere ball, Vect3 velocity, double coref)
public Vect3 reflectRotating(PhysicsShape nextShape, Vect3 center, Vect3 angularVel, Sphere ball, Vect3 velocity, double coref)
public double timeUntilRotatingCollision(PhysicsShape shape, Vect3 center, Vect3 angularVel, Sphere ballShape, Vect3 velocity)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |