net.sf.j3d.physics
Class Sphere
java.lang.Object
net.sf.j3d.threeD.raytracer.engine.AbstractSurface
net.sf.j3d.threeD.raytracer.primitives.Sphere
net.sf.j3d.physics.Sphere
- All Implemented Interfaces:
- RigidBody, ParticleGroup, Surface, Light, SurfaceLight
public class Sphere
- extends Sphere
- implements RigidBody, ParticleGroup, SurfaceLight
- Author:
- Mike Murray
| Fields inherited from interface net.sf.j3d.threeD.raytracer.lighting.Light |
castShadows |
|
Constructor Summary |
Sphere()
Constructs a new Sphere object using (0.0, 0.0, 0.0) for all vector values
1.0 for mass, 1.0 for the coefficient of restitution, and 4 for the radial sample. |
Sphere(Vector x,
Vector r,
Vector v,
Vector w,
Vector f,
Vector t,
double mass,
double e,
double radius,
int radialSample)
Constructs a new Sphere object using the specified initial rigid body state values. |
| Methods inherited from class net.sf.j3d.threeD.raytracer.engine.AbstractSurface |
addShader, addTexture, addTransform, calculateTransform, getColor, getColorAt, getColorAt, getIndexOfRefraction, getLocation, getParent, getReflectedPercentage, getReflectedPercentage, getRefractedPercentage, getRefractedPercentage, getRotationCoefficients, getScaleCoefficients, getShadeBack, getShadeFront, getShaderSet, getSize, getTexture, getTextures, getTextureSet, getTransform, getTransform, getTransforms, removeTexture, removeTransform, setColor, setIndexOfRefraction, setLocation, setParent, setReflectedPercentage, setRefractedPercentage, setRotationCoefficients, setScaleCoefficients, setShadeBack, setShadeFront, setShaders, setShaders, setSize, setTexture, setTextures, setTransform, setTransforms, shade |
Sphere
public Sphere()
- Constructs a new Sphere object using (0.0, 0.0, 0.0) for all vector values
1.0 for mass, 1.0 for the coefficient of restitution, and 4 for the radial sample.
Sphere
public Sphere(Vector x,
Vector r,
Vector v,
Vector w,
Vector f,
Vector t,
double mass,
double e,
double radius,
int radialSample)
- Constructs a new Sphere object using the specified initial rigid body state values.
- Parameters:
x - locationr - rotationv - linear velocityw - angular velocityf - forcet - torquemass - masse - coefficient of restitutionradius - radius
setRadius
public void setRadius(double radius)
getRadius
public double getRadius()
updateModel
public void updateModel()
- Specified by:
updateModel in interface RigidBody
updateVertices
public void updateVertices()
intersect
public Vector[] intersect(RigidBody b)
- Description copied from interface:
RigidBody
- Performs intersection calculations for this RigidBody object and the specified RigidBody object.
- Specified by:
intersect in interface RigidBody
- Returns:
- {intersection point, normal to intersection} or a zero length array if there is no intersection.
getParticleVertices
public double[][] getParticleVertices()
- Specified by:
getParticleVertices in interface ParticleGroup
- See Also:
ParticleGroup.getParticleVertices()
getState
public RigidBody.State getState()
- Specified by:
getState in interface RigidBody
- See Also:
RigidBody.getState()
draw
public void draw(Camera c,
Graphics g,
double ox,
double oy,
double scale)
- Specified by:
draw in interface RigidBody
- See Also:
RigidBody.draw(Camera, Graphics, double, double, double)
setLighting
public void setLighting(boolean on)
setLight
public void setLight(SphericalLight light)
- Sets the SphericalLight object used by this Sphere object.
- Parameters:
light - SphericalLight object to use.
getLight
public SphericalLight getLight()
- Returns:
- The SphericalLight object stored by this Sphere object.
getSamples
public Light[] getSamples(int samples)
- Specified by:
getSamples in interface SurfaceLight
- Parameters:
samples - Total number of samples to return.
- Returns:
- An array containing samples for this SurfaceLight instance.
- See Also:
SurfaceLight.getSamples(int)
getSamples
public Light[] getSamples()
- Specified by:
getSamples in interface SurfaceLight
- Returns:
- An array containing samples for this SurfaceLight instance.
- See Also:
SurfaceLight.getSamples()
setIntensity
public void setIntensity(double intensity)
- Description copied from interface:
Light
- Sets the intensity of this Light object.
- Specified by:
setIntensity in interface Light
- See Also:
Light.setIntensity(double)
getIntensity
public double getIntensity()
- Description copied from interface:
Light
- Returns the intensity of this Light object as a double value.
- Specified by:
getIntensity in interface Light
- See Also:
Light.getIntensity()