|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgizmoball.physics.PhysicsSphere
public class PhysicsSphere
A PhysicsSphere is a wrapper class for a three dimensional representation of a sphere.
sphere
: Sphere // the sphere that is wrapped in thisConstructor Summary | |
---|---|
PhysicsSphere(Vect3 center,
double radius,
double mass,
double reflectionCoeff,
Vect3 velocity)
Creates a new PhysicsSphere without rotation or texture |
|
PhysicsSphere(Vect3 center,
double radius,
double mass,
double reflectionCoeff,
Vect3 velocity,
java.lang.String texture)
Creates a new PhysicsSphere without rotation |
|
PhysicsSphere(Vect3 center,
double radius,
double mass,
double reflectionCoeff,
Vect3 rotCenter,
Vect3 rotOmega,
Vect3 velocity)
Creates a new PhysicsSphere without texture |
|
PhysicsSphere(Vect3 center,
double radius,
double mass,
double reflectionCoeff,
Vect3 rotCenter,
Vect3 rotOmega,
Vect3 velocity,
java.lang.String texture)
Creates a new PhysicsSphere |
Method Summary | |
---|---|
boolean |
containsPoint(Vect3 p)
Returns whether p is in this. |
Vect3 |
getBCenter()
|
Vect3Pair |
getBoundingBox()
|
double |
getBRadius()
|
java.util.Collection<LateralCylinder> |
getLateralCylinders()
|
double |
getMass()
|
java.util.Collection<PlaneCircle> |
getPlaneCircles()
|
java.util.Collection<PlanePolygon> |
getPlanePolygons()
|
Vect3 |
getPosition()
|
double |
getReflectionCoeff()
|
Vect3 |
getRotCenter()
|
Vect3 |
getRotOmega()
|
Sphere |
getSphere()
|
java.util.Collection<Sphere> |
getSpheres()
|
java.util.Collection<Torus> |
getTori()
|
Vect3 |
getVelocity()
|
double |
minDistanceToObjectFromP(Vect3 p)
Returns the minimum distance from p to this |
Vect3 |
reflect(PhysicsSphere ps)
|
void |
rotateAboutAxis(Vect3 center,
Vect3 axis,
double angle)
|
void |
setMass(double mass)
|
void |
setPosition(Vect3 pos)
|
void |
setReflectionCoeff(double rc)
|
void |
setRotCenter(Vect3 rc)
|
void |
setRotOmega(Vect3 ro)
|
void |
setVelocity(Vect3 vel)
|
double |
timeUntilCollision(PhysicsSphere ball,
double lookahead)
Returns the time until a collision between ball and this |
void |
update(double timestep)
Updates the state of this after the passage of timestep. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PhysicsSphere(Vect3 center, double radius, double mass, double reflectionCoeff, Vect3 rotCenter, Vect3 rotOmega, Vect3 velocity, java.lang.String texture)
center
- the center of the sphereradius
- the radius of the spheremass
- the mass of the spherereflectionCoeff
- the coefficient of reflection of the sphererotCenter
- the center of rotation of the sphererotOmega
- the angular velocity of the spherevelocity
- the velocity of rotCentertexture
- the texture of the toruspublic PhysicsSphere(Vect3 center, double radius, double mass, double reflectionCoeff, Vect3 rotCenter, Vect3 rotOmega, Vect3 velocity)
center
- the center of the sphereradius
- the radius of the spheremass
- the mass of the spherereflectionCoeff
- the coefficient of reflection of the sphererotCenter
- the center of rotation of the sphererotOmega
- the angular velocity of the spherevelocity
- the velocity of rotCenterpublic PhysicsSphere(Vect3 center, double radius, double mass, double reflectionCoeff, Vect3 velocity, java.lang.String texture)
public PhysicsSphere(Vect3 center, double radius, double mass, double reflectionCoeff, Vect3 velocity)
Method Detail |
---|
public boolean containsPoint(Vect3 p)
PhysicsObject
containsPoint
in interface PhysicsObject
public Vect3 getBCenter()
getBCenter
in interface PhysicsObject
public double getBRadius()
getBRadius
in interface PhysicsObject
public double getMass()
getMass
in interface PhysicsObject
public Vect3 getPosition()
getPosition
in interface PhysicsObject
public Vect3 getRotCenter()
getRotCenter
in interface PhysicsObject
public Vect3 getRotOmega()
getRotOmega
in interface PhysicsObject
public Vect3 getVelocity()
getVelocity
in interface PhysicsObject
public double getReflectionCoeff()
getReflectionCoeff
in interface PhysicsObject
public Sphere getSphere()
public double minDistanceToObjectFromP(Vect3 p)
PhysicsObject
minDistanceToObjectFromP
in interface PhysicsObject
public Vect3 reflect(PhysicsSphere ps)
reflect
in interface PhysicsObject
public void setMass(double mass)
setMass
in interface PhysicsObject
public void setPosition(Vect3 pos)
setPosition
in interface PhysicsObject
public void setRotCenter(Vect3 rc)
setRotCenter
in interface PhysicsObject
public void setRotOmega(Vect3 ro)
setRotOmega
in interface PhysicsObject
public void setVelocity(Vect3 vel)
setVelocity
in interface PhysicsObject
public void setReflectionCoeff(double rc)
setReflectionCoeff
in interface PhysicsObject
public void rotateAboutAxis(Vect3 center, Vect3 axis, double angle)
rotateAboutAxis
in interface PhysicsObject
public void update(double timestep)
update
in interface PhysicsObject
public double timeUntilCollision(PhysicsSphere ball, double lookahead)
timeUntilCollision
in interface PhysicsObject
public java.util.Collection<PlanePolygon> getPlanePolygons()
getPlanePolygons
in interface PrimitivesCollection
public java.util.Collection<PlaneCircle> getPlaneCircles()
getPlaneCircles
in interface PrimitivesCollection
public java.util.Collection<Sphere> getSpheres()
getSpheres
in interface PrimitivesCollection
public java.util.Collection<LateralCylinder> getLateralCylinders()
getLateralCylinders
in interface PrimitivesCollection
public java.util.Collection<Torus> getTori()
getTori
in interface PrimitivesCollection
public Vect3Pair getBoundingBox()
getBoundingBox
in interface PhysicsObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |