|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jass.engine.Out jass.contact.ContactForce
public class ContactForce
A force model with impact, slide, and slide modes based on looping wav files Roll force is fed through lowpass filter.
Field Summary | |
---|---|
protected BangForce |
bangForce
|
protected float |
dryRollGain
|
protected float |
fLowPass
|
protected Butter2LowFilter |
lowPassFilter
|
protected float |
physicalToAudioGainImpact
|
protected float |
physicalToAudioGainRoll
|
protected float |
physicalToAudioGainSlide
|
protected FilterContainer |
rollForce
|
protected LoopBuffer |
rollForceRaw
|
protected float |
rollSpeed1
|
protected LoopBuffer |
slideForce
|
protected float |
slideSpeed1
|
protected float |
vroll0
|
protected float |
vroll1
|
protected float |
vslide0
|
protected float |
vslide1
|
Fields inherited from class jass.engine.Out |
---|
buf, bufferSize, bufOld, lock |
Constructor Summary | |
---|---|
|
ContactForce(float srate,
int bufferSize,
java.lang.String fnImpact,
java.lang.String fnSlide,
java.lang.String fnRoll)
Construct contact force from named files. |
protected |
ContactForce(int bufferSize)
Contructor intended only for subclass constructors (super(bufferSize);) |
Method Summary | |
---|---|
void |
bang(float force,
float dur)
Generate impact force in physical units. |
void |
computeBuffer()
Compute the next buffer. |
void |
setRollFilter(float fLowPass,
float dryRollGain)
Set roll force filter properties: cutoff and drygain. |
void |
setRollProperties(float force,
float speed)
Set roll speed and normal force in physical units. |
void |
setSlideProperties(float force,
float speed)
Set slide speed and normal force in physical units. |
void |
setStaticContactModelParameters(float slideSpeed1,
float rollSpeed1,
float vslide0,
float vslide1,
float vroll0,
float vroll1,
float physicalToAudioGainSlide,
float physicalToAudioGainRoll,
float physicalToAudioGainImpact)
Set model parameters mapping physical units to audio units |
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 |
Field Detail |
---|
protected BangForce bangForce
protected LoopBuffer slideForce
protected LoopBuffer rollForceRaw
protected FilterContainer rollForce
protected Butter2LowFilter lowPassFilter
protected float fLowPass
protected float dryRollGain
protected float slideSpeed1
protected float rollSpeed1
protected float vslide0
protected float vslide1
protected float vroll0
protected float vroll1
protected float physicalToAudioGainSlide
protected float physicalToAudioGainRoll
protected float physicalToAudioGainImpact
Constructor Detail |
---|
protected ContactForce(int bufferSize)
public ContactForce(float srate, int bufferSize, java.lang.String fnImpact, java.lang.String fnSlide, java.lang.String fnRoll)
srate
- sampling rate in Hertz.bufferSize
- bufferSize of this Out.fnImpact
- Audio file name for impact. (For example cos20ms.wav.)fnSlide
- Audio file name for slide. (For example grid.wav.)fnRoll
- Audio file name for slide. (For example roll.wav.)Method Detail |
---|
public void setStaticContactModelParameters(float slideSpeed1, float rollSpeed1, float vslide0, float vslide1, float vroll0, float vroll1, float physicalToAudioGainSlide, float physicalToAudioGainRoll, float physicalToAudioGainImpact)
slideSpeed1
- maximum audio loop speed (1 = original recording)rollSpeed1
- maximum audio loop speed (1 = original recording)vslide0
- minimum physical speed (lower than this is considered to be zero)vslide1
- maximum physical speed (higher than this is set to this value)vroll0
- minimum physical speed (lower than this is considered to be zero)vroll1
- maximum physical speed (higher than this is set to this value)physicalToAudioGainSlide
- multiplies normal force to get slide gainphysicalToAudioGainRoll
- multiplies normal force to get roll gainphysicalToAudioGainImpact
- multiplies impact force to get impact gainpublic void bang(float force, float dur)
force
- magnitude.dur
- duration in seconds of impact.public void setSlideProperties(float force, float speed)
force
- normal force.speed
- relative surface velocity.public void setRollProperties(float force, float speed)
force
- normal force.speed
- roll velocity.public void setRollFilter(float fLowPass, float dryRollGain)
public void computeBuffer()
computeBuffer
in class Out
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |