|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjass.engine.Out
jass.engine.InOut
jass.generators.ModalObjectWithOneContact
public class ModalObjectWithOneContact
Vibration model of object, capable of playing sound.
Field Summary | |
---|---|
protected float[] |
ampR
Reson filter gain. |
protected float |
b1
Current barycentric coordinates of location. |
protected float |
b2
Current barycentric coordinates of location. |
protected float |
b3
Current barycentric coordinates of location. |
protected float[] |
c_i
Cached values. |
ModalModel |
modalModel
Modal data. |
protected int |
p1
Current barycentric location points. |
protected int |
p2
Current barycentric location points. |
protected int |
p3
Current barycentric location points. |
protected float[] |
R2
The transfer function of a reson filter is H(z) = 1/(1-twoRCosTheta/z + R2/z*z). |
protected float |
rollGain
|
float |
srate
Sampling rate in Hertz. |
protected float[] |
tmpBuf
Temp storage |
protected float[] |
twoRCosTheta
The transfer function of a reson filter is H(z) = 1/(1-twoRCosTheta/z + R2/z*z). |
protected float[] |
yt_1
State of filters. |
protected float[] |
yt_2
State of filters. |
Fields inherited from class jass.engine.InOut |
---|
sourceContainer, sourcePassivity, srcBuffers |
Fields inherited from class jass.engine.Out |
---|
buf, bufferSize, bufOld, lock |
Constructor Summary | |
---|---|
ModalObjectWithOneContact(float srate,
int nf,
int np,
int bufferSize)
Create and initialize, but don't set any modal parameters. |
|
ModalObjectWithOneContact(int bufferSize)
Constructor for derived classes to call super |
|
ModalObjectWithOneContact(ModalModel m,
float srate,
int bufferSize)
Create and initialize with provided modal data. |
Method Summary | |
---|---|
java.lang.Object |
addSource(Source s)
Add a Source. |
protected void |
allocate(int nf,
int np)
Allocate data. |
void |
clearHistory()
Set state to non-vibrating. |
protected void |
computeBuffer()
Compute the next buffer and store in member float[] buf. |
void |
computeFilter()
Compute the filter coefficients used for real-time rendering from the modal model parameters. |
protected void |
computeLocation()
Compute gains. |
protected void |
computeModalFilterBank(float[] output,
float[] force,
int nsamples)
Apply external force[] and compute response through bank of modal filters. |
void |
computeResonCoeff()
Compute the reson coefficients from the modal model parameters. |
void |
setDamping(float dscale)
Scale dampings. |
void |
setFrequencyScale(float fscale)
Scale frequencies. |
void |
setGain(float a)
Scale gains. |
void |
setLocation(int p1,
int p2,
int p3,
float b1,
float b2,
float b3)
Compute the gain coefficients from the modal model parameters at point p, given inside triangle of point p1,p2,p3, with barycentric coordinated b1,b2,b3 |
void |
setNf(int nf)
Reduce number of modes used. |
Methods inherited from class jass.engine.InOut |
---|
addSource, getBuffer, getSources, removeSource, resetTime |
Methods inherited from class jass.engine.Out |
---|
clearBuffer, copyToOld, getBuffer, getBufferSize, getTime, peekAtBuffer, setBufferSize, setTime, setTimeAndNotify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public float srate
public ModalModel modalModel
protected int p1
protected int p2
protected int p3
protected float b1
protected float b2
protected float b3
protected float[] yt_1
protected float[] yt_2
protected float[] R2
protected float[] twoRCosTheta
protected float[] ampR
protected float[] c_i
protected float[] tmpBuf
protected float rollGain
Constructor Detail |
---|
public ModalObjectWithOneContact(int bufferSize)
bufferSize
- Buffer size used for real-time rendering.public ModalObjectWithOneContact(float srate, int nf, int np, int bufferSize)
srate
- sampling rate in Hertz.nf
- number of modes.np
- number of locations.bufferSize
- Buffer size used for real-time rendering.public ModalObjectWithOneContact(ModalModel m, float srate, int bufferSize)
m
- modal model to load.srate
- sampling rate in Hertz.bufferSize
- Buffer size used for real-time rendering.Method Detail |
---|
public java.lang.Object addSource(Source s) throws SinkIsFullException
addSource
in interface Sink
addSource
in class InOut
s
- Source to add.
SinkIsFullException
public void setDamping(float dscale)
d
- damping scale.public void setGain(float a)
a
- gain scale.public void setFrequencyScale(float fscale)
fscale
- frequency scale.public void setNf(int nf)
nf
- number of modes to use.protected void allocate(int nf, int np)
nf
- number of modes.np
- number of locations.public void computeFilter()
public void computeResonCoeff()
setLocation(int, int, int, float, float, float)
.
protected void computeLocation()
public void setLocation(int p1, int p2, int p3, float b1, float b2, float b3)
p1
- location index 1.p2
- location index 2.p3
- location index 3.b1
- barycentric coordinate 1.b2
- barycentric coordinate 2.b3
- barycentric coordinate 3.public void clearHistory()
protected void computeBuffer()
computeBuffer
in class Out
protected void computeModalFilterBank(float[] output, float[] force, int nsamples)
output
- user provided output buffer.force
- input force.nsamples
- number of samples to compute.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |