Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 221 additions and 0 deletions.
  1. +74 −0 spec/block_docs/code_c_like.md
  2. +147 −0 spec/block_docs/code_c_like2.md
View
74 spec/block_docs/code_c_like.md
@@ -0,0 +1,74 @@
+C-like syntax within a `<code>` tag should not bork.
+*** Parameters: ***
+{}
+*** Markdown input: ***
+<figure>
+ <a id="fig-14"></a>
+ <pre><code>
+hashA = entityA._roId + ':' + entityB._roId;
+hashB = entityB._roId + ':' + entityA._roId;
+
+if( !checked[hashA] && !checked[hashB] ){
+
+ // mark this pair as checked
+ checked[hashA] = checked[hashB] = true;
+
+ if( this.aabb2DIntersection( entityA, entityB ) ){
+ pairs.push( [entityA, entityB] );
+ }
+}
+ </code></pre>
+ <figcaption>
+ Fig. 14: Keeping a cache of tested pairs.
+ </figcaption>
+</figure>
+*** Output of inspect ***
+md_el(:document,[
+ md_html("<figure>\n <a id=\"fig-14\"></a>\n <pre><code>\nhashA = entityA._roId + ':' + entityB._roId;\nhashB = entityB._roId + ':' + entityA._roId;\n\nif( !checked[hashA] && !checked[hashB] ){\n\n // mark this pair as checked\n checked[hashA] = checked[hashB] = true;\n\n if( this.aabb2DIntersection( entityA, entityB ) ){\n pairs.push( [entityA, entityB] );\n }\n}\n </code></pre>\n <figcaption>\n Fig. 14: Keeping a cache of tested pairs.\n </figcaption>\n</figure>")
+],{},[])
+*** Output of to_html ***
+<figure>
+ <a id="fig-14"></a>
+ <pre><code>
+hashA = entityA._roId + ':' + entityB._roId;
+hashB = entityB._roId + ':' + entityA._roId;
+
+if( !checked[hashA] && !checked[hashB] ){
+
+ // mark this pair as checked
+ checked[hashA] = checked[hashB] = true;
+
+ if( this.aabb2DIntersection( entityA, entityB ) ){
+ pairs.push( [entityA, entityB] );
+ }
+}
+ </code></pre>
+ <figcaption>
+ Fig. 14: Keeping a cache of tested pairs.
+ </figcaption>
+</figure>
+*** Output of to_latex ***
+ Fig. 14: Keeping a cache of tested pairs.
+*** Output of to_md ***
+<figure>
+ <a id="fig-14"></a>
+ <pre><code>
+hashA = entityA._roId + ':' + entityB._roId;
+hashB = entityB._roId + ':' + entityA._roId;
+
+if( !checked[hashA] && !checked[hashB] ){
+
+ // mark this pair as checked
+ checked[hashA] = checked[hashB] = true;
+
+ if( this.aabb2DIntersection( entityA, entityB ) ){
+ pairs.push( [entityA, entityB] );
+ }
+}
+ </code></pre>
+ <figcaption>
+ Fig. 14: Keeping a cache of tested pairs.
+ </figcaption>
+</figure>
+*** Output of to_s ***
+
View
147 spec/block_docs/code_c_like2.md
@@ -0,0 +1,147 @@
+C-like syntax within a `<code>` tag should not bork.
+*** Parameters: ***
+{}
+*** Markdown input: ***
+<figure>
+ <a id="fig-2"></a>
+ <pre><code>
+BruteForceTech.prototype.queryForCollisionPairs = function(){
+
+ var i, j, e1, e2, pairs = [], entityLen = this.entities.length;
+
+ this.collisionTests = 0;
+
+ for( i = 0; i < entityLen; i++ ){
+ e1 = this.entities[i];
+
+ for( j = i+1; j < entityLen; j++ ){
+ e2 = this.entities[j];
+
+ this.collisionTests += 1;
+
+ if( this.aabb2DIntersection(e1, e2) === true ){
+ pairs.push( [e1, e2] );
+ }
+ }
+ }
+
+ return pairs;
+}
+
+BruteForceTech.prototype.aabb2DIntersection = function( objA, objB ){
+ var a = objA.getAABB()
+ ,b = objB.getAABB();
+
+ if(
+ a.min[0] > b.max[0] || a.min[1] > b.max[1]
+ || a.max[0] < b.min[0] || a.max[1] < b.min[1]
+ ){
+ return false;
+ } else {
+ return true;
+ }
+}
+ </code></pre>
+ <figcaption>
+ Fig. 2: Two functions demonstrating brute force collision detection iteration and an AABB overlap test.
+ </figcaption>
+</figure>
+*** Output of inspect ***
+md_el(:document,[
+ md_html("<figure>\n\t<a id=\"fig-2\"></a>\n\t<pre><code>\nBruteForceTech.prototype.queryForCollisionPairs = function(){\n\n\tvar i, j, e1, e2, pairs = [], entityLen = this.entities.length;\n\n\tthis.collisionTests = 0;\n\n\tfor( i = 0; i < entityLen; i++ ){\n\t\te1 = this.entities[i];\n\n\t\tfor( j = i+1; j < entityLen; j++ ){\n\t\t\te2 = this.entities[j];\n\n\t\t\tthis.collisionTests += 1;\n\n\t\t\tif( this.aabb2DIntersection(e1, e2) === true ){\n\t\t\t\tpairs.push( [e1, e2] );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn pairs;\n}\n\nBruteForceTech.prototype.aabb2DIntersection = function( objA, objB ){\n\tvar a = objA.getAABB()\n\t\t,b = objB.getAABB();\n\n\tif(\n\t\ta.min[0] > b.max[0] || a.min[1] > b.max[1]\n\t\t|| a.max[0] < b.min[0] || a.max[1] < b.min[1]\n\t){\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}\n\t</code></pre>\n\t<figcaption>\n\t\tFig. 2: Two functions demonstrating brute force collision detection iteration and an AABB overlap test.\n\t</figcaption>\n</figure>")
+],{},[])
+*** Output of to_html ***
+<figure>
+ <a id="fig-2"></a>
+ <pre><code>
+BruteForceTech.prototype.queryForCollisionPairs = function(){
+
+ var i, j, e1, e2, pairs = [], entityLen = this.entities.length;
+
+ this.collisionTests = 0;
+
+ for( i = 0; i < entityLen; i++ ){
+ e1 = this.entities[i];
+
+ for( j = i+1; j < entityLen; j++ ){
+ e2 = this.entities[j];
+
+ this.collisionTests += 1;
+
+ if( this.aabb2DIntersection(e1, e2) === true ){
+ pairs.push( [e1, e2] );
+ }
+ }
+ }
+
+ return pairs;
+}
+
+BruteForceTech.prototype.aabb2DIntersection = function( objA, objB ){
+ var a = objA.getAABB()
+ ,b = objB.getAABB();
+
+ if(
+ a.min[0] > b.max[0] || a.min[1] > b.max[1]
+ || a.max[0] < b.min[0] || a.max[1] < b.min[1]
+ ){
+ return false;
+ } else {
+ return true;
+ }
+}
+ </code></pre>
+ <figcaption>
+ Fig. 2: Two functions demonstrating brute force collision detection iteration and an AABB overlap test.
+ </figcaption>
+</figure>
+*** Output of to_latex ***
+ Fig. 2: Two functions demonstrating brute force collision detection
+iteration and an AABB overlap test.
+*** Output of to_md ***
+<figure>
+ <a id="fig-2"></a>
+ <pre><code>
+BruteForceTech.prototype.queryForCollisionPairs = function(){
+
+ var i, j, e1, e2, pairs = [], entityLen = this.entities.length;
+
+ this.collisionTests = 0;
+
+ for( i = 0; i < entityLen; i++ ){
+ e1 = this.entities[i];
+
+ for( j = i+1; j < entityLen; j++ ){
+ e2 = this.entities[j];
+
+ this.collisionTests += 1;
+
+ if( this.aabb2DIntersection(e1, e2) === true ){
+ pairs.push( [e1, e2] );
+ }
+ }
+ }
+
+ return pairs;
+}
+
+BruteForceTech.prototype.aabb2DIntersection = function( objA, objB ){
+ var a = objA.getAABB()
+ ,b = objB.getAABB();
+
+ if(
+ a.min[0] > b.max[0] || a.min[1] > b.max[1]
+ || a.max[0] < b.min[0] || a.max[1] < b.min[1]
+ ){
+ return false;
+ } else {
+ return true;
+ }
+}
+ </code></pre>
+ <figcaption>
+ Fig. 2: Two functions demonstrating brute force collision detection iteration and an AABB overlap test.
+ </figcaption>
+</figure>
+*** Output of to_s ***
+

No commit comments for this range

Something went wrong with that request. Please try again.