net.sf.j3d.physics.shaders
Class RigidBodyStateShader

java.lang.Object
  extended by net.sf.j3d.physics.shaders.RigidBodyStateShader
All Implemented Interfaces:
ColorProducer, Shader, Producer

public class RigidBodyStateShader
extends Object
implements Shader

A RigidBodyStateShader object can be used to modify the display of other shaders based on a property of the state of a RigidBody object. A RigidBodyStateShader modifies the light direction and intensity based on the direction and intensity of either the velocity or force experienced by a rigid body.

Author:
Mike Murray

Field Summary
static int FORCE
           
static int VELOCITY
           
 
Constructor Summary
RigidBodyStateShader(int type, double min, double max, Shader s)
          Constructs a new RigidBodyStateShader object that shades based on the state property specified by the integer type code.
 
Method Summary
 RGB evaluate(Object[] args)
          Produces a color using the specified arguments.
 Shader getShader()
           
 int getType()
           
 RGB shade(ShaderParameters p)
          Returns an RGB object that represents the shaded color calculated using the values of the specified ShaderParameters object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VELOCITY

public static final int VELOCITY
See Also:
Constant Field Values

FORCE

public static final int FORCE
See Also:
Constant Field Values
Constructor Detail

RigidBodyStateShader

public RigidBodyStateShader(int type,
                            double min,
                            double max,
                            Shader s)
Constructs a new RigidBodyStateShader object that shades based on the state property specified by the integer type code.

Parameters:
type - Integer type code.
min - Minimum value of state property.
max - Maximum value of state property.
s - Shader instance to use for shading.
Method Detail

getType

public int getType()
Returns:
The integer type code for this RigidBodyStateShader object.

getShader

public Shader getShader()
Returns:
The Shader object stored by this RigidBodyStateShader object.

shade

public RGB shade(ShaderParameters p)
Description copied from interface: Shader
Returns an RGB object that represents the shaded color calculated using the values of the specified ShaderParameters object.

Specified by:
shade in interface Shader
See Also:
Shader.shade(net.sf.j3d.threeD.raytracer.shaders.ShaderParameters)

evaluate

public RGB evaluate(Object[] args)
Description copied from interface: ColorProducer
Produces a color using the specified arguments.

Specified by:
evaluate in interface ColorProducer
Parameters:
args - Arguments.
Returns:
The RGB color produced.
See Also:
ColorProducer.evaluate(java.lang.Object[])