Class BangForce

  extended by jass.engine.Out
      extended by jass.generators.LoopBuffer
          extended by jass.generators.OneShotBuffer
              extended by jass.contact.BangForce
All Implemented Interfaces:

public class BangForce
extends OneShotBuffer

A force model based on 1 period of some waveform (cos for example)

Kees van den Doel (kvdoel@cs.ubc.ca)

Field Summary
Fields inherited from class jass.generators.LoopBuffer
dix, dx, ix, loopBuffer, loopBufferLength, speed, srate, srateLoopBuffer, volume, x
Fields inherited from class jass.engine.Out
buf, bufferSize, bufOld, lock
Constructor Summary
BangForce(float srate, int bufferSize, float[] loopBuffer)
          Construct loop force and provide buffer.
BangForce(float srate, int bufferSize, java.lang.String fn)
          Construct impact force from named file.
Method Summary
 void bang(float force, float dur)
          Generate impact force.
Methods inherited from class jass.generators.OneShotBuffer
computeBuffer, hit
Methods inherited from class jass.generators.LoopBuffer
getLoopBuffer, getNextSample, setSpeed, setVolume
Methods inherited from class jass.engine.Out
clearBuffer, copyToOld, getBuffer, getBuffer, getBufferSize, getTime, peekAtBuffer, resetTime, setBufferSize, setTime, setTimeAndNotify
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public BangForce(float srate,
                 int bufferSize,
                 java.lang.String fn)
Construct impact force from named file. (For example cos20ms.wav.)

srate - sampling rate in Hertz.
bufferSize - bufferSize of this Out.
fn - Audio file name. (For example cos20ms.wav.)


public BangForce(float srate,
                 int bufferSize,
                 float[] loopBuffer)
Construct loop force and provide buffer.

srate - sampling rate in Hertz.
bufferSize - bufferSize of this Out.
loopBuffer - looping buffer.
Method Detail


public void bang(float force,
                 float dur)
Generate impact force.

force - magnitude.
dur - duration in seconds of impact.