Copy+Attentional Convolutional


Original Name mul,trans,unsafe

mul

<SENTENCE_START> { out . s = q . c * r . s - q . s * r . c ; out . c = q . c * r . c + q . s * r . s ; } <SENTENCE_END/>

(Copy Probability: 2.1%)

<SENTENCE_START> { out . s = q . c * r . s - q . s * r . c ; out . c = q . c * r . c + q . s * r . s ; } <SENTENCE_END/>

trans

<SENTENCE_START> { out . s = q . c * r . s - q . s * r . c ; out . c = q . c * r . c + q . s * r . s ; } <SENTENCE_END/>

(Copy Probability: 1.2%)

<SENTENCE_START> { out . s = q . c * r . s - q . s * r . c ; out . c = q . c * r . c + q . s * r . s ; } <SENTENCE_END/>

unsafe

<SENTENCE_START> { out . s = q . c * r . s - q . s * r . c ; out . c = q . c * r . c + q . s * r . s ; } <SENTENCE_END/>

(Copy Probability: 1.3%)

<SENTENCE_START> { out . s = q . c * r . s - q . s * r . c ; out . c = q . c * r . c + q . s * r . s ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { out . s = q . c * r . s - q . s * r . c ; out . c = q . c * r . c + q . s * r . s ; } <SENTENCE_END/>

(Copy Probability: 1.5%)

<SENTENCE_START> { out . s = q . c * r . s - q . s * r . c ; out . c = q . c * r . c + q . s * r . s ; } <SENTENCE_END/>


Original Name mul,to,out

mul

<SENTENCE_START> { float tempy = q . s * v . x + q . c * v . y ; out . x = q . c * v . x - q . s * v . y ; out . y = tempy ; } <SENTENCE_END/>

(Copy Probability: 1.8%)

<SENTENCE_START> { float tempy = q . s * v . x + q . c * v . y ; out . x = q . c * v . x - q . s * v . y ; out . y = tempy ; } <SENTENCE_END/>

to

<SENTENCE_START> { float tempy = q . s * v . x + q . c * v . y ; out . x = q . c * v . x - q . s * v . y ; out . y = tempy ; } <SENTENCE_END/>

(Copy Probability: 0.9%)

<SENTENCE_START> { float tempy = q . s * v . x + q . c * v . y ; out . x = q . c * v . x - q . s * v . y ; out . y = tempy ; } <SENTENCE_END/>

out

<SENTENCE_START> { float tempy = q . s * v . x + q . c * v . y ; out . x = q . c * v . x - q . s * v . y ; out . y = tempy ; } <SENTENCE_END/>

(Copy Probability: 1.1%)

<SENTENCE_START> { float tempy = q . s * v . x + q . c * v . y ; out . x = q . c * v . x - q . s * v . y ; out . y = tempy ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { float tempy = q . s * v . x + q . c * v . y ; out . x = q . c * v . x - q . s * v . y ; out . y = tempy ; } <SENTENCE_END/>

(Copy Probability: 1.7%)

<SENTENCE_START> { float tempy = q . s * v . x + q . c * v . y ; out . x = q . c * v . x - q . s * v . y ; out . y = tempy ; } <SENTENCE_END/>


Original Name mul,to,out,unsafe

mul

<SENTENCE_START> { out . x = q . c * v . x - q . s * v . y ; out . y = q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

(Copy Probability: 1.4%)

<SENTENCE_START> { out . x = q . c * v . x - q . s * v . y ; out . y = q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

to

<SENTENCE_START> { out . x = q . c * v . x - q . s * v . y ; out . y = q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

(Copy Probability: 1.1%)

<SENTENCE_START> { out . x = q . c * v . x - q . s * v . y ; out . y = q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

out

<SENTENCE_START> { out . x = q . c * v . x - q . s * v . y ; out . y = q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

(Copy Probability: 1.1%)

<SENTENCE_START> { out . x = q . c * v . x - q . s * v . y ; out . y = q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

unsafe

<SENTENCE_START> { out . x = q . c * v . x - q . s * v . y ; out . y = q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

(Copy Probability: 1.4%)

<SENTENCE_START> { out . x = q . c * v . x - q . s * v . y ; out . y = q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { out . x = q . c * v . x - q . s * v . y ; out . y = q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

(Copy Probability: 3.7%)

<SENTENCE_START> { out . x = q . c * v . x - q . s * v . y ; out . y = q . s * v . x + q . c * v . y ; } <SENTENCE_END/>


Original Name mul,trans

mul

<SENTENCE_START> { final float tempy = - q . s * v . x + q . c * v . y ; out . x = q . c * v . x + q . s * v . y ; out . y = tempy ; } <SENTENCE_END/>

(Copy Probability: 1.7%)

<SENTENCE_START> { final float tempy = - q . s * v . x + q . c * v . y ; out . x = q . c * v . x + q . s * v . y ; out . y = tempy ; } <SENTENCE_END/>

trans

<SENTENCE_START> { final float tempy = - q . s * v . x + q . c * v . y ; out . x = q . c * v . x + q . s * v . y ; out . y = tempy ; } <SENTENCE_END/>

(Copy Probability: 0.8%)

<SENTENCE_START> { final float tempy = - q . s * v . x + q . c * v . y ; out . x = q . c * v . x + q . s * v . y ; out . y = tempy ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { final float tempy = - q . s * v . x + q . c * v . y ; out . x = q . c * v . x + q . s * v . y ; out . y = tempy ; } <SENTENCE_END/>

(Copy Probability: 1.1%)

<SENTENCE_START> { final float tempy = - q . s * v . x + q . c * v . y ; out . x = q . c * v . x + q . s * v . y ; out . y = tempy ; } <SENTENCE_END/>


Original Name mul,trans,unsafe

mul

<SENTENCE_START> { out . x = q . c * v . x + q . s * v . y ; out . y = - q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

(Copy Probability: 1.3%)

<SENTENCE_START> { out . x = q . c * v . x + q . s * v . y ; out . y = - q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

trans

<SENTENCE_START> { out . x = q . c * v . x + q . s * v . y ; out . y = - q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

(Copy Probability: 1.1%)

<SENTENCE_START> { out . x = q . c * v . x + q . s * v . y ; out . y = - q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

unsafe

<SENTENCE_START> { out . x = q . c * v . x + q . s * v . y ; out . y = - q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

(Copy Probability: 1.0%)

<SENTENCE_START> { out . x = q . c * v . x + q . s * v . y ; out . y = - q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { out . x = q . c * v . x + q . s * v . y ; out . y = - q . s * v . x + q . c * v . y ; } <SENTENCE_END/>

(Copy Probability: 0.8%)

<SENTENCE_START> { out . x = q . c * v . x + q . s * v . y ; out . y = - q . s * v . x + q . c * v . y ; } <SENTENCE_END/>


Original Name initialize

initialize

<SENTENCE_START> { main loop thread = new thread ( "HeadlessApplication" ) { @ override public void run ( ) { try { headless application . this . main loop ( ) ; } catch ( throwable t ) { if ( t instanceof runtime exception ) throw ( runtime exception ) t ; else throw new gdx runtime exception ( t ) ; } } } ; main loop thread . start ( ) ; } <SENTENCE_END/>

(Copy Probability: 2.7%)

<SENTENCE_START> { main loop thread = new thread ( "HeadlessApplication" ) { @ override public void run ( ) { try { headless application . this . main loop ( ) ; } catch ( throwable t ) { if ( t instanceof runtime exception ) throw ( runtime exception ) t ; else throw new gdx runtime exception ( t ) ; } } } ; main loop thread . start ( ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { main loop thread = new thread ( "HeadlessApplication" ) { @ override public void run ( ) { try { headless application . this . main loop ( ) ; } catch ( throwable t ) { if ( t instanceof runtime exception ) throw ( runtime exception ) t ; else throw new gdx runtime exception ( t ) ; } } } ; main loop thread . start ( ) ; } <SENTENCE_END/>

(Copy Probability: 5.7%)

<SENTENCE_START> { main loop thread = new thread ( "HeadlessApplication" ) { @ override public void run ( ) { try { headless application . this . main loop ( ) ; } catch ( throwable t ) { if ( t instanceof runtime exception ) throw ( runtime exception ) t ; else throw new gdx runtime exception ( t ) ; } } } ; main loop thread . start ( ) ; } <SENTENCE_END/>


Original Name main,loop

main

<SENTENCE_START> { array < lifecycle listener > lifecycle listeners = this . lifecycle listeners ; listener . create ( ) ; boolean was active = true ; long t = time utils . nano time ( ) + render interval ; if ( render interval >= 0f ) { while ( running ) { final long n = time utils . nano time ( ) ; if ( t > n ) { try { thread . sleep ( ( t - n ) / 1000000 ) ; } catch ( interrupted exception e ) { } t = time utils . nano time ( ) + render interval ; } else t = n + render interval ; execute runnables ( ) ; graphics . increment frame id ( ) ; listener . render ( ) ; graphics . update time ( ) ; if ( ! running ) break ; } } synchronized ( lifecycle listeners ) { for ( lifecycle listener listener : lifecycle listeners ) { listener . pause ( ) ; listener . dispose ( ) ; } } listener . pause ( ) ; listener . dispose ( ) ; } <SENTENCE_END/>

(Copy Probability: 4.7%)

<SENTENCE_START> { array < lifecycle listener > lifecycle listeners = this . lifecycle listeners ; listener . create ( ) ; boolean was active = true ; long t = time utils . nano time ( ) + render interval ; if ( render interval >= 0f ) { while ( running ) { final long n = time utils . nano time ( ) ; if ( t > n ) { try { thread . sleep ( ( t - n ) / 1000000 ) ; } catch ( interrupted exception e ) { } t = time utils . nano time ( ) + render interval ; } else t = n + render interval ; execute runnables ( ) ; graphics . increment frame id ( ) ; listener . render ( ) ; graphics . update time ( ) ; if ( ! running ) break ; } } synchronized ( lifecycle listeners ) { for ( lifecycle listener listener : lifecycle listeners ) { listener . pause ( ) ; listener . dispose ( ) ; } } listener . pause ( ) ; listener . dispose ( ) ; } <SENTENCE_END/>

loop

<SENTENCE_START> { array < lifecycle listener > lifecycle listeners = this . lifecycle listeners ; listener . create ( ) ; boolean was active = true ; long t = time utils . nano time ( ) + render interval ; if ( render interval >= 0f ) { while ( running ) { final long n = time utils . nano time ( ) ; if ( t > n ) { try { thread . sleep ( ( t - n ) / 1000000 ) ; } catch ( interrupted exception e ) { } t = time utils . nano time ( ) + render interval ; } else t = n + render interval ; execute runnables ( ) ; graphics . increment frame id ( ) ; listener . render ( ) ; graphics . update time ( ) ; if ( ! running ) break ; } } synchronized ( lifecycle listeners ) { for ( lifecycle listener listener : lifecycle listeners ) { listener . pause ( ) ; listener . dispose ( ) ; } } listener . pause ( ) ; listener . dispose ( ) ; } <SENTENCE_END/>

(Copy Probability: 45.4%)

<SENTENCE_START> { array < lifecycle listener > lifecycle listeners = this . lifecycle listeners ; listener . create ( ) ; boolean was active = true ; long t = time utils . nano time ( ) + render interval ; if ( render interval >= 0f ) { while ( running ) { final long n = time utils . nano time ( ) ; if ( t > n ) { try { thread . sleep ( ( t - n ) / 1000000 ) ; } catch ( interrupted exception e ) { } t = time utils . nano time ( ) + render interval ; } else t = n + render interval ; execute runnables ( ) ; graphics . increment frame id ( ) ; listener . render ( ) ; graphics . update time ( ) ; if ( ! running ) break ; } } synchronized ( lifecycle listeners ) { for ( lifecycle listener listener : lifecycle listeners ) { listener . pause ( ) ; listener . dispose ( ) ; } } listener . pause ( ) ; listener . dispose ( ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { array < lifecycle listener > lifecycle listeners = this . lifecycle listeners ; listener . create ( ) ; boolean was active = true ; long t = time utils . nano time ( ) + render interval ; if ( render interval >= 0f ) { while ( running ) { final long n = time utils . nano time ( ) ; if ( t > n ) { try { thread . sleep ( ( t - n ) / 1000000 ) ; } catch ( interrupted exception e ) { } t = time utils . nano time ( ) + render interval ; } else t = n + render interval ; execute runnables ( ) ; graphics . increment frame id ( ) ; listener . render ( ) ; graphics . update time ( ) ; if ( ! running ) break ; } } synchronized ( lifecycle listeners ) { for ( lifecycle listener listener : lifecycle listeners ) { listener . pause ( ) ; listener . dispose ( ) ; } } listener . pause ( ) ; listener . dispose ( ) ; } <SENTENCE_END/>

(Copy Probability: 23.0%)

<SENTENCE_START> { array < lifecycle listener > lifecycle listeners = this . lifecycle listeners ; listener . create ( ) ; boolean was active = true ; long t = time utils . nano time ( ) + render interval ; if ( render interval >= 0f ) { while ( running ) { final long n = time utils . nano time ( ) ; if ( t > n ) { try { thread . sleep ( ( t - n ) / 1000000 ) ; } catch ( interrupted exception e ) { } t = time utils . nano time ( ) + render interval ; } else t = n + render interval ; execute runnables ( ) ; graphics . increment frame id ( ) ; listener . render ( ) ; graphics . update time ( ) ; if ( ! running ) break ; } } synchronized ( lifecycle listeners ) { for ( lifecycle listener listener : lifecycle listeners ) { listener . pause ( ) ; listener . dispose ( ) ; } } listener . pause ( ) ; listener . dispose ( ) ; } <SENTENCE_END/>


Original Name execute,runnables

execute

<SENTENCE_START> { synchronized ( runnables ) { for ( int i = runnables . size - 1 ; i >= 0 ; i -- ) executed runnables . add ( runnables . get ( i ) ) ; runnables . clear ( ) ; } if ( executed runnables . size == 0 ) return false ; for ( int i = executed runnables . size - 1 ; i >= 0 ; i -- ) executed runnables . remove index ( i ) . run ( ) ; return true ; } <SENTENCE_END/>

(Copy Probability: 6.8%)

<SENTENCE_START> { synchronized ( runnables ) { for ( int i = runnables . size - 1 ; i >= 0 ; i -- ) executed runnables . add ( runnables . get ( i ) ) ; runnables . clear ( ) ; } if ( executed runnables . size == 0 ) return false ; for ( int i = executed runnables . size - 1 ; i >= 0 ; i -- ) executed runnables . remove index ( i ) . run ( ) ; return true ; } <SENTENCE_END/>

runnables

<SENTENCE_START> { synchronized ( runnables ) { for ( int i = runnables . size - 1 ; i >= 0 ; i -- ) executed runnables . add ( runnables . get ( i ) ) ; runnables . clear ( ) ; } if ( executed runnables . size == 0 ) return false ; for ( int i = executed runnables . size - 1 ; i >= 0 ; i -- ) executed runnables . remove index ( i ) . run ( ) ; return true ; } <SENTENCE_END/>

(Copy Probability: 47.6%)

<SENTENCE_START> { synchronized ( runnables ) { for ( int i = runnables . size - 1 ; i >= 0 ; i -- ) executed runnables . add ( runnables . get ( i ) ) ; runnables . clear ( ) ; } if ( executed runnables . size == 0 ) return false ; for ( int i = executed runnables . size - 1 ; i >= 0 ; i -- ) executed runnables . remove index ( i ) . run ( ) ; return true ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { synchronized ( runnables ) { for ( int i = runnables . size - 1 ; i >= 0 ; i -- ) executed runnables . add ( runnables . get ( i ) ) ; runnables . clear ( ) ; } if ( executed runnables . size == 0 ) return false ; for ( int i = executed runnables . size - 1 ; i >= 0 ; i -- ) executed runnables . remove index ( i ) . run ( ) ; return true ; } <SENTENCE_END/>

(Copy Probability: 6.9%)

<SENTENCE_START> { synchronized ( runnables ) { for ( int i = runnables . size - 1 ; i >= 0 ; i -- ) executed runnables . add ( runnables . get ( i ) ) ; runnables . clear ( ) ; } if ( executed runnables . size == 0 ) return false ; for ( int i = executed runnables . size - 1 ; i >= 0 ; i -- ) executed runnables . remove index ( i ) . run ( ) ; return true ; } <SENTENCE_END/>


Original Name get,c,ptr

get

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>

(Copy Probability: 1.5%)

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>

c

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>

(Copy Probability: 99.7%)

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>

ptr

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>

(Copy Probability: 99.8%)

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>

(Copy Probability: 3.7%)

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>


Original Name set,flags

set

<SENTENCE_START> { collision jni . bt triangle info data flags set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 1.8%)

<SENTENCE_START> { collision jni . bt triangle info data flags set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

flags

<SENTENCE_START> { collision jni . bt triangle info data flags set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 99.8%)

<SENTENCE_START> { collision jni . bt triangle info data flags set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { collision jni . bt triangle info data flags set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 0.8%)

<SENTENCE_START> { collision jni . bt triangle info data flags set ( swig c ptr , this , value ) ; } <SENTENCE_END/>


Original Name get,flags

get

<SENTENCE_START> { return collision jni . bt triangle info data flags get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 1.7%)

<SENTENCE_START> { return collision jni . bt triangle info data flags get ( swig c ptr , this ) ; } <SENTENCE_END/>

flags

<SENTENCE_START> { return collision jni . bt triangle info data flags get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 99.8%)

<SENTENCE_START> { return collision jni . bt triangle info data flags get ( swig c ptr , this ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { return collision jni . bt triangle info data flags get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 1.2%)

<SENTENCE_START> { return collision jni . bt triangle info data flags get ( swig c ptr , this ) ; } <SENTENCE_END/>


Original Name set,edge,v,0,v,1,angle

set

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 3.2%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

edge

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 99.6%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 99.6%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

0

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 96.8%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 45.3%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

1

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 13.1%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

angle

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 13.1%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 12.0%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>


Original Name get,edge,v,0,v,1,angle

get

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 2.5%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

edge

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 99.6%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 99.7%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

0

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 96.1%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 39.6%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

1

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 11.1%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

angle

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 11.1%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 10.2%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>


Original Name set,edge,v,1,v,2,angle

set

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 3.2%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

edge

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 99.6%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 99.6%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

1

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 95.8%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 39.1%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

2

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 12.5%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

angle

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 12.5%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 12.2%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>


Original Name get,edge,v,1,v,2,angle

get

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 2.5%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

edge

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 99.4%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 99.6%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

1

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 94.8%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 34.3%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

2

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 10.9%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

angle

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 10.9%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 10.6%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>


Original Name set,edge,v,2,v,0,angle

set

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 2.5%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

edge

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 99.5%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 99.0%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

2

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 90.8%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 23.9%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

0

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 7.3%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

angle

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 7.3%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 7.1%)

<SENTENCE_START> { collision jni . bt triangle info data edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>


Original Name get,edge,v,2,v,0,angle

get

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 1.9%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

edge

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 99.2%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 98.9%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

2

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 87.3%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 18.7%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

0

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 5.9%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

angle

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 5.9%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 5.7%)

<SENTENCE_START> { return collision jni . bt triangle info data edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>


Original Name get,c,ptr

get

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>

(Copy Probability: 1.5%)

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>

c

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>

(Copy Probability: 99.7%)

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>

ptr

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>

(Copy Probability: 99.8%)

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>

(Copy Probability: 3.7%)

<SENTENCE_START> { return ( obj == null ) ? 0 : obj . swig c ptr ; } <SENTENCE_END/>


Original Name set,flags

set

<SENTENCE_START> { collision jni . bt triangle info flags set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 1.5%)

<SENTENCE_START> { collision jni . bt triangle info flags set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

flags

<SENTENCE_START> { collision jni . bt triangle info flags set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 99.5%)

<SENTENCE_START> { collision jni . bt triangle info flags set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { collision jni . bt triangle info flags set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 0.8%)

<SENTENCE_START> { collision jni . bt triangle info flags set ( swig c ptr , this , value ) ; } <SENTENCE_END/>


Original Name get,flags

get

<SENTENCE_START> { return collision jni . bt triangle info flags get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 1.4%)

<SENTENCE_START> { return collision jni . bt triangle info flags get ( swig c ptr , this ) ; } <SENTENCE_END/>

flags

<SENTENCE_START> { return collision jni . bt triangle info flags get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 99.5%)

<SENTENCE_START> { return collision jni . bt triangle info flags get ( swig c ptr , this ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { return collision jni . bt triangle info flags get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 0.8%)

<SENTENCE_START> { return collision jni . bt triangle info flags get ( swig c ptr , this ) ; } <SENTENCE_END/>


Original Name set,edge,v,0,v,1,angle

set

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 3.1%)

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

edge

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 99.6%)

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 99.8%)

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

0

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 97.1%)

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 43.1%)

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

1

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 14.6%)

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

angle

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 14.6%)

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 15.4%)

<SENTENCE_START> { collision jni . bt triangle info edge v 0 v 1 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>


Original Name get,edge,v,0,v,1,angle

get

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 2.4%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

edge

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 99.5%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 99.8%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

0

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 96.0%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 39.3%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

1

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 13.6%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

angle

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 13.6%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 12.8%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 0 v 1 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>


Original Name set,edge,v,1,v,2,angle

set

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 2.8%)

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

edge

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 99.6%)

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 99.6%)

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

1

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 92.6%)

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 31.7%)

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

2

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 13.2%)

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

angle

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 13.2%)

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 13.0%)

<SENTENCE_START> { collision jni . bt triangle info edge v 1 v 2 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>


Original Name get,edge,v,1,v,2,angle

get

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 2.1%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

edge

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 99.5%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 99.6%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

1

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 89.7%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 27.5%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

2

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 11.7%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

angle

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 11.7%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 11.6%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 1 v 2 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>


Original Name set,edge,v,2,v,0,angle

set

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 1.9%)

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

edge

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 99.3%)

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 99.6%)

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

2

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 88.3%)

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 26.3%)

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

0

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 9.2%)

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

angle

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 9.3%)

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>

(Copy Probability: 9.1%)

<SENTENCE_START> { collision jni . bt triangle info edge v 2 v 0 angle set ( swig c ptr , this , value ) ; } <SENTENCE_END/>


Original Name get,edge,v,2,v,0,angle

get

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 1.4%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

edge

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 99.1%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 99.5%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

2

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 83.7%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

v

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 23.0%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

0

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 8.5%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

angle

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 8.6%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>

(Copy Probability: 8.4%)

<SENTENCE_START> { return collision jni . bt triangle info edge v 2 v 0 angle get ( swig c ptr , this ) ; } <SENTENCE_END/>


Original Name create

create

<SENTENCE_START> { pixmap = new pixmap ( 800 , 480 , pixmap . format . rgba 8888 ) ; texture = new texture ( 1024 , 1024 , pixmap . format . rgba 8888 ) ; texture . set filter ( texture . texture filter . nearest , texture . texture filter . linear ) ; texture . set wrap ( texture . texture wrap . clamp to edge , texture . texture wrap . clamp to edge ) ; pixmap . set color ( 1.0f , 0.0f , 0.0f , 1.0f ) ; pixmap . draw line ( 0 , 0 , 100 , 100 ) ; pixmap . set color ( 0.0f , 0.0f , 1.0f , 1.0f ) ; pixmap . draw line ( 100 , 100 , 200 , 0 ) ; pixmap . set color ( 0.0f , 1.0f , 0.0f , 1.0f ) ; pixmap . draw line ( 100 , 0 , 100 , 100 ) ; pixmap . set color ( 1.0f , 1.0f , 1.0f , 1.0f ) ; pixmap . draw circle ( 400 , 300 , 100 ) ; texture . draw ( pixmap , 0 , 0 ) ; region = new texture region ( texture , 0 , 0 , 800 , 480 ) ; batch = new sprite batch ( ) ; pixmap pixmap = new pixmap ( 512 , 1024 , pixmap . format . rgba 8888 ) ; for ( int y = 0 ; y < pixmap . get height ( ) ; y ++ ) { for ( int x = 0 ; x < pixmap . get width ( ) ; x ++ ) { pixmap . get pixel ( x , y ) ; } } pixmap . dispose ( ) ; } <SENTENCE_END/>

(Copy Probability: 3.6%)

<SENTENCE_START> { pixmap = new pixmap ( 800 , 480 , pixmap . format . rgba 8888 ) ; texture = new texture ( 1024 , 1024 , pixmap . format . rgba 8888 ) ; texture . set filter ( texture . texture filter . nearest , texture . texture filter . linear ) ; texture . set wrap ( texture . texture wrap . clamp to edge , texture . texture wrap . clamp to edge ) ; pixmap . set color ( 1.0f , 0.0f , 0.0f , 1.0f ) ; pixmap . draw line ( 0 , 0 , 100 , 100 ) ; pixmap . set color ( 0.0f , 0.0f , 1.0f , 1.0f ) ; pixmap . draw line ( 100 , 100 , 200 , 0 ) ; pixmap . set color ( 0.0f , 1.0f , 0.0f , 1.0f ) ; pixmap . draw line ( 100 , 0 , 100 , 100 ) ; pixmap . set color ( 1.0f , 1.0f , 1.0f , 1.0f ) ; pixmap . draw circle ( 400 , 300 , 100 ) ; texture . draw ( pixmap , 0 , 0 ) ; region = new texture region ( texture , 0 , 0 , 800 , 480 ) ; batch = new sprite batch ( ) ; pixmap pixmap = new pixmap ( 512 , 1024 , pixmap . format . rgba 8888 ) ; for ( int y = 0 ; y < pixmap . get height ( ) ; y ++ ) { for ( int x = 0 ; x < pixmap . get width ( ) ; x ++ ) { pixmap . get pixel ( x , y ) ; } } pixmap . dispose ( ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { pixmap = new pixmap ( 800 , 480 , pixmap . format . rgba 8888 ) ; texture = new texture ( 1024 , 1024 , pixmap . format . rgba 8888 ) ; texture . set filter ( texture . texture filter . nearest , texture . texture filter . linear ) ; texture . set wrap ( texture . texture wrap . clamp to edge , texture . texture wrap . clamp to edge ) ; pixmap . set color ( 1.0f , 0.0f , 0.0f , 1.0f ) ; pixmap . draw line ( 0 , 0 , 100 , 100 ) ; pixmap . set color ( 0.0f , 0.0f , 1.0f , 1.0f ) ; pixmap . draw line ( 100 , 100 , 200 , 0 ) ; pixmap . set color ( 0.0f , 1.0f , 0.0f , 1.0f ) ; pixmap . draw line ( 100 , 0 , 100 , 100 ) ; pixmap . set color ( 1.0f , 1.0f , 1.0f , 1.0f ) ; pixmap . draw circle ( 400 , 300 , 100 ) ; texture . draw ( pixmap , 0 , 0 ) ; region = new texture region ( texture , 0 , 0 , 800 , 480 ) ; batch = new sprite batch ( ) ; pixmap pixmap = new pixmap ( 512 , 1024 , pixmap . format . rgba 8888 ) ; for ( int y = 0 ; y < pixmap . get height ( ) ; y ++ ) { for ( int x = 0 ; x < pixmap . get width ( ) ; x ++ ) { pixmap . get pixel ( x , y ) ; } } pixmap . dispose ( ) ; } <SENTENCE_END/>

(Copy Probability: 13.1%)

<SENTENCE_START> { pixmap = new pixmap ( 800 , 480 , pixmap . format . rgba 8888 ) ; texture = new texture ( 1024 , 1024 , pixmap . format . rgba 8888 ) ; texture . set filter ( texture . texture filter . nearest , texture . texture filter . linear ) ; texture . set wrap ( texture . texture wrap . clamp to edge , texture . texture wrap . clamp to edge ) ; pixmap . set color ( 1.0f , 0.0f , 0.0f , 1.0f ) ; pixmap . draw line ( 0 , 0 , 100 , 100 ) ; pixmap . set color ( 0.0f , 0.0f , 1.0f , 1.0f ) ; pixmap . draw line ( 100 , 100 , 200 , 0 ) ; pixmap . set color ( 0.0f , 1.0f , 0.0f , 1.0f ) ; pixmap . draw line ( 100 , 0 , 100 , 100 ) ; pixmap . set color ( 1.0f , 1.0f , 1.0f , 1.0f ) ; pixmap . draw circle ( 400 , 300 , 100 ) ; texture . draw ( pixmap , 0 , 0 ) ; region = new texture region ( texture , 0 , 0 , 800 , 480 ) ; batch = new sprite batch ( ) ; pixmap pixmap = new pixmap ( 512 , 1024 , pixmap . format . rgba 8888 ) ; for ( int y = 0 ; y < pixmap . get height ( ) ; y ++ ) { for ( int x = 0 ; x < pixmap . get width ( ) ; x ++ ) { pixmap . get pixel ( x , y ) ; } } pixmap . dispose ( ) ; } <SENTENCE_END/>


Original Name render

render

<SENTENCE_START> { gdx . gl . gl clear color ( 0.6f , 0.6f , 0.6f , 1 ) ; gdx . gl . gl clear ( gl 20 . gl color buffer bit ) ; batch . begin ( ) ; batch . draw ( region , 0 , 0 ) ; batch . end ( ) ; } <SENTENCE_END/>

(Copy Probability: 2.4%)

<SENTENCE_START> { gdx . gl . gl clear color ( 0.6f , 0.6f , 0.6f , 1 ) ; gdx . gl . gl clear ( gl 20 . gl color buffer bit ) ; batch . begin ( ) ; batch . draw ( region , 0 , 0 ) ; batch . end ( ) ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { gdx . gl . gl clear color ( 0.6f , 0.6f , 0.6f , 1 ) ; gdx . gl . gl clear ( gl 20 . gl color buffer bit ) ; batch . begin ( ) ; batch . draw ( region , 0 , 0 ) ; batch . end ( ) ; } <SENTENCE_END/>

(Copy Probability: 5.2%)

<SENTENCE_START> { gdx . gl . gl clear color ( 0.6f , 0.6f , 0.6f , 1 ) ; gdx . gl . gl clear ( gl 20 . gl color buffer bit ) ; batch . begin ( ) ; batch . draw ( region , 0 , 0 ) ; batch . end ( ) ; } <SENTENCE_END/>


Original Name get,loaded,music

get

<SENTENCE_START> { return music ; } <SENTENCE_END/>

(Copy Probability: 0.4%)

<SENTENCE_START> { return music ; } <SENTENCE_END/>

loaded

<SENTENCE_START> { return music ; } <SENTENCE_END/>

(Copy Probability: 81.9%)

<SENTENCE_START> { return music ; } <SENTENCE_END/>

music

<SENTENCE_START> { return music ; } <SENTENCE_END/>

(Copy Probability: 1.0%)

<SENTENCE_START> { return music ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { return music ; } <SENTENCE_END/>

(Copy Probability: 0.4%)

<SENTENCE_START> { return music ; } <SENTENCE_END/>


Original Name init

init

<SENTENCE_START> { m step = def . step ; m count = def . count ; if ( m position constraints . length < m count ) { contact position constraint [ ] old = m position constraints ; m position constraints = new contact position constraint [ math utils . max ( old . length * 2 , m count ) ] ; system . arraycopy ( old , 0 , m position constraints , 0 , old . length ) ; for ( int i = old . length ; i < m position constraints . length ; i ++ ) { m position constraints [ i ] = new contact position constraint ( ) ; } } if ( m velocity constraints . length < m count ) { contact velocity constraint [ ] old = m velocity constraints ; m velocity constraints = new contact velocity constraint [ math utils . max ( old . length * 2 , m count ) ] ; system . arraycopy ( old , 0 , m velocity constraints , 0 , old . length ) ; for ( int i = old . length ; i < m velocity constraints . length ; i ++ ) { m velocity constraints [ i ] = new contact velocity constraint ( ) ; } } m positions = def . positions ; m velocities = def . velocities ; m contacts = def . contacts ; for ( int i = 0 ; i < m count ; ++ i ) { final contact contact = m contacts [ i ] ; final fixture fixture a = contact . m fixture a ; final fixture fixture b = contact . m fixture b ; final shape shape a = fixture a . get shape ( ) ; final shape shape b = fixture b . get shape ( ) ; final float radius a = shape a . m radius ; final float radius b = shape b . m radius ; final body body a = fixture a . get body ( ) ; final body body b = fixture b . get body ( ) ; final manifold manifold = contact . get manifold ( ) ; int point count = manifold . point count ; assert ( point count > 0 ) ; contact velocity constraint vc = m velocity constraints [ i ] ; vc . friction = contact . m friction ; vc . restitution = contact . m restitution ; vc . tangent speed = contact . m tangent speed ; vc . index a = body a . m island index ; vc . index b = body b . m island index ; vc . inv mass a = body a . m inv mass ; vc . inv mass b = body b . m inv mass ; vc . inv ia = body a . m inv i ; vc . inv ib = body b . m inv i ; vc . contact index = i ; vc . point count = point count ; vc . k . set zero ( ) ; vc . normal mass . set zero ( ) ; contact position constraint pc = m position constraints [ i ] ; pc . index a = body a . m island index ; pc . index b = body b . m island index ; pc . inv mass a = body a . m inv mass ; pc . inv mass b = body b . m inv mass ; pc . local center a . set ( body a . m sweep . local center ) ; pc . local center b . set ( body b . m sweep . local center ) ; pc . inv ia = body a . m inv i ; pc . inv ib = body b . m inv i ; pc . local normal . set ( manifold . local normal ) ; pc . local point . set ( manifold . local point ) ; pc . point count = point count ; pc . radius a = radius a ; pc . radius b = radius b ; pc . type = manifold . type ; for ( int j = 0 ; j < point count ; j ++ ) { manifold point cp = manifold . points [ j ] ; velocity constraint point vcp = vc . points [ j ] ; if ( m step . warm starting ) { vcp . normal impulse = m step . dt ratio * cp . normal impulse ; vcp . tangent impulse = m step . dt ratio * cp . tangent impulse ; } else { vcp . normal impulse = 0 ; vcp . tangent impulse = 0 ; } vcp . r a . set zero ( ) ; vcp . r b . set zero ( ) ; vcp . normal mass = 0 ; vcp . tangent mass = 0 ; vcp . velocity bias = 0 ; pc . local points [ j ] . x = cp . local point . x ; pc . local points [ j ] . y = cp . local point . y ; } } } <SENTENCE_END/>

(Copy Probability: 5.9%)

<SENTENCE_START> { m step = def . step ; m count = def . count ; if ( m position constraints . length < m count ) { contact position constraint [ ] old = m position constraints ; m position constraints = new contact position constraint [ math utils . max ( old . length * 2 , m count ) ] ; system . arraycopy ( old , 0 , m position constraints , 0 , old . length ) ; for ( int i = old . length ; i < m position constraints . length ; i ++ ) { m position constraints [ i ] = new contact position constraint ( ) ; } } if ( m velocity constraints . length < m count ) { contact velocity constraint [ ] old = m velocity constraints ; m velocity constraints = new contact velocity constraint [ math utils . max ( old . length * 2 , m count ) ] ; system . arraycopy ( old , 0 , m velocity constraints , 0 , old . length ) ; for ( int i = old . length ; i < m velocity constraints . length ; i ++ ) { m velocity constraints [ i ] = new contact velocity constraint ( ) ; } } m positions = def . positions ; m velocities = def . velocities ; m contacts = def . contacts ; for ( int i = 0 ; i < m count ; ++ i ) { final contact contact = m contacts [ i ] ; final fixture fixture a = contact . m fixture a ; final fixture fixture b = contact . m fixture b ; final shape shape a = fixture a . get shape ( ) ; final shape shape b = fixture b . get shape ( ) ; final float radius a = shape a . m radius ; final float radius b = shape b . m radius ; final body body a = fixture a . get body ( ) ; final body body b = fixture b . get body ( ) ; final manifold manifold = contact . get manifold ( ) ; int point count = manifold . point count ; assert ( point count > 0 ) ; contact velocity constraint vc = m velocity constraints [ i ] ; vc . friction = contact . m friction ; vc . restitution = contact . m restitution ; vc . tangent speed = contact . m tangent speed ; vc . index a = body a . m island index ; vc . index b = body b . m island index ; vc . inv mass a = body a . m inv mass ; vc . inv mass b = body b . m inv mass ; vc . inv ia = body a . m inv i ; vc . inv ib = body b . m inv i ; vc . contact index = i ; vc . point count = point count ; vc . k . set zero ( ) ; vc . normal mass . set zero ( ) ; contact position constraint pc = m position constraints [ i ] ; pc . index a = body a . m island index ; pc . index b = body b . m island index ; pc . inv mass a = body a . m inv mass ; pc . inv mass b = body b . m inv mass ; pc . local center a . set ( body a . m sweep . local center ) ; pc . local center b . set ( body b . m sweep . local center ) ; pc . inv ia = body a . m inv i ; pc . inv ib = body b . m inv i ; pc . local normal . set ( manifold . local normal ) ; pc . local point . set ( manifold . local point ) ; pc . point count = point count ; pc . radius a = radius a ; pc . radius b = radius b ; pc . type = manifold . type ; for ( int j = 0 ; j < point count ; j ++ ) { manifold point cp = manifold . points [ j ] ; velocity constraint point vcp = vc . points [ j ] ; if ( m step . warm starting ) { vcp . normal impulse = m step . dt ratio * cp . normal impulse ; vcp . tangent impulse = m step . dt ratio * cp . tangent impulse ; } else { vcp . normal impulse = 0 ; vcp . tangent impulse = 0 ; } vcp . r a . set zero ( ) ; vcp . r b . set zero ( ) ; vcp . normal mass = 0 ; vcp . tangent mass = 0 ; vcp . velocity bias = 0 ; pc . local points [ j ] . x = cp . local point . x ; pc . local points [ j ] . y = cp . local point . y ; } } } <SENTENCE_END/>

%END%

<SENTENCE_START> { m step = def . step ; m count = def . count ; if ( m position constraints . length < m count ) { contact position constraint [ ] old = m position constraints ; m position constraints = new contact position constraint [ math utils . max ( old . length * 2 , m count ) ] ; system . arraycopy ( old , 0 , m position constraints , 0 , old . length ) ; for ( int i = old . length ; i < m position constraints . length ; i ++ ) { m position constraints [ i ] = new contact position constraint ( ) ; } } if ( m velocity constraints . length < m count ) { contact velocity constraint [ ] old = m velocity constraints ; m velocity constraints = new contact velocity constraint [ math utils . max ( old . length * 2 , m count ) ] ; system . arraycopy ( old , 0 , m velocity constraints , 0 , old . length ) ; for ( int i = old . length ; i < m velocity constraints . length ; i ++ ) { m velocity constraints [ i ] = new contact velocity constraint ( ) ; } } m positions = def . positions ; m velocities = def . velocities ; m contacts = def . contacts ; for ( int i = 0 ; i < m count ; ++ i ) { final contact contact = m contacts [ i ] ; final fixture fixture a = contact . m fixture a ; final fixture fixture b = contact . m fixture b ; final shape shape a = fixture a . get shape ( ) ; final shape shape b = fixture b . get shape ( ) ; final float radius a = shape a . m radius ; final float radius b = shape b . m radius ; final body body a = fixture a . get body ( ) ; final body body b = fixture b . get body ( ) ; final manifold manifold = contact . get manifold ( ) ; int point count = manifold . point count ; assert ( point count > 0 ) ; contact velocity constraint vc = m velocity constraints [ i ] ; vc . friction = contact . m friction ; vc . restitution = contact . m restitution ; vc . tangent speed = contact . m tangent speed ; vc . index a = body a . m island index ; vc . index b = body b . m island index ; vc . inv mass a = body a . m inv mass ; vc . inv mass b = body b . m inv mass ; vc . inv ia = body a . m inv i ; vc . inv ib = body b . m inv i ; vc . contact index = i ; vc . point count = point count ; vc . k . set zero ( ) ; vc . normal mass . set zero ( ) ; contact position constraint pc = m position constraints [ i ] ; pc . index a = body a . m island index ; pc . index b = body b . m island index ; pc . inv mass a = body a . m inv mass ; pc . inv mass b = body b . m inv mass ; pc . local center a . set ( body a . m sweep . local center ) ; pc . local center b . set ( body b . m sweep . local center ) ; pc . inv ia = body a . m inv i ; pc . inv ib = body b . m inv i ; pc . local normal . set ( manifold . local normal ) ; pc . local point . set ( manifold . local point ) ; pc . point count = point count ; pc . radius a = radius a ; pc . radius b = radius b ; pc . type = manifold . type ; for ( int j = 0 ; j < point count ; j ++ ) { manifold point cp = manifold . points [ j ] ; velocity constraint point vcp = vc . points [ j ] ; if ( m step . warm starting ) { vcp . normal impulse = m step . dt ratio * cp . normal impulse ; vcp . tangent impulse = m step . dt ratio * cp . tangent impulse ; } else { vcp . normal impulse = 0 ; vcp . tangent impulse = 0 ; } vcp . r a . set zero ( ) ; vcp . r b . set zero ( ) ; vcp . normal mass = 0 ; vcp . tangent mass = 0 ; vcp . velocity bias = 0 ; pc . local points [ j ] . x = cp . local point . x ; pc . local points [ j ] . y = cp . local point . y ; } } } <SENTENCE_END/>

(Copy Probability: 11.1%)

<SENTENCE_START> { m step = def . step ; m count = def . count ; if ( m position constraints . length < m count ) { contact position constraint [ ] old = m position constraints ; m position constraints = new contact position constraint [ math utils . max ( old . length * 2 , m count ) ] ; system . arraycopy ( old , 0 , m position constraints , 0 , old . length ) ; for ( int i = old . length ; i < m position constraints . length ; i ++ ) { m position constraints [ i ] = new contact position constraint ( ) ; } } if ( m velocity constraints . length < m count ) { contact velocity constraint [ ] old = m velocity constraints ; m velocity constraints = new contact velocity constraint [ math utils . max ( old . length * 2 , m count ) ] ; system . arraycopy ( old , 0 , m velocity constraints , 0 , old . length ) ; for ( int i = old . length ; i < m velocity constraints . length ; i ++ ) { m velocity constraints [ i ] = new contact velocity constraint ( ) ; } } m positions = def . positions ; m velocities = def . velocities ; m contacts = def . contacts ; for ( int i = 0 ; i < m count ; ++ i ) { final contact contact = m contacts [ i ] ; final fixture fixture a = contact . m fixture a ; final fixture fixture b = contact . m fixture b ; final shape shape a = fixture a . get shape ( ) ; final shape shape b = fixture b . get shape ( ) ; final float radius a = shape a . m radius ; final float radius b = shape b . m radius ; final body body a = fixture a . get body ( ) ; final body body b = fixture b . get body ( ) ; final manifold manifold = contact . get manifold ( ) ; int point count = manifold . point count ; assert ( point count > 0 ) ; contact velocity constraint vc = m velocity constraints [ i ] ; vc . friction = contact . m friction ; vc . restitution = contact . m restitution ; vc . tangent speed = contact . m tangent speed ; vc . index a = body a . m island index ; vc . index b = body b . m island index ; vc . inv mass a = body a . m inv mass ; vc . inv mass b = body b . m inv mass ; vc . inv ia = body a . m inv i ; vc . inv ib = body b . m inv i ; vc . contact index = i ; vc . point count = point count ; vc . k . set zero ( ) ; vc . normal mass . set zero ( ) ; contact position constraint pc = m position constraints [ i ] ; pc . index a = body a . m island index ; pc . index b = body b . m island index ; pc . inv mass a = body a . m inv mass ; pc . inv mass b = body b . m inv mass ; pc . local center a . set ( body a . m sweep . local center ) ; pc . local center b . set ( body b . m sweep . local center ) ; pc . inv ia = body a . m inv i ; pc . inv ib = body b . m inv i ; pc . local normal . set ( manifold . local normal ) ; pc . local point . set ( manifold . local point ) ; pc . point count = point count ; pc . radius a = radius a ; pc . radius b = radius b ; pc . type = manifold . type ; for ( int j = 0 ; j < point count ; j ++ ) { manifold point cp = manifold . points [ j ] ; velocity constraint point vcp = vc . points [ j ] ; if ( m step . warm starting ) { vcp . normal impulse = m step . dt ratio * cp . normal impulse ; vcp . tangent impulse = m step . dt ratio * cp . tangent impulse ; } else { vcp . normal impulse = 0 ; vcp . tangent impulse = 0 ; } vcp . r a . set zero ( ) ; vcp . r b . set zero ( ) ; vcp . normal mass = 0 ; vcp . tangent mass = 0 ; vcp . velocity bias = 0 ; pc . local points [ j ] . x = cp . local point . x ; pc . local points [ j ] . y = cp . local point . y ; } } } <SENTENCE_END/>


Original Name warm,start

warm

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { final contact velocity constraint vc = m velocity constraints [ i ] ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float i a = vc . inv ia ; float m b = vc . inv mass b ; float i b = vc . inv ib ; int point count = vc . point count ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; vec 2 normal = vc . normal ; float tangentx = 1.0f * normal . y ; float tangenty = - 1.0f * normal . x ; for ( int j = 0 ; j < point count ; ++ j ) { velocity constraint point vcp = vc . points [ j ] ; float px = tangentx * vcp . tangent impulse + normal . x * vcp . normal impulse ; float py = tangenty * vcp . tangent impulse + normal . y * vcp . normal impulse ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v a . x -= px * m a ; v a . y -= py * m a ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; } m velocities [ index a ] . w = w a ; m velocities [ index b ] . w = w b ; } } <SENTENCE_END/>

(Copy Probability: 3.9%)

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { final contact velocity constraint vc = m velocity constraints [ i ] ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float i a = vc . inv ia ; float m b = vc . inv mass b ; float i b = vc . inv ib ; int point count = vc . point count ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; vec 2 normal = vc . normal ; float tangentx = 1.0f * normal . y ; float tangenty = - 1.0f * normal . x ; for ( int j = 0 ; j < point count ; ++ j ) { velocity constraint point vcp = vc . points [ j ] ; float px = tangentx * vcp . tangent impulse + normal . x * vcp . normal impulse ; float py = tangenty * vcp . tangent impulse + normal . y * vcp . normal impulse ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v a . x -= px * m a ; v a . y -= py * m a ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; } m velocities [ index a ] . w = w a ; m velocities [ index b ] . w = w b ; } } <SENTENCE_END/>

start

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { final contact velocity constraint vc = m velocity constraints [ i ] ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float i a = vc . inv ia ; float m b = vc . inv mass b ; float i b = vc . inv ib ; int point count = vc . point count ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; vec 2 normal = vc . normal ; float tangentx = 1.0f * normal . y ; float tangenty = - 1.0f * normal . x ; for ( int j = 0 ; j < point count ; ++ j ) { velocity constraint point vcp = vc . points [ j ] ; float px = tangentx * vcp . tangent impulse + normal . x * vcp . normal impulse ; float py = tangenty * vcp . tangent impulse + normal . y * vcp . normal impulse ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v a . x -= px * m a ; v a . y -= py * m a ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; } m velocities [ index a ] . w = w a ; m velocities [ index b ] . w = w b ; } } <SENTENCE_END/>

(Copy Probability: 6.3%)

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { final contact velocity constraint vc = m velocity constraints [ i ] ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float i a = vc . inv ia ; float m b = vc . inv mass b ; float i b = vc . inv ib ; int point count = vc . point count ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; vec 2 normal = vc . normal ; float tangentx = 1.0f * normal . y ; float tangenty = - 1.0f * normal . x ; for ( int j = 0 ; j < point count ; ++ j ) { velocity constraint point vcp = vc . points [ j ] ; float px = tangentx * vcp . tangent impulse + normal . x * vcp . normal impulse ; float py = tangenty * vcp . tangent impulse + normal . y * vcp . normal impulse ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v a . x -= px * m a ; v a . y -= py * m a ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; } m velocities [ index a ] . w = w a ; m velocities [ index b ] . w = w b ; } } <SENTENCE_END/>

%END%

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { final contact velocity constraint vc = m velocity constraints [ i ] ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float i a = vc . inv ia ; float m b = vc . inv mass b ; float i b = vc . inv ib ; int point count = vc . point count ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; vec 2 normal = vc . normal ; float tangentx = 1.0f * normal . y ; float tangenty = - 1.0f * normal . x ; for ( int j = 0 ; j < point count ; ++ j ) { velocity constraint point vcp = vc . points [ j ] ; float px = tangentx * vcp . tangent impulse + normal . x * vcp . normal impulse ; float py = tangenty * vcp . tangent impulse + normal . y * vcp . normal impulse ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v a . x -= px * m a ; v a . y -= py * m a ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; } m velocities [ index a ] . w = w a ; m velocities [ index b ] . w = w b ; } } <SENTENCE_END/>

(Copy Probability: 6.2%)

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { final contact velocity constraint vc = m velocity constraints [ i ] ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float i a = vc . inv ia ; float m b = vc . inv mass b ; float i b = vc . inv ib ; int point count = vc . point count ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; vec 2 normal = vc . normal ; float tangentx = 1.0f * normal . y ; float tangenty = - 1.0f * normal . x ; for ( int j = 0 ; j < point count ; ++ j ) { velocity constraint point vcp = vc . points [ j ] ; float px = tangentx * vcp . tangent impulse + normal . x * vcp . normal impulse ; float py = tangenty * vcp . tangent impulse + normal . y * vcp . normal impulse ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v a . x -= px * m a ; v a . y -= py * m a ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; } m velocities [ index a ] . w = w a ; m velocities [ index b ] . w = w b ; } } <SENTENCE_END/>


Original Name initialize,velocity,constraints

initialize

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { contact velocity constraint vc = m velocity constraints [ i ] ; contact position constraint pc = m position constraints [ i ] ; float radius a = pc . radius a ; float radius b = pc . radius b ; manifold manifold = m contacts [ vc . contact index ] . get manifold ( ) ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; vec 2 local center a = pc . local center a ; vec 2 local center b = pc . local center b ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; assert ( manifold . point count > 0 ) ; final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - ( xf aq . c * local center a . x - xf aq . s * local center a . y ) ; xf a . p . y = c a . y - ( xf aq . s * local center a . x + xf aq . c * local center a . y ) ; xf b . p . x = c b . x - ( xf bq . c * local center b . x - xf bq . s * local center b . y ) ; xf b . p . y = c b . y - ( xf bq . s * local center b . x + xf bq . c * local center b . y ) ; world manifold . initialize ( manifold , xf a , radius a , xf b , radius b ) ; final vec 2 vcnormal = vc . normal ; vcnormal . x = world manifold . normal . x ; vcnormal . y = world manifold . normal . y ; int point count = vc . point count ; for ( int j = 0 ; j < point count ; ++ j ) { velocity constraint point vcp = vc . points [ j ] ; vec 2 wm pj = world manifold . points [ j ] ; final vec 2 vcpr a = vcp . r a ; final vec 2 vcpr b = vcp . r b ; vcpr a . x = wm pj . x - c a . x ; vcpr a . y = wm pj . y - c a . y ; vcpr b . x = wm pj . x - c b . x ; vcpr b . y = wm pj . y - c b . y ; float rn a = vcpr a . x * vcnormal . y - vcpr a . y * vcnormal . x ; float rn b = vcpr b . x * vcnormal . y - vcpr b . y * vcnormal . x ; float k normal = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; vcp . normal mass = k normal > 0.0f ? 1.0f / k normal : 0.0f ; float tangentx = 1.0f * vcnormal . y ; float tangenty = - 1.0f * vcnormal . x ; float rt a = vcpr a . x * tangenty - vcpr a . y * tangentx ; float rt b = vcpr b . x * tangenty - vcpr b . y * tangentx ; float k tangent = m a + m b + i a * rt a * rt a + i b * rt b * rt b ; vcp . tangent mass = k tangent > 0.0f ? 1.0f / k tangent : 0.0f ; vcp . velocity bias = 0.0f ; float tempx = v b . x + - w b * vcpr b . y - v a . x - ( - w a * vcpr a . y ) ; float tempy = v b . y + w b * vcpr b . x - v a . y - ( w a * vcpr a . x ) ; float v rel = vcnormal . x * tempx + vcnormal . y * tempy ; if ( v rel < - settings . velocity threshold ) { vcp . velocity bias = - vc . restitution * v rel ; } } if ( vc . point count == 2 ) { velocity constraint point vcp 1 = vc . points [ 0 ] ; velocity constraint point vcp 2 = vc . points [ 1 ] ; float rn 1 a = vcp 1 . r a . x * vcnormal . y - vcp 1 . r a . y * vcnormal . x ; float rn 1 b = vcp 1 . r b . x * vcnormal . y - vcp 1 . r b . y * vcnormal . x ; float rn 2 a = vcp 2 . r a . x * vcnormal . y - vcp 2 . r a . y * vcnormal . x ; float rn 2 b = vcp 2 . r b . x * vcnormal . y - vcp 2 . r b . y * vcnormal . x ; float k 11 = m a + m b + i a * rn 1 a * rn 1 a + i b * rn 1 b * rn 1 b ; float k 22 = m a + m b + i a * rn 2 a * rn 2 a + i b * rn 2 b * rn 2 b ; float k 12 = m a + m b + i a * rn 1 a * rn 2 a + i b * rn 1 b * rn 2 b ; if ( k 11 * k 11 < k max condition number * ( k 11 * k 22 - k 12 * k 12 ) ) { vc . k . ex . x = k 11 ; vc . k . ex . y = k 12 ; vc . k . ey . x = k 12 ; vc . k . ey . y = k 22 ; vc . k . invert to out ( vc . normal mass ) ; } else { vc . point count = 1 ; } } } } <SENTENCE_END/>

(Copy Probability: 3.2%)

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { contact velocity constraint vc = m velocity constraints [ i ] ; contact position constraint pc = m position constraints [ i ] ; float radius a = pc . radius a ; float radius b = pc . radius b ; manifold manifold = m contacts [ vc . contact index ] . get manifold ( ) ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; vec 2 local center a = pc . local center a ; vec 2 local center b = pc . local center b ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; assert ( manifold . point count > 0 ) ; final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - ( xf aq . c * local center a . x - xf aq . s * local center a . y ) ; xf a . p . y = c a . y - ( xf aq . s * local center a . x + xf aq . c * local center a . y ) ; xf b . p . x = c b . x - ( xf bq . c * local center b . x - xf bq . s * local center b . y ) ; xf b . p . y = c b . y - ( xf bq . s * local center b . x + xf bq . c * local center b . y ) ; world manifold . initialize ( manifold , xf a , radius a , xf b , radius b ) ; final vec 2 vcnormal = vc . normal ; vcnormal . x = world manifold . normal . x ; vcnormal . y = world manifold . normal . y ; int point count = vc . point count ; for ( int j = 0 ; j < point count ; ++ j ) { velocity constraint point vcp = vc . points [ j ] ; vec 2 wm pj = world manifold . points [ j ] ; final vec 2 vcpr a = vcp . r a ; final vec 2 vcpr b = vcp . r b ; vcpr a . x = wm pj . x - c a . x ; vcpr a . y = wm pj . y - c a . y ; vcpr b . x = wm pj . x - c b . x ; vcpr b . y = wm pj . y - c b . y ; float rn a = vcpr a . x * vcnormal . y - vcpr a . y * vcnormal . x ; float rn b = vcpr b . x * vcnormal . y - vcpr b . y * vcnormal . x ; float k normal = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; vcp . normal mass = k normal > 0.0f ? 1.0f / k normal : 0.0f ; float tangentx = 1.0f * vcnormal . y ; float tangenty = - 1.0f * vcnormal . x ; float rt a = vcpr a . x * tangenty - vcpr a . y * tangentx ; float rt b = vcpr b . x * tangenty - vcpr b . y * tangentx ; float k tangent = m a + m b + i a * rt a * rt a + i b * rt b * rt b ; vcp . tangent mass = k tangent > 0.0f ? 1.0f / k tangent : 0.0f ; vcp . velocity bias = 0.0f ; float tempx = v b . x + - w b * vcpr b . y - v a . x - ( - w a * vcpr a . y ) ; float tempy = v b . y + w b * vcpr b . x - v a . y - ( w a * vcpr a . x ) ; float v rel = vcnormal . x * tempx + vcnormal . y * tempy ; if ( v rel < - settings . velocity threshold ) { vcp . velocity bias = - vc . restitution * v rel ; } } if ( vc . point count == 2 ) { velocity constraint point vcp 1 = vc . points [ 0 ] ; velocity constraint point vcp 2 = vc . points [ 1 ] ; float rn 1 a = vcp 1 . r a . x * vcnormal . y - vcp 1 . r a . y * vcnormal . x ; float rn 1 b = vcp 1 . r b . x * vcnormal . y - vcp 1 . r b . y * vcnormal . x ; float rn 2 a = vcp 2 . r a . x * vcnormal . y - vcp 2 . r a . y * vcnormal . x ; float rn 2 b = vcp 2 . r b . x * vcnormal . y - vcp 2 . r b . y * vcnormal . x ; float k 11 = m a + m b + i a * rn 1 a * rn 1 a + i b * rn 1 b * rn 1 b ; float k 22 = m a + m b + i a * rn 2 a * rn 2 a + i b * rn 2 b * rn 2 b ; float k 12 = m a + m b + i a * rn 1 a * rn 2 a + i b * rn 1 b * rn 2 b ; if ( k 11 * k 11 < k max condition number * ( k 11 * k 22 - k 12 * k 12 ) ) { vc . k . ex . x = k 11 ; vc . k . ex . y = k 12 ; vc . k . ey . x = k 12 ; vc . k . ey . y = k 22 ; vc . k . invert to out ( vc . normal mass ) ; } else { vc . point count = 1 ; } } } } <SENTENCE_END/>

velocity

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { contact velocity constraint vc = m velocity constraints [ i ] ; contact position constraint pc = m position constraints [ i ] ; float radius a = pc . radius a ; float radius b = pc . radius b ; manifold manifold = m contacts [ vc . contact index ] . get manifold ( ) ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; vec 2 local center a = pc . local center a ; vec 2 local center b = pc . local center b ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; assert ( manifold . point count > 0 ) ; final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - ( xf aq . c * local center a . x - xf aq . s * local center a . y ) ; xf a . p . y = c a . y - ( xf aq . s * local center a . x + xf aq . c * local center a . y ) ; xf b . p . x = c b . x - ( xf bq . c * local center b . x - xf bq . s * local center b . y ) ; xf b . p . y = c b . y - ( xf bq . s * local center b . x + xf bq . c * local center b . y ) ; world manifold . initialize ( manifold , xf a , radius a , xf b , radius b ) ; final vec 2 vcnormal = vc . normal ; vcnormal . x = world manifold . normal . x ; vcnormal . y = world manifold . normal . y ; int point count = vc . point count ; for ( int j = 0 ; j < point count ; ++ j ) { velocity constraint point vcp = vc . points [ j ] ; vec 2 wm pj = world manifold . points [ j ] ; final vec 2 vcpr a = vcp . r a ; final vec 2 vcpr b = vcp . r b ; vcpr a . x = wm pj . x - c a . x ; vcpr a . y = wm pj . y - c a . y ; vcpr b . x = wm pj . x - c b . x ; vcpr b . y = wm pj . y - c b . y ; float rn a = vcpr a . x * vcnormal . y - vcpr a . y * vcnormal . x ; float rn b = vcpr b . x * vcnormal . y - vcpr b . y * vcnormal . x ; float k normal = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; vcp . normal mass = k normal > 0.0f ? 1.0f / k normal : 0.0f ; float tangentx = 1.0f * vcnormal . y ; float tangenty = - 1.0f * vcnormal . x ; float rt a = vcpr a . x * tangenty - vcpr a . y * tangentx ; float rt b = vcpr b . x * tangenty - vcpr b . y * tangentx ; float k tangent = m a + m b + i a * rt a * rt a + i b * rt b * rt b ; vcp . tangent mass = k tangent > 0.0f ? 1.0f / k tangent : 0.0f ; vcp . velocity bias = 0.0f ; float tempx = v b . x + - w b * vcpr b . y - v a . x - ( - w a * vcpr a . y ) ; float tempy = v b . y + w b * vcpr b . x - v a . y - ( w a * vcpr a . x ) ; float v rel = vcnormal . x * tempx + vcnormal . y * tempy ; if ( v rel < - settings . velocity threshold ) { vcp . velocity bias = - vc . restitution * v rel ; } } if ( vc . point count == 2 ) { velocity constraint point vcp 1 = vc . points [ 0 ] ; velocity constraint point vcp 2 = vc . points [ 1 ] ; float rn 1 a = vcp 1 . r a . x * vcnormal . y - vcp 1 . r a . y * vcnormal . x ; float rn 1 b = vcp 1 . r b . x * vcnormal . y - vcp 1 . r b . y * vcnormal . x ; float rn 2 a = vcp 2 . r a . x * vcnormal . y - vcp 2 . r a . y * vcnormal . x ; float rn 2 b = vcp 2 . r b . x * vcnormal . y - vcp 2 . r b . y * vcnormal . x ; float k 11 = m a + m b + i a * rn 1 a * rn 1 a + i b * rn 1 b * rn 1 b ; float k 22 = m a + m b + i a * rn 2 a * rn 2 a + i b * rn 2 b * rn 2 b ; float k 12 = m a + m b + i a * rn 1 a * rn 2 a + i b * rn 1 b * rn 2 b ; if ( k 11 * k 11 < k max condition number * ( k 11 * k 22 - k 12 * k 12 ) ) { vc . k . ex . x = k 11 ; vc . k . ex . y = k 12 ; vc . k . ey . x = k 12 ; vc . k . ey . y = k 22 ; vc . k . invert to out ( vc . normal mass ) ; } else { vc . point count = 1 ; } } } } <SENTENCE_END/>

(Copy Probability: 6.5%)

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { contact velocity constraint vc = m velocity constraints [ i ] ; contact position constraint pc = m position constraints [ i ] ; float radius a = pc . radius a ; float radius b = pc . radius b ; manifold manifold = m contacts [ vc . contact index ] . get manifold ( ) ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; vec 2 local center a = pc . local center a ; vec 2 local center b = pc . local center b ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; assert ( manifold . point count > 0 ) ; final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - ( xf aq . c * local center a . x - xf aq . s * local center a . y ) ; xf a . p . y = c a . y - ( xf aq . s * local center a . x + xf aq . c * local center a . y ) ; xf b . p . x = c b . x - ( xf bq . c * local center b . x - xf bq . s * local center b . y ) ; xf b . p . y = c b . y - ( xf bq . s * local center b . x + xf bq . c * local center b . y ) ; world manifold . initialize ( manifold , xf a , radius a , xf b , radius b ) ; final vec 2 vcnormal = vc . normal ; vcnormal . x = world manifold . normal . x ; vcnormal . y = world manifold . normal . y ; int point count = vc . point count ; for ( int j = 0 ; j < point count ; ++ j ) { velocity constraint point vcp = vc . points [ j ] ; vec 2 wm pj = world manifold . points [ j ] ; final vec 2 vcpr a = vcp . r a ; final vec 2 vcpr b = vcp . r b ; vcpr a . x = wm pj . x - c a . x ; vcpr a . y = wm pj . y - c a . y ; vcpr b . x = wm pj . x - c b . x ; vcpr b . y = wm pj . y - c b . y ; float rn a = vcpr a . x * vcnormal . y - vcpr a . y * vcnormal . x ; float rn b = vcpr b . x * vcnormal . y - vcpr b . y * vcnormal . x ; float k normal = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; vcp . normal mass = k normal > 0.0f ? 1.0f / k normal : 0.0f ; float tangentx = 1.0f * vcnormal . y ; float tangenty = - 1.0f * vcnormal . x ; float rt a = vcpr a . x * tangenty - vcpr a . y * tangentx ; float rt b = vcpr b . x * tangenty - vcpr b . y * tangentx ; float k tangent = m a + m b + i a * rt a * rt a + i b * rt b * rt b ; vcp . tangent mass = k tangent > 0.0f ? 1.0f / k tangent : 0.0f ; vcp . velocity bias = 0.0f ; float tempx = v b . x + - w b * vcpr b . y - v a . x - ( - w a * vcpr a . y ) ; float tempy = v b . y + w b * vcpr b . x - v a . y - ( w a * vcpr a . x ) ; float v rel = vcnormal . x * tempx + vcnormal . y * tempy ; if ( v rel < - settings . velocity threshold ) { vcp . velocity bias = - vc . restitution * v rel ; } } if ( vc . point count == 2 ) { velocity constraint point vcp 1 = vc . points [ 0 ] ; velocity constraint point vcp 2 = vc . points [ 1 ] ; float rn 1 a = vcp 1 . r a . x * vcnormal . y - vcp 1 . r a . y * vcnormal . x ; float rn 1 b = vcp 1 . r b . x * vcnormal . y - vcp 1 . r b . y * vcnormal . x ; float rn 2 a = vcp 2 . r a . x * vcnormal . y - vcp 2 . r a . y * vcnormal . x ; float rn 2 b = vcp 2 . r b . x * vcnormal . y - vcp 2 . r b . y * vcnormal . x ; float k 11 = m a + m b + i a * rn 1 a * rn 1 a + i b * rn 1 b * rn 1 b ; float k 22 = m a + m b + i a * rn 2 a * rn 2 a + i b * rn 2 b * rn 2 b ; float k 12 = m a + m b + i a * rn 1 a * rn 2 a + i b * rn 1 b * rn 2 b ; if ( k 11 * k 11 < k max condition number * ( k 11 * k 22 - k 12 * k 12 ) ) { vc . k . ex . x = k 11 ; vc . k . ex . y = k 12 ; vc . k . ey . x = k 12 ; vc . k . ey . y = k 22 ; vc . k . invert to out ( vc . normal mass ) ; } else { vc . point count = 1 ; } } } } <SENTENCE_END/>

constraints

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { contact velocity constraint vc = m velocity constraints [ i ] ; contact position constraint pc = m position constraints [ i ] ; float radius a = pc . radius a ; float radius b = pc . radius b ; manifold manifold = m contacts [ vc . contact index ] . get manifold ( ) ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; vec 2 local center a = pc . local center a ; vec 2 local center b = pc . local center b ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; assert ( manifold . point count > 0 ) ; final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - ( xf aq . c * local center a . x - xf aq . s * local center a . y ) ; xf a . p . y = c a . y - ( xf aq . s * local center a . x + xf aq . c * local center a . y ) ; xf b . p . x = c b . x - ( xf bq . c * local center b . x - xf bq . s * local center b . y ) ; xf b . p . y = c b . y - ( xf bq . s * local center b . x + xf bq . c * local center b . y ) ; world manifold . initialize ( manifold , xf a , radius a , xf b , radius b ) ; final vec 2 vcnormal = vc . normal ; vcnormal . x = world manifold . normal . x ; vcnormal . y = world manifold . normal . y ; int point count = vc . point count ; for ( int j = 0 ; j < point count ; ++ j ) { velocity constraint point vcp = vc . points [ j ] ; vec 2 wm pj = world manifold . points [ j ] ; final vec 2 vcpr a = vcp . r a ; final vec 2 vcpr b = vcp . r b ; vcpr a . x = wm pj . x - c a . x ; vcpr a . y = wm pj . y - c a . y ; vcpr b . x = wm pj . x - c b . x ; vcpr b . y = wm pj . y - c b . y ; float rn a = vcpr a . x * vcnormal . y - vcpr a . y * vcnormal . x ; float rn b = vcpr b . x * vcnormal . y - vcpr b . y * vcnormal . x ; float k normal = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; vcp . normal mass = k normal > 0.0f ? 1.0f / k normal : 0.0f ; float tangentx = 1.0f * vcnormal . y ; float tangenty = - 1.0f * vcnormal . x ; float rt a = vcpr a . x * tangenty - vcpr a . y * tangentx ; float rt b = vcpr b . x * tangenty - vcpr b . y * tangentx ; float k tangent = m a + m b + i a * rt a * rt a + i b * rt b * rt b ; vcp . tangent mass = k tangent > 0.0f ? 1.0f / k tangent : 0.0f ; vcp . velocity bias = 0.0f ; float tempx = v b . x + - w b * vcpr b . y - v a . x - ( - w a * vcpr a . y ) ; float tempy = v b . y + w b * vcpr b . x - v a . y - ( w a * vcpr a . x ) ; float v rel = vcnormal . x * tempx + vcnormal . y * tempy ; if ( v rel < - settings . velocity threshold ) { vcp . velocity bias = - vc . restitution * v rel ; } } if ( vc . point count == 2 ) { velocity constraint point vcp 1 = vc . points [ 0 ] ; velocity constraint point vcp 2 = vc . points [ 1 ] ; float rn 1 a = vcp 1 . r a . x * vcnormal . y - vcp 1 . r a . y * vcnormal . x ; float rn 1 b = vcp 1 . r b . x * vcnormal . y - vcp 1 . r b . y * vcnormal . x ; float rn 2 a = vcp 2 . r a . x * vcnormal . y - vcp 2 . r a . y * vcnormal . x ; float rn 2 b = vcp 2 . r b . x * vcnormal . y - vcp 2 . r b . y * vcnormal . x ; float k 11 = m a + m b + i a * rn 1 a * rn 1 a + i b * rn 1 b * rn 1 b ; float k 22 = m a + m b + i a * rn 2 a * rn 2 a + i b * rn 2 b * rn 2 b ; float k 12 = m a + m b + i a * rn 1 a * rn 2 a + i b * rn 1 b * rn 2 b ; if ( k 11 * k 11 < k max condition number * ( k 11 * k 22 - k 12 * k 12 ) ) { vc . k . ex . x = k 11 ; vc . k . ex . y = k 12 ; vc . k . ey . x = k 12 ; vc . k . ey . y = k 22 ; vc . k . invert to out ( vc . normal mass ) ; } else { vc . point count = 1 ; } } } } <SENTENCE_END/>

(Copy Probability: 7.8%)

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { contact velocity constraint vc = m velocity constraints [ i ] ; contact position constraint pc = m position constraints [ i ] ; float radius a = pc . radius a ; float radius b = pc . radius b ; manifold manifold = m contacts [ vc . contact index ] . get manifold ( ) ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; vec 2 local center a = pc . local center a ; vec 2 local center b = pc . local center b ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; assert ( manifold . point count > 0 ) ; final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - ( xf aq . c * local center a . x - xf aq . s * local center a . y ) ; xf a . p . y = c a . y - ( xf aq . s * local center a . x + xf aq . c * local center a . y ) ; xf b . p . x = c b . x - ( xf bq . c * local center b . x - xf bq . s * local center b . y ) ; xf b . p . y = c b . y - ( xf bq . s * local center b . x + xf bq . c * local center b . y ) ; world manifold . initialize ( manifold , xf a , radius a , xf b , radius b ) ; final vec 2 vcnormal = vc . normal ; vcnormal . x = world manifold . normal . x ; vcnormal . y = world manifold . normal . y ; int point count = vc . point count ; for ( int j = 0 ; j < point count ; ++ j ) { velocity constraint point vcp = vc . points [ j ] ; vec 2 wm pj = world manifold . points [ j ] ; final vec 2 vcpr a = vcp . r a ; final vec 2 vcpr b = vcp . r b ; vcpr a . x = wm pj . x - c a . x ; vcpr a . y = wm pj . y - c a . y ; vcpr b . x = wm pj . x - c b . x ; vcpr b . y = wm pj . y - c b . y ; float rn a = vcpr a . x * vcnormal . y - vcpr a . y * vcnormal . x ; float rn b = vcpr b . x * vcnormal . y - vcpr b . y * vcnormal . x ; float k normal = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; vcp . normal mass = k normal > 0.0f ? 1.0f / k normal : 0.0f ; float tangentx = 1.0f * vcnormal . y ; float tangenty = - 1.0f * vcnormal . x ; float rt a = vcpr a . x * tangenty - vcpr a . y * tangentx ; float rt b = vcpr b . x * tangenty - vcpr b . y * tangentx ; float k tangent = m a + m b + i a * rt a * rt a + i b * rt b * rt b ; vcp . tangent mass = k tangent > 0.0f ? 1.0f / k tangent : 0.0f ; vcp . velocity bias = 0.0f ; float tempx = v b . x + - w b * vcpr b . y - v a . x - ( - w a * vcpr a . y ) ; float tempy = v b . y + w b * vcpr b . x - v a . y - ( w a * vcpr a . x ) ; float v rel = vcnormal . x * tempx + vcnormal . y * tempy ; if ( v rel < - settings . velocity threshold ) { vcp . velocity bias = - vc . restitution * v rel ; } } if ( vc . point count == 2 ) { velocity constraint point vcp 1 = vc . points [ 0 ] ; velocity constraint point vcp 2 = vc . points [ 1 ] ; float rn 1 a = vcp 1 . r a . x * vcnormal . y - vcp 1 . r a . y * vcnormal . x ; float rn 1 b = vcp 1 . r b . x * vcnormal . y - vcp 1 . r b . y * vcnormal . x ; float rn 2 a = vcp 2 . r a . x * vcnormal . y - vcp 2 . r a . y * vcnormal . x ; float rn 2 b = vcp 2 . r b . x * vcnormal . y - vcp 2 . r b . y * vcnormal . x ; float k 11 = m a + m b + i a * rn 1 a * rn 1 a + i b * rn 1 b * rn 1 b ; float k 22 = m a + m b + i a * rn 2 a * rn 2 a + i b * rn 2 b * rn 2 b ; float k 12 = m a + m b + i a * rn 1 a * rn 2 a + i b * rn 1 b * rn 2 b ; if ( k 11 * k 11 < k max condition number * ( k 11 * k 22 - k 12 * k 12 ) ) { vc . k . ex . x = k 11 ; vc . k . ex . y = k 12 ; vc . k . ey . x = k 12 ; vc . k . ey . y = k 22 ; vc . k . invert to out ( vc . normal mass ) ; } else { vc . point count = 1 ; } } } } <SENTENCE_END/>

%END%

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { contact velocity constraint vc = m velocity constraints [ i ] ; contact position constraint pc = m position constraints [ i ] ; float radius a = pc . radius a ; float radius b = pc . radius b ; manifold manifold = m contacts [ vc . contact index ] . get manifold ( ) ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; vec 2 local center a = pc . local center a ; vec 2 local center b = pc . local center b ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; assert ( manifold . point count > 0 ) ; final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - ( xf aq . c * local center a . x - xf aq . s * local center a . y ) ; xf a . p . y = c a . y - ( xf aq . s * local center a . x + xf aq . c * local center a . y ) ; xf b . p . x = c b . x - ( xf bq . c * local center b . x - xf bq . s * local center b . y ) ; xf b . p . y = c b . y - ( xf bq . s * local center b . x + xf bq . c * local center b . y ) ; world manifold . initialize ( manifold , xf a , radius a , xf b , radius b ) ; final vec 2 vcnormal = vc . normal ; vcnormal . x = world manifold . normal . x ; vcnormal . y = world manifold . normal . y ; int point count = vc . point count ; for ( int j = 0 ; j < point count ; ++ j ) { velocity constraint point vcp = vc . points [ j ] ; vec 2 wm pj = world manifold . points [ j ] ; final vec 2 vcpr a = vcp . r a ; final vec 2 vcpr b = vcp . r b ; vcpr a . x = wm pj . x - c a . x ; vcpr a . y = wm pj . y - c a . y ; vcpr b . x = wm pj . x - c b . x ; vcpr b . y = wm pj . y - c b . y ; float rn a = vcpr a . x * vcnormal . y - vcpr a . y * vcnormal . x ; float rn b = vcpr b . x * vcnormal . y - vcpr b . y * vcnormal . x ; float k normal = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; vcp . normal mass = k normal > 0.0f ? 1.0f / k normal : 0.0f ; float tangentx = 1.0f * vcnormal . y ; float tangenty = - 1.0f * vcnormal . x ; float rt a = vcpr a . x * tangenty - vcpr a . y * tangentx ; float rt b = vcpr b . x * tangenty - vcpr b . y * tangentx ; float k tangent = m a + m b + i a * rt a * rt a + i b * rt b * rt b ; vcp . tangent mass = k tangent > 0.0f ? 1.0f / k tangent : 0.0f ; vcp . velocity bias = 0.0f ; float tempx = v b . x + - w b * vcpr b . y - v a . x - ( - w a * vcpr a . y ) ; float tempy = v b . y + w b * vcpr b . x - v a . y - ( w a * vcpr a . x ) ; float v rel = vcnormal . x * tempx + vcnormal . y * tempy ; if ( v rel < - settings . velocity threshold ) { vcp . velocity bias = - vc . restitution * v rel ; } } if ( vc . point count == 2 ) { velocity constraint point vcp 1 = vc . points [ 0 ] ; velocity constraint point vcp 2 = vc . points [ 1 ] ; float rn 1 a = vcp 1 . r a . x * vcnormal . y - vcp 1 . r a . y * vcnormal . x ; float rn 1 b = vcp 1 . r b . x * vcnormal . y - vcp 1 . r b . y * vcnormal . x ; float rn 2 a = vcp 2 . r a . x * vcnormal . y - vcp 2 . r a . y * vcnormal . x ; float rn 2 b = vcp 2 . r b . x * vcnormal . y - vcp 2 . r b . y * vcnormal . x ; float k 11 = m a + m b + i a * rn 1 a * rn 1 a + i b * rn 1 b * rn 1 b ; float k 22 = m a + m b + i a * rn 2 a * rn 2 a + i b * rn 2 b * rn 2 b ; float k 12 = m a + m b + i a * rn 1 a * rn 2 a + i b * rn 1 b * rn 2 b ; if ( k 11 * k 11 < k max condition number * ( k 11 * k 22 - k 12 * k 12 ) ) { vc . k . ex . x = k 11 ; vc . k . ex . y = k 12 ; vc . k . ey . x = k 12 ; vc . k . ey . y = k 22 ; vc . k . invert to out ( vc . normal mass ) ; } else { vc . point count = 1 ; } } } } <SENTENCE_END/>

(Copy Probability: 5.2%)

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { contact velocity constraint vc = m velocity constraints [ i ] ; contact position constraint pc = m position constraints [ i ] ; float radius a = pc . radius a ; float radius b = pc . radius b ; manifold manifold = m contacts [ vc . contact index ] . get manifold ( ) ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; vec 2 local center a = pc . local center a ; vec 2 local center b = pc . local center b ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; assert ( manifold . point count > 0 ) ; final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - ( xf aq . c * local center a . x - xf aq . s * local center a . y ) ; xf a . p . y = c a . y - ( xf aq . s * local center a . x + xf aq . c * local center a . y ) ; xf b . p . x = c b . x - ( xf bq . c * local center b . x - xf bq . s * local center b . y ) ; xf b . p . y = c b . y - ( xf bq . s * local center b . x + xf bq . c * local center b . y ) ; world manifold . initialize ( manifold , xf a , radius a , xf b , radius b ) ; final vec 2 vcnormal = vc . normal ; vcnormal . x = world manifold . normal . x ; vcnormal . y = world manifold . normal . y ; int point count = vc . point count ; for ( int j = 0 ; j < point count ; ++ j ) { velocity constraint point vcp = vc . points [ j ] ; vec 2 wm pj = world manifold . points [ j ] ; final vec 2 vcpr a = vcp . r a ; final vec 2 vcpr b = vcp . r b ; vcpr a . x = wm pj . x - c a . x ; vcpr a . y = wm pj . y - c a . y ; vcpr b . x = wm pj . x - c b . x ; vcpr b . y = wm pj . y - c b . y ; float rn a = vcpr a . x * vcnormal . y - vcpr a . y * vcnormal . x ; float rn b = vcpr b . x * vcnormal . y - vcpr b . y * vcnormal . x ; float k normal = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; vcp . normal mass = k normal > 0.0f ? 1.0f / k normal : 0.0f ; float tangentx = 1.0f * vcnormal . y ; float tangenty = - 1.0f * vcnormal . x ; float rt a = vcpr a . x * tangenty - vcpr a . y * tangentx ; float rt b = vcpr b . x * tangenty - vcpr b . y * tangentx ; float k tangent = m a + m b + i a * rt a * rt a + i b * rt b * rt b ; vcp . tangent mass = k tangent > 0.0f ? 1.0f / k tangent : 0.0f ; vcp . velocity bias = 0.0f ; float tempx = v b . x + - w b * vcpr b . y - v a . x - ( - w a * vcpr a . y ) ; float tempy = v b . y + w b * vcpr b . x - v a . y - ( w a * vcpr a . x ) ; float v rel = vcnormal . x * tempx + vcnormal . y * tempy ; if ( v rel < - settings . velocity threshold ) { vcp . velocity bias = - vc . restitution * v rel ; } } if ( vc . point count == 2 ) { velocity constraint point vcp 1 = vc . points [ 0 ] ; velocity constraint point vcp 2 = vc . points [ 1 ] ; float rn 1 a = vcp 1 . r a . x * vcnormal . y - vcp 1 . r a . y * vcnormal . x ; float rn 1 b = vcp 1 . r b . x * vcnormal . y - vcp 1 . r b . y * vcnormal . x ; float rn 2 a = vcp 2 . r a . x * vcnormal . y - vcp 2 . r a . y * vcnormal . x ; float rn 2 b = vcp 2 . r b . x * vcnormal . y - vcp 2 . r b . y * vcnormal . x ; float k 11 = m a + m b + i a * rn 1 a * rn 1 a + i b * rn 1 b * rn 1 b ; float k 22 = m a + m b + i a * rn 2 a * rn 2 a + i b * rn 2 b * rn 2 b ; float k 12 = m a + m b + i a * rn 1 a * rn 2 a + i b * rn 1 b * rn 2 b ; if ( k 11 * k 11 < k max condition number * ( k 11 * k 22 - k 12 * k 12 ) ) { vc . k . ex . x = k 11 ; vc . k . ex . y = k 12 ; vc . k . ey . x = k 12 ; vc . k . ey . y = k 22 ; vc . k . invert to out ( vc . normal mass ) ; } else { vc . point count = 1 ; } } } } <SENTENCE_END/>


Original Name solve,velocity,constraints

solve

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { final contact velocity constraint vc = m velocity constraints [ i ] ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; int point count = vc . point count ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; vec 2 normal = vc . normal ; final float normalx = normal . x ; final float normaly = normal . y ; float tangentx = 1.0f * vc . normal . y ; float tangenty = - 1.0f * vc . normal . x ; final float friction = vc . friction ; assert ( point count == 1 || point count == 2 ) ; for ( int j = 0 ; j < point count ; ++ j ) { final velocity constraint point vcp = vc . points [ j ] ; final vec 2 a = vcp . r a ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * a . x ; final float vt = dvx * tangentx + dvy * tangenty - vc . tangent speed ; float lambda = vcp . tangent mass * ( - vt ) ; final float max friction = friction * vcp . normal impulse ; final float new impulse = math utils . clamp ( vcp . tangent impulse + lambda , - max friction , max friction ) ; lambda = new impulse - vcp . tangent impulse ; vcp . tangent impulse = new impulse ; final float px = tangentx * lambda ; final float py = tangenty * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } if ( vc . point count == 1 ) { final velocity constraint point vcp = vc . points [ 0 ] ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * vcp . r a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * vcp . r a . x ; final float vn = dvx * normalx + dvy * normaly ; float lambda = - vcp . normal mass * ( vn - vcp . velocity bias ) ; float a = vcp . normal impulse + lambda ; final float new impulse = ( a > 0.0f ? a : 0.0f ) ; lambda = new impulse - vcp . normal impulse ; vcp . normal impulse = new impulse ; float px = normalx * lambda ; float py = normaly * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } else { final velocity constraint point cp 1 = vc . points [ 0 ] ; final velocity constraint point cp 2 = vc . points [ 1 ] ; final vec 2 cp 1 r a = cp 1 . r a ; final vec 2 cp 1 r b = cp 1 . r b ; final vec 2 cp 2 r a = cp 2 . r a ; final vec 2 cp 2 r b = cp 2 . r b ; float ax = cp 1 . normal impulse ; float ay = cp 2 . normal impulse ; assert ( ax >= 0.0f && ay >= 0.0f ) ; float dv 1 x = - w b * cp 1 r b . y + v b . x - v a . x + w a * cp 1 r a . y ; float dv 1 y = w b * cp 1 r b . x + v b . y - v a . y - w a * cp 1 r a . x ; float dv 2 x = - w b * cp 2 r b . y + v b . x - v a . x + w a * cp 2 r a . y ; float dv 2 y = w b * cp 2 r b . x + v b . y - v a . y - w a * cp 2 r a . x ; float vn 1 = dv 1 x * normalx + dv 1 y * normaly ; float vn 2 = dv 2 x * normalx + dv 2 y * normaly ; float bx = vn 1 - cp 1 . velocity bias ; float by = vn 2 - cp 2 . velocity bias ; mat 22 r = vc . k ; bx -= r . ex . x * ax + r . ey . x * ay ; by -= r . ex . y * ax + r . ey . y * ay ; for ( ; ; ) { mat 22 r 1 = vc . normal mass ; float xx = r 1 . ex . x * bx + r 1 . ey . x * by ; float xy = r 1 . ex . y * bx + r 1 . ey . y * by ; xx *= - 1 ; xy *= - 1 ; if ( xx >= 0.0f && xy >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = dx * normalx ; float p 1 y = dx * normaly ; float p 2 x = dy * normalx ; float p 2 y = dy * normaly ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = - cp 1 . normal mass * bx ; xy = 0.0f ; vn 1 = 0.0f ; vn 2 = vc . k . ex . y * xx + by ; if ( xx >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = - cp 2 . normal mass * by ; vn 1 = vc . k . ey . x * xy + bx ; vn 2 = 0.0f ; if ( xy >= 0.0f && vn 1 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = 0.0f ; vn 1 = bx ; vn 2 = by ; if ( vn 1 >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; break ; } break ; } } m velocities [ index a ] . w = w a ; m velocities [ index b ] . w = w b ; } } <SENTENCE_END/>

(Copy Probability: 3.4%)

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { final contact velocity constraint vc = m velocity constraints [ i ] ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; int point count = vc . point count ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; vec 2 normal = vc . normal ; final float normalx = normal . x ; final float normaly = normal . y ; float tangentx = 1.0f * vc . normal . y ; float tangenty = - 1.0f * vc . normal . x ; final float friction = vc . friction ; assert ( point count == 1 || point count == 2 ) ; for ( int j = 0 ; j < point count ; ++ j ) { final velocity constraint point vcp = vc . points [ j ] ; final vec 2 a = vcp . r a ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * a . x ; final float vt = dvx * tangentx + dvy * tangenty - vc . tangent speed ; float lambda = vcp . tangent mass * ( - vt ) ; final float max friction = friction * vcp . normal impulse ; final float new impulse = math utils . clamp ( vcp . tangent impulse + lambda , - max friction , max friction ) ; lambda = new impulse - vcp . tangent impulse ; vcp . tangent impulse = new impulse ; final float px = tangentx * lambda ; final float py = tangenty * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } if ( vc . point count == 1 ) { final velocity constraint point vcp = vc . points [ 0 ] ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * vcp . r a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * vcp . r a . x ; final float vn = dvx * normalx + dvy * normaly ; float lambda = - vcp . normal mass * ( vn - vcp . velocity bias ) ; float a = vcp . normal impulse + lambda ; final float new impulse = ( a > 0.0f ? a : 0.0f ) ; lambda = new impulse - vcp . normal impulse ; vcp . normal impulse = new impulse ; float px = normalx * lambda ; float py = normaly * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } else { final velocity constraint point cp 1 = vc . points [ 0 ] ; final velocity constraint point cp 2 = vc . points [ 1 ] ; final vec 2 cp 1 r a = cp 1 . r a ; final vec 2 cp 1 r b = cp 1 . r b ; final vec 2 cp 2 r a = cp 2 . r a ; final vec 2 cp 2 r b = cp 2 . r b ; float ax = cp 1 . normal impulse ; float ay = cp 2 . normal impulse ; assert ( ax >= 0.0f && ay >= 0.0f ) ; float dv 1 x = - w b * cp 1 r b . y + v b . x - v a . x + w a * cp 1 r a . y ; float dv 1 y = w b * cp 1 r b . x + v b . y - v a . y - w a * cp 1 r a . x ; float dv 2 x = - w b * cp 2 r b . y + v b . x - v a . x + w a * cp 2 r a . y ; float dv 2 y = w b * cp 2 r b . x + v b . y - v a . y - w a * cp 2 r a . x ; float vn 1 = dv 1 x * normalx + dv 1 y * normaly ; float vn 2 = dv 2 x * normalx + dv 2 y * normaly ; float bx = vn 1 - cp 1 . velocity bias ; float by = vn 2 - cp 2 . velocity bias ; mat 22 r = vc . k ; bx -= r . ex . x * ax + r . ey . x * ay ; by -= r . ex . y * ax + r . ey . y * ay ; for ( ; ; ) { mat 22 r 1 = vc . normal mass ; float xx = r 1 . ex . x * bx + r 1 . ey . x * by ; float xy = r 1 . ex . y * bx + r 1 . ey . y * by ; xx *= - 1 ; xy *= - 1 ; if ( xx >= 0.0f && xy >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = dx * normalx ; float p 1 y = dx * normaly ; float p 2 x = dy * normalx ; float p 2 y = dy * normaly ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = - cp 1 . normal mass * bx ; xy = 0.0f ; vn 1 = 0.0f ; vn 2 = vc . k . ex . y * xx + by ; if ( xx >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = - cp 2 . normal mass * by ; vn 1 = vc . k . ey . x * xy + bx ; vn 2 = 0.0f ; if ( xy >= 0.0f && vn 1 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = 0.0f ; vn 1 = bx ; vn 2 = by ; if ( vn 1 >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; break ; } break ; } } m velocities [ index a ] . w = w a ; m velocities [ index b ] . w = w b ; } } <SENTENCE_END/>

velocity

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { final contact velocity constraint vc = m velocity constraints [ i ] ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; int point count = vc . point count ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; vec 2 normal = vc . normal ; final float normalx = normal . x ; final float normaly = normal . y ; float tangentx = 1.0f * vc . normal . y ; float tangenty = - 1.0f * vc . normal . x ; final float friction = vc . friction ; assert ( point count == 1 || point count == 2 ) ; for ( int j = 0 ; j < point count ; ++ j ) { final velocity constraint point vcp = vc . points [ j ] ; final vec 2 a = vcp . r a ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * a . x ; final float vt = dvx * tangentx + dvy * tangenty - vc . tangent speed ; float lambda = vcp . tangent mass * ( - vt ) ; final float max friction = friction * vcp . normal impulse ; final float new impulse = math utils . clamp ( vcp . tangent impulse + lambda , - max friction , max friction ) ; lambda = new impulse - vcp . tangent impulse ; vcp . tangent impulse = new impulse ; final float px = tangentx * lambda ; final float py = tangenty * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } if ( vc . point count == 1 ) { final velocity constraint point vcp = vc . points [ 0 ] ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * vcp . r a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * vcp . r a . x ; final float vn = dvx * normalx + dvy * normaly ; float lambda = - vcp . normal mass * ( vn - vcp . velocity bias ) ; float a = vcp . normal impulse + lambda ; final float new impulse = ( a > 0.0f ? a : 0.0f ) ; lambda = new impulse - vcp . normal impulse ; vcp . normal impulse = new impulse ; float px = normalx * lambda ; float py = normaly * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } else { final velocity constraint point cp 1 = vc . points [ 0 ] ; final velocity constraint point cp 2 = vc . points [ 1 ] ; final vec 2 cp 1 r a = cp 1 . r a ; final vec 2 cp 1 r b = cp 1 . r b ; final vec 2 cp 2 r a = cp 2 . r a ; final vec 2 cp 2 r b = cp 2 . r b ; float ax = cp 1 . normal impulse ; float ay = cp 2 . normal impulse ; assert ( ax >= 0.0f && ay >= 0.0f ) ; float dv 1 x = - w b * cp 1 r b . y + v b . x - v a . x + w a * cp 1 r a . y ; float dv 1 y = w b * cp 1 r b . x + v b . y - v a . y - w a * cp 1 r a . x ; float dv 2 x = - w b * cp 2 r b . y + v b . x - v a . x + w a * cp 2 r a . y ; float dv 2 y = w b * cp 2 r b . x + v b . y - v a . y - w a * cp 2 r a . x ; float vn 1 = dv 1 x * normalx + dv 1 y * normaly ; float vn 2 = dv 2 x * normalx + dv 2 y * normaly ; float bx = vn 1 - cp 1 . velocity bias ; float by = vn 2 - cp 2 . velocity bias ; mat 22 r = vc . k ; bx -= r . ex . x * ax + r . ey . x * ay ; by -= r . ex . y * ax + r . ey . y * ay ; for ( ; ; ) { mat 22 r 1 = vc . normal mass ; float xx = r 1 . ex . x * bx + r 1 . ey . x * by ; float xy = r 1 . ex . y * bx + r 1 . ey . y * by ; xx *= - 1 ; xy *= - 1 ; if ( xx >= 0.0f && xy >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = dx * normalx ; float p 1 y = dx * normaly ; float p 2 x = dy * normalx ; float p 2 y = dy * normaly ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = - cp 1 . normal mass * bx ; xy = 0.0f ; vn 1 = 0.0f ; vn 2 = vc . k . ex . y * xx + by ; if ( xx >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = - cp 2 . normal mass * by ; vn 1 = vc . k . ey . x * xy + bx ; vn 2 = 0.0f ; if ( xy >= 0.0f && vn 1 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = 0.0f ; vn 1 = bx ; vn 2 = by ; if ( vn 1 >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; break ; } break ; } } m velocities [ index a ] . w = w a ; m velocities [ index b ] . w = w b ; } } <SENTENCE_END/>

(Copy Probability: 4.3%)

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { final contact velocity constraint vc = m velocity constraints [ i ] ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; int point count = vc . point count ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; vec 2 normal = vc . normal ; final float normalx = normal . x ; final float normaly = normal . y ; float tangentx = 1.0f * vc . normal . y ; float tangenty = - 1.0f * vc . normal . x ; final float friction = vc . friction ; assert ( point count == 1 || point count == 2 ) ; for ( int j = 0 ; j < point count ; ++ j ) { final velocity constraint point vcp = vc . points [ j ] ; final vec 2 a = vcp . r a ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * a . x ; final float vt = dvx * tangentx + dvy * tangenty - vc . tangent speed ; float lambda = vcp . tangent mass * ( - vt ) ; final float max friction = friction * vcp . normal impulse ; final float new impulse = math utils . clamp ( vcp . tangent impulse + lambda , - max friction , max friction ) ; lambda = new impulse - vcp . tangent impulse ; vcp . tangent impulse = new impulse ; final float px = tangentx * lambda ; final float py = tangenty * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } if ( vc . point count == 1 ) { final velocity constraint point vcp = vc . points [ 0 ] ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * vcp . r a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * vcp . r a . x ; final float vn = dvx * normalx + dvy * normaly ; float lambda = - vcp . normal mass * ( vn - vcp . velocity bias ) ; float a = vcp . normal impulse + lambda ; final float new impulse = ( a > 0.0f ? a : 0.0f ) ; lambda = new impulse - vcp . normal impulse ; vcp . normal impulse = new impulse ; float px = normalx * lambda ; float py = normaly * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } else { final velocity constraint point cp 1 = vc . points [ 0 ] ; final velocity constraint point cp 2 = vc . points [ 1 ] ; final vec 2 cp 1 r a = cp 1 . r a ; final vec 2 cp 1 r b = cp 1 . r b ; final vec 2 cp 2 r a = cp 2 . r a ; final vec 2 cp 2 r b = cp 2 . r b ; float ax = cp 1 . normal impulse ; float ay = cp 2 . normal impulse ; assert ( ax >= 0.0f && ay >= 0.0f ) ; float dv 1 x = - w b * cp 1 r b . y + v b . x - v a . x + w a * cp 1 r a . y ; float dv 1 y = w b * cp 1 r b . x + v b . y - v a . y - w a * cp 1 r a . x ; float dv 2 x = - w b * cp 2 r b . y + v b . x - v a . x + w a * cp 2 r a . y ; float dv 2 y = w b * cp 2 r b . x + v b . y - v a . y - w a * cp 2 r a . x ; float vn 1 = dv 1 x * normalx + dv 1 y * normaly ; float vn 2 = dv 2 x * normalx + dv 2 y * normaly ; float bx = vn 1 - cp 1 . velocity bias ; float by = vn 2 - cp 2 . velocity bias ; mat 22 r = vc . k ; bx -= r . ex . x * ax + r . ey . x * ay ; by -= r . ex . y * ax + r . ey . y * ay ; for ( ; ; ) { mat 22 r 1 = vc . normal mass ; float xx = r 1 . ex . x * bx + r 1 . ey . x * by ; float xy = r 1 . ex . y * bx + r 1 . ey . y * by ; xx *= - 1 ; xy *= - 1 ; if ( xx >= 0.0f && xy >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = dx * normalx ; float p 1 y = dx * normaly ; float p 2 x = dy * normalx ; float p 2 y = dy * normaly ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = - cp 1 . normal mass * bx ; xy = 0.0f ; vn 1 = 0.0f ; vn 2 = vc . k . ex . y * xx + by ; if ( xx >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = - cp 2 . normal mass * by ; vn 1 = vc . k . ey . x * xy + bx ; vn 2 = 0.0f ; if ( xy >= 0.0f && vn 1 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = 0.0f ; vn 1 = bx ; vn 2 = by ; if ( vn 1 >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; break ; } break ; } } m velocities [ index a ] . w = w a ; m velocities [ index b ] . w = w b ; } } <SENTENCE_END/>

constraints

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { final contact velocity constraint vc = m velocity constraints [ i ] ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; int point count = vc . point count ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; vec 2 normal = vc . normal ; final float normalx = normal . x ; final float normaly = normal . y ; float tangentx = 1.0f * vc . normal . y ; float tangenty = - 1.0f * vc . normal . x ; final float friction = vc . friction ; assert ( point count == 1 || point count == 2 ) ; for ( int j = 0 ; j < point count ; ++ j ) { final velocity constraint point vcp = vc . points [ j ] ; final vec 2 a = vcp . r a ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * a . x ; final float vt = dvx * tangentx + dvy * tangenty - vc . tangent speed ; float lambda = vcp . tangent mass * ( - vt ) ; final float max friction = friction * vcp . normal impulse ; final float new impulse = math utils . clamp ( vcp . tangent impulse + lambda , - max friction , max friction ) ; lambda = new impulse - vcp . tangent impulse ; vcp . tangent impulse = new impulse ; final float px = tangentx * lambda ; final float py = tangenty * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } if ( vc . point count == 1 ) { final velocity constraint point vcp = vc . points [ 0 ] ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * vcp . r a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * vcp . r a . x ; final float vn = dvx * normalx + dvy * normaly ; float lambda = - vcp . normal mass * ( vn - vcp . velocity bias ) ; float a = vcp . normal impulse + lambda ; final float new impulse = ( a > 0.0f ? a : 0.0f ) ; lambda = new impulse - vcp . normal impulse ; vcp . normal impulse = new impulse ; float px = normalx * lambda ; float py = normaly * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } else { final velocity constraint point cp 1 = vc . points [ 0 ] ; final velocity constraint point cp 2 = vc . points [ 1 ] ; final vec 2 cp 1 r a = cp 1 . r a ; final vec 2 cp 1 r b = cp 1 . r b ; final vec 2 cp 2 r a = cp 2 . r a ; final vec 2 cp 2 r b = cp 2 . r b ; float ax = cp 1 . normal impulse ; float ay = cp 2 . normal impulse ; assert ( ax >= 0.0f && ay >= 0.0f ) ; float dv 1 x = - w b * cp 1 r b . y + v b . x - v a . x + w a * cp 1 r a . y ; float dv 1 y = w b * cp 1 r b . x + v b . y - v a . y - w a * cp 1 r a . x ; float dv 2 x = - w b * cp 2 r b . y + v b . x - v a . x + w a * cp 2 r a . y ; float dv 2 y = w b * cp 2 r b . x + v b . y - v a . y - w a * cp 2 r a . x ; float vn 1 = dv 1 x * normalx + dv 1 y * normaly ; float vn 2 = dv 2 x * normalx + dv 2 y * normaly ; float bx = vn 1 - cp 1 . velocity bias ; float by = vn 2 - cp 2 . velocity bias ; mat 22 r = vc . k ; bx -= r . ex . x * ax + r . ey . x * ay ; by -= r . ex . y * ax + r . ey . y * ay ; for ( ; ; ) { mat 22 r 1 = vc . normal mass ; float xx = r 1 . ex . x * bx + r 1 . ey . x * by ; float xy = r 1 . ex . y * bx + r 1 . ey . y * by ; xx *= - 1 ; xy *= - 1 ; if ( xx >= 0.0f && xy >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = dx * normalx ; float p 1 y = dx * normaly ; float p 2 x = dy * normalx ; float p 2 y = dy * normaly ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = - cp 1 . normal mass * bx ; xy = 0.0f ; vn 1 = 0.0f ; vn 2 = vc . k . ex . y * xx + by ; if ( xx >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = - cp 2 . normal mass * by ; vn 1 = vc . k . ey . x * xy + bx ; vn 2 = 0.0f ; if ( xy >= 0.0f && vn 1 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = 0.0f ; vn 1 = bx ; vn 2 = by ; if ( vn 1 >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; break ; } break ; } } m velocities [ index a ] . w = w a ; m velocities [ index b ] . w = w b ; } } <SENTENCE_END/>

(Copy Probability: 4.0%)

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { final contact velocity constraint vc = m velocity constraints [ i ] ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; int point count = vc . point count ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; vec 2 normal = vc . normal ; final float normalx = normal . x ; final float normaly = normal . y ; float tangentx = 1.0f * vc . normal . y ; float tangenty = - 1.0f * vc . normal . x ; final float friction = vc . friction ; assert ( point count == 1 || point count == 2 ) ; for ( int j = 0 ; j < point count ; ++ j ) { final velocity constraint point vcp = vc . points [ j ] ; final vec 2 a = vcp . r a ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * a . x ; final float vt = dvx * tangentx + dvy * tangenty - vc . tangent speed ; float lambda = vcp . tangent mass * ( - vt ) ; final float max friction = friction * vcp . normal impulse ; final float new impulse = math utils . clamp ( vcp . tangent impulse + lambda , - max friction , max friction ) ; lambda = new impulse - vcp . tangent impulse ; vcp . tangent impulse = new impulse ; final float px = tangentx * lambda ; final float py = tangenty * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } if ( vc . point count == 1 ) { final velocity constraint point vcp = vc . points [ 0 ] ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * vcp . r a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * vcp . r a . x ; final float vn = dvx * normalx + dvy * normaly ; float lambda = - vcp . normal mass * ( vn - vcp . velocity bias ) ; float a = vcp . normal impulse + lambda ; final float new impulse = ( a > 0.0f ? a : 0.0f ) ; lambda = new impulse - vcp . normal impulse ; vcp . normal impulse = new impulse ; float px = normalx * lambda ; float py = normaly * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } else { final velocity constraint point cp 1 = vc . points [ 0 ] ; final velocity constraint point cp 2 = vc . points [ 1 ] ; final vec 2 cp 1 r a = cp 1 . r a ; final vec 2 cp 1 r b = cp 1 . r b ; final vec 2 cp 2 r a = cp 2 . r a ; final vec 2 cp 2 r b = cp 2 . r b ; float ax = cp 1 . normal impulse ; float ay = cp 2 . normal impulse ; assert ( ax >= 0.0f && ay >= 0.0f ) ; float dv 1 x = - w b * cp 1 r b . y + v b . x - v a . x + w a * cp 1 r a . y ; float dv 1 y = w b * cp 1 r b . x + v b . y - v a . y - w a * cp 1 r a . x ; float dv 2 x = - w b * cp 2 r b . y + v b . x - v a . x + w a * cp 2 r a . y ; float dv 2 y = w b * cp 2 r b . x + v b . y - v a . y - w a * cp 2 r a . x ; float vn 1 = dv 1 x * normalx + dv 1 y * normaly ; float vn 2 = dv 2 x * normalx + dv 2 y * normaly ; float bx = vn 1 - cp 1 . velocity bias ; float by = vn 2 - cp 2 . velocity bias ; mat 22 r = vc . k ; bx -= r . ex . x * ax + r . ey . x * ay ; by -= r . ex . y * ax + r . ey . y * ay ; for ( ; ; ) { mat 22 r 1 = vc . normal mass ; float xx = r 1 . ex . x * bx + r 1 . ey . x * by ; float xy = r 1 . ex . y * bx + r 1 . ey . y * by ; xx *= - 1 ; xy *= - 1 ; if ( xx >= 0.0f && xy >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = dx * normalx ; float p 1 y = dx * normaly ; float p 2 x = dy * normalx ; float p 2 y = dy * normaly ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = - cp 1 . normal mass * bx ; xy = 0.0f ; vn 1 = 0.0f ; vn 2 = vc . k . ex . y * xx + by ; if ( xx >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = - cp 2 . normal mass * by ; vn 1 = vc . k . ey . x * xy + bx ; vn 2 = 0.0f ; if ( xy >= 0.0f && vn 1 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = 0.0f ; vn 1 = bx ; vn 2 = by ; if ( vn 1 >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; break ; } break ; } } m velocities [ index a ] . w = w a ; m velocities [ index b ] . w = w b ; } } <SENTENCE_END/>

%END%

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { final contact velocity constraint vc = m velocity constraints [ i ] ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; int point count = vc . point count ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; vec 2 normal = vc . normal ; final float normalx = normal . x ; final float normaly = normal . y ; float tangentx = 1.0f * vc . normal . y ; float tangenty = - 1.0f * vc . normal . x ; final float friction = vc . friction ; assert ( point count == 1 || point count == 2 ) ; for ( int j = 0 ; j < point count ; ++ j ) { final velocity constraint point vcp = vc . points [ j ] ; final vec 2 a = vcp . r a ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * a . x ; final float vt = dvx * tangentx + dvy * tangenty - vc . tangent speed ; float lambda = vcp . tangent mass * ( - vt ) ; final float max friction = friction * vcp . normal impulse ; final float new impulse = math utils . clamp ( vcp . tangent impulse + lambda , - max friction , max friction ) ; lambda = new impulse - vcp . tangent impulse ; vcp . tangent impulse = new impulse ; final float px = tangentx * lambda ; final float py = tangenty * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } if ( vc . point count == 1 ) { final velocity constraint point vcp = vc . points [ 0 ] ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * vcp . r a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * vcp . r a . x ; final float vn = dvx * normalx + dvy * normaly ; float lambda = - vcp . normal mass * ( vn - vcp . velocity bias ) ; float a = vcp . normal impulse + lambda ; final float new impulse = ( a > 0.0f ? a : 0.0f ) ; lambda = new impulse - vcp . normal impulse ; vcp . normal impulse = new impulse ; float px = normalx * lambda ; float py = normaly * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } else { final velocity constraint point cp 1 = vc . points [ 0 ] ; final velocity constraint point cp 2 = vc . points [ 1 ] ; final vec 2 cp 1 r a = cp 1 . r a ; final vec 2 cp 1 r b = cp 1 . r b ; final vec 2 cp 2 r a = cp 2 . r a ; final vec 2 cp 2 r b = cp 2 . r b ; float ax = cp 1 . normal impulse ; float ay = cp 2 . normal impulse ; assert ( ax >= 0.0f && ay >= 0.0f ) ; float dv 1 x = - w b * cp 1 r b . y + v b . x - v a . x + w a * cp 1 r a . y ; float dv 1 y = w b * cp 1 r b . x + v b . y - v a . y - w a * cp 1 r a . x ; float dv 2 x = - w b * cp 2 r b . y + v b . x - v a . x + w a * cp 2 r a . y ; float dv 2 y = w b * cp 2 r b . x + v b . y - v a . y - w a * cp 2 r a . x ; float vn 1 = dv 1 x * normalx + dv 1 y * normaly ; float vn 2 = dv 2 x * normalx + dv 2 y * normaly ; float bx = vn 1 - cp 1 . velocity bias ; float by = vn 2 - cp 2 . velocity bias ; mat 22 r = vc . k ; bx -= r . ex . x * ax + r . ey . x * ay ; by -= r . ex . y * ax + r . ey . y * ay ; for ( ; ; ) { mat 22 r 1 = vc . normal mass ; float xx = r 1 . ex . x * bx + r 1 . ey . x * by ; float xy = r 1 . ex . y * bx + r 1 . ey . y * by ; xx *= - 1 ; xy *= - 1 ; if ( xx >= 0.0f && xy >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = dx * normalx ; float p 1 y = dx * normaly ; float p 2 x = dy * normalx ; float p 2 y = dy * normaly ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = - cp 1 . normal mass * bx ; xy = 0.0f ; vn 1 = 0.0f ; vn 2 = vc . k . ex . y * xx + by ; if ( xx >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = - cp 2 . normal mass * by ; vn 1 = vc . k . ey . x * xy + bx ; vn 2 = 0.0f ; if ( xy >= 0.0f && vn 1 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = 0.0f ; vn 1 = bx ; vn 2 = by ; if ( vn 1 >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; break ; } break ; } } m velocities [ index a ] . w = w a ; m velocities [ index b ] . w = w b ; } } <SENTENCE_END/>

(Copy Probability: 3.8%)

<SENTENCE_START> { for ( int i = 0 ; i < m count ; ++ i ) { final contact velocity constraint vc = m velocity constraints [ i ] ; int index a = vc . index a ; int index b = vc . index b ; float m a = vc . inv mass a ; float m b = vc . inv mass b ; float i a = vc . inv ia ; float i b = vc . inv ib ; int point count = vc . point count ; vec 2 v a = m velocities [ index a ] . v ; float w a = m velocities [ index a ] . w ; vec 2 v b = m velocities [ index b ] . v ; float w b = m velocities [ index b ] . w ; vec 2 normal = vc . normal ; final float normalx = normal . x ; final float normaly = normal . y ; float tangentx = 1.0f * vc . normal . y ; float tangenty = - 1.0f * vc . normal . x ; final float friction = vc . friction ; assert ( point count == 1 || point count == 2 ) ; for ( int j = 0 ; j < point count ; ++ j ) { final velocity constraint point vcp = vc . points [ j ] ; final vec 2 a = vcp . r a ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * a . x ; final float vt = dvx * tangentx + dvy * tangenty - vc . tangent speed ; float lambda = vcp . tangent mass * ( - vt ) ; final float max friction = friction * vcp . normal impulse ; final float new impulse = math utils . clamp ( vcp . tangent impulse + lambda , - max friction , max friction ) ; lambda = new impulse - vcp . tangent impulse ; vcp . tangent impulse = new impulse ; final float px = tangentx * lambda ; final float py = tangenty * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } if ( vc . point count == 1 ) { final velocity constraint point vcp = vc . points [ 0 ] ; float dvx = - w b * vcp . r b . y + v b . x - v a . x + w a * vcp . r a . y ; float dvy = w b * vcp . r b . x + v b . y - v a . y - w a * vcp . r a . x ; final float vn = dvx * normalx + dvy * normaly ; float lambda = - vcp . normal mass * ( vn - vcp . velocity bias ) ; float a = vcp . normal impulse + lambda ; final float new impulse = ( a > 0.0f ? a : 0.0f ) ; lambda = new impulse - vcp . normal impulse ; vcp . normal impulse = new impulse ; float px = normalx * lambda ; float py = normaly * lambda ; v a . x -= px * m a ; v a . y -= py * m a ; w a -= i a * ( vcp . r a . x * py - vcp . r a . y * px ) ; v b . x += px * m b ; v b . y += py * m b ; w b += i b * ( vcp . r b . x * py - vcp . r b . y * px ) ; } else { final velocity constraint point cp 1 = vc . points [ 0 ] ; final velocity constraint point cp 2 = vc . points [ 1 ] ; final vec 2 cp 1 r a = cp 1 . r a ; final vec 2 cp 1 r b = cp 1 . r b ; final vec 2 cp 2 r a = cp 2 . r a ; final vec 2 cp 2 r b = cp 2 . r b ; float ax = cp 1 . normal impulse ; float ay = cp 2 . normal impulse ; assert ( ax >= 0.0f && ay >= 0.0f ) ; float dv 1 x = - w b * cp 1 r b . y + v b . x - v a . x + w a * cp 1 r a . y ; float dv 1 y = w b * cp 1 r b . x + v b . y - v a . y - w a * cp 1 r a . x ; float dv 2 x = - w b * cp 2 r b . y + v b . x - v a . x + w a * cp 2 r a . y ; float dv 2 y = w b * cp 2 r b . x + v b . y - v a . y - w a * cp 2 r a . x ; float vn 1 = dv 1 x * normalx + dv 1 y * normaly ; float vn 2 = dv 2 x * normalx + dv 2 y * normaly ; float bx = vn 1 - cp 1 . velocity bias ; float by = vn 2 - cp 2 . velocity bias ; mat 22 r = vc . k ; bx -= r . ex . x * ax + r . ey . x * ay ; by -= r . ex . y * ax + r . ey . y * ay ; for ( ; ; ) { mat 22 r 1 = vc . normal mass ; float xx = r 1 . ex . x * bx + r 1 . ey . x * by ; float xy = r 1 . ex . y * bx + r 1 . ey . y * by ; xx *= - 1 ; xy *= - 1 ; if ( xx >= 0.0f && xy >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = dx * normalx ; float p 1 y = dx * normaly ; float p 2 x = dy * normalx ; float p 2 y = dy * normaly ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = - cp 1 . normal mass * bx ; xy = 0.0f ; vn 1 = 0.0f ; vn 2 = vc . k . ex . y * xx + by ; if ( xx >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 1 = v b . add ( vec 2 . cross ( w b , cp 1 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 1 r a ) ) ) ; vn 1 = vec 2 . dot ( dv 1 , normal ) ; assert ( math utils . abs ( vn 1 - cp 1 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = - cp 2 . normal mass * by ; vn 1 = vc . k . ey . x * xy + bx ; vn 2 = 0.0f ; if ( xy >= 0.0f && vn 1 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; if ( debug solver ) { vec 2 dv 2 = v b . add ( vec 2 . cross ( w b , cp 2 r b ) . sub local ( v a ) . sub local ( vec 2 . cross ( w a , cp 2 r a ) ) ) ; vn 2 = vec 2 . dot ( dv 2 , normal ) ; assert ( math utils . abs ( vn 2 - cp 2 . velocity bias ) < k error tol ) ; } break ; } xx = 0.0f ; xy = 0.0f ; vn 1 = bx ; vn 2 = by ; if ( vn 1 >= 0.0f && vn 2 >= 0.0f ) { float dx = xx - ax ; float dy = xy - ay ; float p 1 x = normalx * dx ; float p 1 y = normaly * dx ; float p 2 x = normalx * dy ; float p 2 y = normaly * dy ; v a . x -= m a * ( p 1 x + p 2 x ) ; v a . y -= m a * ( p 1 y + p 2 y ) ; v b . x += m b * ( p 1 x + p 2 x ) ; v b . y += m b * ( p 1 y + p 2 y ) ; w a -= i a * ( cp 1 r a . x * p 1 y - cp 1 r a . y * p 1 x + ( cp 2 r a . x * p 2 y - cp 2 r a . y * p 2 x ) ) ; w b += i b * ( cp 1 r b . x * p 1 y - cp 1 r b . y * p 1 x + ( cp 2 r b . x * p 2 y - cp 2 r b . y * p 2 x ) ) ; cp 1 . normal impulse = xx ; cp 2 . normal impulse = xy ; break ; } break ; } } m velocities [ index a ] . w = w a ; m velocities [ index b ] . w = w b ; } } <SENTENCE_END/>


Original Name store,impulses

store

<SENTENCE_START> { for ( int i = 0 ; i < m count ; i ++ ) { final contact velocity constraint vc = m velocity constraints [ i ] ; final manifold manifold = m contacts [ vc . contact index ] . get manifold ( ) ; for ( int j = 0 ; j < vc . point count ; j ++ ) { manifold . points [ j ] . normal impulse = vc . points [ j ] . normal impulse ; manifold . points [ j ] . tangent impulse = vc . points [ j ] . tangent impulse ; } } } <SENTENCE_END/>

(Copy Probability: 5.7%)

<SENTENCE_START> { for ( int i = 0 ; i < m count ; i ++ ) { final contact velocity constraint vc = m velocity constraints [ i ] ; final manifold manifold = m contacts [ vc . contact index ] . get manifold ( ) ; for ( int j = 0 ; j < vc . point count ; j ++ ) { manifold . points [ j ] . normal impulse = vc . points [ j ] . normal impulse ; manifold . points [ j ] . tangent impulse = vc . points [ j ] . tangent impulse ; } } } <SENTENCE_END/>

impulses

<SENTENCE_START> { for ( int i = 0 ; i < m count ; i ++ ) { final contact velocity constraint vc = m velocity constraints [ i ] ; final manifold manifold = m contacts [ vc . contact index ] . get manifold ( ) ; for ( int j = 0 ; j < vc . point count ; j ++ ) { manifold . points [ j ] . normal impulse = vc . points [ j ] . normal impulse ; manifold . points [ j ] . tangent impulse = vc . points [ j ] . tangent impulse ; } } } <SENTENCE_END/>

(Copy Probability: 28.2%)

<SENTENCE_START> { for ( int i = 0 ; i < m count ; i ++ ) { final contact velocity constraint vc = m velocity constraints [ i ] ; final manifold manifold = m contacts [ vc . contact index ] . get manifold ( ) ; for ( int j = 0 ; j < vc . point count ; j ++ ) { manifold . points [ j ] . normal impulse = vc . points [ j ] . normal impulse ; manifold . points [ j ] . tangent impulse = vc . points [ j ] . tangent impulse ; } } } <SENTENCE_END/>

%END%

<SENTENCE_START> { for ( int i = 0 ; i < m count ; i ++ ) { final contact velocity constraint vc = m velocity constraints [ i ] ; final manifold manifold = m contacts [ vc . contact index ] . get manifold ( ) ; for ( int j = 0 ; j < vc . point count ; j ++ ) { manifold . points [ j ] . normal impulse = vc . points [ j ] . normal impulse ; manifold . points [ j ] . tangent impulse = vc . points [ j ] . tangent impulse ; } } } <SENTENCE_END/>

(Copy Probability: 29.6%)

<SENTENCE_START> { for ( int i = 0 ; i < m count ; i ++ ) { final contact velocity constraint vc = m velocity constraints [ i ] ; final manifold manifold = m contacts [ vc . contact index ] . get manifold ( ) ; for ( int j = 0 ; j < vc . point count ; j ++ ) { manifold . points [ j ] . normal impulse = vc . points [ j ] . normal impulse ; manifold . points [ j ] . tangent impulse = vc . points [ j ] . tangent impulse ; } } } <SENTENCE_END/>


Original Name solve,position,constraints

solve

<SENTENCE_START> { float min separation = 0.0f ; for ( int i = 0 ; i < m count ; ++ i ) { contact position constraint pc = m position constraints [ i ] ; int index a = pc . index a ; int index b = pc . index b ; float m a = pc . inv mass a ; float i a = pc . inv ia ; vec 2 local center a = pc . local center a ; final float local center ax = local center a . x ; final float local center ay = local center a . y ; float m b = pc . inv mass b ; float i b = pc . inv ib ; vec 2 local center b = pc . local center b ; final float local center bx = local center b . x ; final float local center by = local center b . y ; int point count = pc . point count ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; for ( int j = 0 ; j < point count ; ++ j ) { final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - xf aq . c * local center ax + xf aq . s * local center ay ; xf a . p . y = c a . y - xf aq . s * local center ax - xf aq . c * local center ay ; xf b . p . x = c b . x - xf bq . c * local center bx + xf bq . s * local center by ; xf b . p . y = c b . y - xf bq . s * local center bx - xf bq . c * local center by ; final position solver manifold psm = psolver ; psm . initialize ( pc , xf a , xf b , j ) ; final vec 2 normal = psm . normal ; final vec 2 point = psm . point ; final float separation = psm . separation ; float r ax = point . x - c a . x ; float r ay = point . y - c a . y ; float r bx = point . x - c b . x ; float r by = point . y - c b . y ; min separation = math utils . min ( min separation , separation ) ; final float c = math utils . clamp ( settings . baumgarte * ( separation + settings . linear slop ) , - settings . max linear correction , 0.0f ) ; final float rn a = r ax * normal . y - r ay * normal . x ; final float rn b = r bx * normal . y - r by * normal . x ; final float k = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; final float impulse = k > 0.0f ? - c / k : 0.0f ; float px = normal . x * impulse ; float py = normal . y * impulse ; c a . x -= px * m a ; c a . y -= py * m a ; a a -= i a * ( r ax * py - r ay * px ) ; c b . x += px * m b ; c b . y += py * m b ; a b += i b * ( r bx * py - r by * px ) ; } m positions [ index a ] . a = a a ; m positions [ index b ] . a = a b ; } return min separation >= - 3.0f * settings . linear slop ; } <SENTENCE_END/>

(Copy Probability: 3.4%)

<SENTENCE_START> { float min separation = 0.0f ; for ( int i = 0 ; i < m count ; ++ i ) { contact position constraint pc = m position constraints [ i ] ; int index a = pc . index a ; int index b = pc . index b ; float m a = pc . inv mass a ; float i a = pc . inv ia ; vec 2 local center a = pc . local center a ; final float local center ax = local center a . x ; final float local center ay = local center a . y ; float m b = pc . inv mass b ; float i b = pc . inv ib ; vec 2 local center b = pc . local center b ; final float local center bx = local center b . x ; final float local center by = local center b . y ; int point count = pc . point count ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; for ( int j = 0 ; j < point count ; ++ j ) { final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - xf aq . c * local center ax + xf aq . s * local center ay ; xf a . p . y = c a . y - xf aq . s * local center ax - xf aq . c * local center ay ; xf b . p . x = c b . x - xf bq . c * local center bx + xf bq . s * local center by ; xf b . p . y = c b . y - xf bq . s * local center bx - xf bq . c * local center by ; final position solver manifold psm = psolver ; psm . initialize ( pc , xf a , xf b , j ) ; final vec 2 normal = psm . normal ; final vec 2 point = psm . point ; final float separation = psm . separation ; float r ax = point . x - c a . x ; float r ay = point . y - c a . y ; float r bx = point . x - c b . x ; float r by = point . y - c b . y ; min separation = math utils . min ( min separation , separation ) ; final float c = math utils . clamp ( settings . baumgarte * ( separation + settings . linear slop ) , - settings . max linear correction , 0.0f ) ; final float rn a = r ax * normal . y - r ay * normal . x ; final float rn b = r bx * normal . y - r by * normal . x ; final float k = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; final float impulse = k > 0.0f ? - c / k : 0.0f ; float px = normal . x * impulse ; float py = normal . y * impulse ; c a . x -= px * m a ; c a . y -= py * m a ; a a -= i a * ( r ax * py - r ay * px ) ; c b . x += px * m b ; c b . y += py * m b ; a b += i b * ( r bx * py - r by * px ) ; } m positions [ index a ] . a = a a ; m positions [ index b ] . a = a b ; } return min separation >= - 3.0f * settings . linear slop ; } <SENTENCE_END/>

position

<SENTENCE_START> { float min separation = 0.0f ; for ( int i = 0 ; i < m count ; ++ i ) { contact position constraint pc = m position constraints [ i ] ; int index a = pc . index a ; int index b = pc . index b ; float m a = pc . inv mass a ; float i a = pc . inv ia ; vec 2 local center a = pc . local center a ; final float local center ax = local center a . x ; final float local center ay = local center a . y ; float m b = pc . inv mass b ; float i b = pc . inv ib ; vec 2 local center b = pc . local center b ; final float local center bx = local center b . x ; final float local center by = local center b . y ; int point count = pc . point count ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; for ( int j = 0 ; j < point count ; ++ j ) { final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - xf aq . c * local center ax + xf aq . s * local center ay ; xf a . p . y = c a . y - xf aq . s * local center ax - xf aq . c * local center ay ; xf b . p . x = c b . x - xf bq . c * local center bx + xf bq . s * local center by ; xf b . p . y = c b . y - xf bq . s * local center bx - xf bq . c * local center by ; final position solver manifold psm = psolver ; psm . initialize ( pc , xf a , xf b , j ) ; final vec 2 normal = psm . normal ; final vec 2 point = psm . point ; final float separation = psm . separation ; float r ax = point . x - c a . x ; float r ay = point . y - c a . y ; float r bx = point . x - c b . x ; float r by = point . y - c b . y ; min separation = math utils . min ( min separation , separation ) ; final float c = math utils . clamp ( settings . baumgarte * ( separation + settings . linear slop ) , - settings . max linear correction , 0.0f ) ; final float rn a = r ax * normal . y - r ay * normal . x ; final float rn b = r bx * normal . y - r by * normal . x ; final float k = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; final float impulse = k > 0.0f ? - c / k : 0.0f ; float px = normal . x * impulse ; float py = normal . y * impulse ; c a . x -= px * m a ; c a . y -= py * m a ; a a -= i a * ( r ax * py - r ay * px ) ; c b . x += px * m b ; c b . y += py * m b ; a b += i b * ( r bx * py - r by * px ) ; } m positions [ index a ] . a = a a ; m positions [ index b ] . a = a b ; } return min separation >= - 3.0f * settings . linear slop ; } <SENTENCE_END/>

(Copy Probability: 6.8%)

<SENTENCE_START> { float min separation = 0.0f ; for ( int i = 0 ; i < m count ; ++ i ) { contact position constraint pc = m position constraints [ i ] ; int index a = pc . index a ; int index b = pc . index b ; float m a = pc . inv mass a ; float i a = pc . inv ia ; vec 2 local center a = pc . local center a ; final float local center ax = local center a . x ; final float local center ay = local center a . y ; float m b = pc . inv mass b ; float i b = pc . inv ib ; vec 2 local center b = pc . local center b ; final float local center bx = local center b . x ; final float local center by = local center b . y ; int point count = pc . point count ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; for ( int j = 0 ; j < point count ; ++ j ) { final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - xf aq . c * local center ax + xf aq . s * local center ay ; xf a . p . y = c a . y - xf aq . s * local center ax - xf aq . c * local center ay ; xf b . p . x = c b . x - xf bq . c * local center bx + xf bq . s * local center by ; xf b . p . y = c b . y - xf bq . s * local center bx - xf bq . c * local center by ; final position solver manifold psm = psolver ; psm . initialize ( pc , xf a , xf b , j ) ; final vec 2 normal = psm . normal ; final vec 2 point = psm . point ; final float separation = psm . separation ; float r ax = point . x - c a . x ; float r ay = point . y - c a . y ; float r bx = point . x - c b . x ; float r by = point . y - c b . y ; min separation = math utils . min ( min separation , separation ) ; final float c = math utils . clamp ( settings . baumgarte * ( separation + settings . linear slop ) , - settings . max linear correction , 0.0f ) ; final float rn a = r ax * normal . y - r ay * normal . x ; final float rn b = r bx * normal . y - r by * normal . x ; final float k = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; final float impulse = k > 0.0f ? - c / k : 0.0f ; float px = normal . x * impulse ; float py = normal . y * impulse ; c a . x -= px * m a ; c a . y -= py * m a ; a a -= i a * ( r ax * py - r ay * px ) ; c b . x += px * m b ; c b . y += py * m b ; a b += i b * ( r bx * py - r by * px ) ; } m positions [ index a ] . a = a a ; m positions [ index b ] . a = a b ; } return min separation >= - 3.0f * settings . linear slop ; } <SENTENCE_END/>

constraints

<SENTENCE_START> { float min separation = 0.0f ; for ( int i = 0 ; i < m count ; ++ i ) { contact position constraint pc = m position constraints [ i ] ; int index a = pc . index a ; int index b = pc . index b ; float m a = pc . inv mass a ; float i a = pc . inv ia ; vec 2 local center a = pc . local center a ; final float local center ax = local center a . x ; final float local center ay = local center a . y ; float m b = pc . inv mass b ; float i b = pc . inv ib ; vec 2 local center b = pc . local center b ; final float local center bx = local center b . x ; final float local center by = local center b . y ; int point count = pc . point count ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; for ( int j = 0 ; j < point count ; ++ j ) { final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - xf aq . c * local center ax + xf aq . s * local center ay ; xf a . p . y = c a . y - xf aq . s * local center ax - xf aq . c * local center ay ; xf b . p . x = c b . x - xf bq . c * local center bx + xf bq . s * local center by ; xf b . p . y = c b . y - xf bq . s * local center bx - xf bq . c * local center by ; final position solver manifold psm = psolver ; psm . initialize ( pc , xf a , xf b , j ) ; final vec 2 normal = psm . normal ; final vec 2 point = psm . point ; final float separation = psm . separation ; float r ax = point . x - c a . x ; float r ay = point . y - c a . y ; float r bx = point . x - c b . x ; float r by = point . y - c b . y ; min separation = math utils . min ( min separation , separation ) ; final float c = math utils . clamp ( settings . baumgarte * ( separation + settings . linear slop ) , - settings . max linear correction , 0.0f ) ; final float rn a = r ax * normal . y - r ay * normal . x ; final float rn b = r bx * normal . y - r by * normal . x ; final float k = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; final float impulse = k > 0.0f ? - c / k : 0.0f ; float px = normal . x * impulse ; float py = normal . y * impulse ; c a . x -= px * m a ; c a . y -= py * m a ; a a -= i a * ( r ax * py - r ay * px ) ; c b . x += px * m b ; c b . y += py * m b ; a b += i b * ( r bx * py - r by * px ) ; } m positions [ index a ] . a = a a ; m positions [ index b ] . a = a b ; } return min separation >= - 3.0f * settings . linear slop ; } <SENTENCE_END/>

(Copy Probability: 5.9%)

<SENTENCE_START> { float min separation = 0.0f ; for ( int i = 0 ; i < m count ; ++ i ) { contact position constraint pc = m position constraints [ i ] ; int index a = pc . index a ; int index b = pc . index b ; float m a = pc . inv mass a ; float i a = pc . inv ia ; vec 2 local center a = pc . local center a ; final float local center ax = local center a . x ; final float local center ay = local center a . y ; float m b = pc . inv mass b ; float i b = pc . inv ib ; vec 2 local center b = pc . local center b ; final float local center bx = local center b . x ; final float local center by = local center b . y ; int point count = pc . point count ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; for ( int j = 0 ; j < point count ; ++ j ) { final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - xf aq . c * local center ax + xf aq . s * local center ay ; xf a . p . y = c a . y - xf aq . s * local center ax - xf aq . c * local center ay ; xf b . p . x = c b . x - xf bq . c * local center bx + xf bq . s * local center by ; xf b . p . y = c b . y - xf bq . s * local center bx - xf bq . c * local center by ; final position solver manifold psm = psolver ; psm . initialize ( pc , xf a , xf b , j ) ; final vec 2 normal = psm . normal ; final vec 2 point = psm . point ; final float separation = psm . separation ; float r ax = point . x - c a . x ; float r ay = point . y - c a . y ; float r bx = point . x - c b . x ; float r by = point . y - c b . y ; min separation = math utils . min ( min separation , separation ) ; final float c = math utils . clamp ( settings . baumgarte * ( separation + settings . linear slop ) , - settings . max linear correction , 0.0f ) ; final float rn a = r ax * normal . y - r ay * normal . x ; final float rn b = r bx * normal . y - r by * normal . x ; final float k = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; final float impulse = k > 0.0f ? - c / k : 0.0f ; float px = normal . x * impulse ; float py = normal . y * impulse ; c a . x -= px * m a ; c a . y -= py * m a ; a a -= i a * ( r ax * py - r ay * px ) ; c b . x += px * m b ; c b . y += py * m b ; a b += i b * ( r bx * py - r by * px ) ; } m positions [ index a ] . a = a a ; m positions [ index b ] . a = a b ; } return min separation >= - 3.0f * settings . linear slop ; } <SENTENCE_END/>

%END%

<SENTENCE_START> { float min separation = 0.0f ; for ( int i = 0 ; i < m count ; ++ i ) { contact position constraint pc = m position constraints [ i ] ; int index a = pc . index a ; int index b = pc . index b ; float m a = pc . inv mass a ; float i a = pc . inv ia ; vec 2 local center a = pc . local center a ; final float local center ax = local center a . x ; final float local center ay = local center a . y ; float m b = pc . inv mass b ; float i b = pc . inv ib ; vec 2 local center b = pc . local center b ; final float local center bx = local center b . x ; final float local center by = local center b . y ; int point count = pc . point count ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; for ( int j = 0 ; j < point count ; ++ j ) { final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - xf aq . c * local center ax + xf aq . s * local center ay ; xf a . p . y = c a . y - xf aq . s * local center ax - xf aq . c * local center ay ; xf b . p . x = c b . x - xf bq . c * local center bx + xf bq . s * local center by ; xf b . p . y = c b . y - xf bq . s * local center bx - xf bq . c * local center by ; final position solver manifold psm = psolver ; psm . initialize ( pc , xf a , xf b , j ) ; final vec 2 normal = psm . normal ; final vec 2 point = psm . point ; final float separation = psm . separation ; float r ax = point . x - c a . x ; float r ay = point . y - c a . y ; float r bx = point . x - c b . x ; float r by = point . y - c b . y ; min separation = math utils . min ( min separation , separation ) ; final float c = math utils . clamp ( settings . baumgarte * ( separation + settings . linear slop ) , - settings . max linear correction , 0.0f ) ; final float rn a = r ax * normal . y - r ay * normal . x ; final float rn b = r bx * normal . y - r by * normal . x ; final float k = m a + m b + i a * rn a * rn a + i b * rn b * rn b ; final float impulse = k > 0.0f ? - c / k : 0.0f ; float px = normal . x * impulse ; float py = normal . y * impulse ; c a . x -= px * m a ; c a . y -= py * m a ; a a -= i a * ( r ax * py - r ay * px ) ; c b . x += px * m b ; c b . y += py * m b ; a b += i b * ( r bx * py - r by * px ) ; } m positions [ index a ] . a = a a ; m positions [ index b ] . a = a b ; } return min separation >= - 3.0f * settings . linear slop ; } <SENTENCE_END/>

(Copy Probability: 4.4%)

<SENTENCE_START> { float min separation = 0.0f ; for ( int i = 0 ; i < m count ; ++ i ) { contact position constraint pc = m position constraints [ i ] ; int index a = pc . index a ; int index b = pc . index b ; float m a = pc . inv mass a ; float i a = pc . inv ia ; vec 2 local center a = pc . local center a ; final float local center ax = local center a . x ; final float local center ay = local center a . y ; float m b = pc . inv mass b ; float i b = pc . inv ib ; vec 2 local center b = pc . local center b ; final float local center bx = local center b . x ; final float local center by = local center b . y ; int point count = pc . point count ; vec 2 c a = m positions [ index a ] . c ; float a a = m positions [ index a ] . a ; vec 2 c b = m positions [ index b ] . c ; float a b = m positions [ index b ] . a ; for ( int j = 0 ; j < point count ; ++ j ) { final rot xf aq = xf a . q ; final rot xf bq = xf b . q ; xf aq . set ( a a ) ; xf bq . set ( a b ) ; xf a . p . x = c a . x - xf aq . c * local center ax + xf aq . s * local center ay ; xf a . p . y = c a . y - xf aq . s * local center ax - xf aq . c * local center ay ; xf b . p . x = c b . x - xf bq . c * local center bx + xf bq . s * local center by ; xf b . p . y = c b . y - xf bq . s * local center bx - xf bq . c * local center by ; final position solver manifold psm = psolver ; psm . initialize ( pc , xf a , xf b , j ) ; final vec 2 normal = psm . normal ; final vec 2 point = psm . point ; final float separation = psm . separation ; float r ax = point . x - c a . x ; float r ay = point . y - c a . y ; float r bx = point . x - c b . x ; float r by = point . y - c b . y ; min separation = math utils . min ( min separation , separation ) ; final float c = math utils . clamp ( settings . baumgarte * ( separation + settings . linear slop ) , - settings . max linear correction , 0.0f ) ; final float rn a = r ax * normal . y - r ay * normal . x ; final float rn b = r b