<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>2d &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<atom:link href="https://blog.sephiroth.it/tag/2d/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sephiroth.it</link>
	<description>programmer by pure chance</description>
	<lastBuildDate>Mon, 14 Jun 2010 06:53:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://blog.sephiroth.it/wp-content/uploads/2019/03/cropped-sepy-big-32x32.png</url>
	<title>2d &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<link>https://blog.sephiroth.it</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Flade, opensource 2D physic engine</title>
		<link>https://blog.sephiroth.it/2005/07/13/flade-opensource-2d-physic-engine/</link>
					<comments>https://blog.sephiroth.it/2005/07/13/flade-opensource-2d-physic-engine/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Thu, 14 Jul 2005 03:13:27 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[2d]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[physic]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=93</guid>

					<description><![CDATA[flade 2d phisic engine
]]></description>
										<content:encoded><![CDATA[<p>Today Davide shows to me this link to a new opensource project regarding Flash.<br />
It&#8217;s a <em>&#8220;free library for simulating 2D physics in Flash using Verlet integration. It currently features particles, stick &amp; angular constraints, wheels, and surfaces composed of line segments. Designed primarily for games with a goal of speed and ease of use&#8221;</em><br />
I immediately downloaded the available &#8220;alpha&#8221; release and made a first test..</p>
<p>[attachments docid=646 fields=caption,description force_saveas=&#8221;1&#8243; logged_users=&#8221;0&#8243;]</p>
<p>I don&#8217;t know if the project is still alive and which is the developement status, but it looks very promising.<br />
&#8230;And here the code used for the example above:</p>
<pre class="tutorialCode">var psystem = new ParticleSystem();
psystem.setDamping(1.0);
psystem.setGravity(0.0, 0.4);
// cooefficient of restitution
psystem.setKfr(0.1);
// surface friction for particles
psystem.setFriction(0.5);
// surfaces
var sA = new Surface(new Point(0, 0), new Point(1, 200));
sA.setIsOrientH(false);
psystem.addSurface(sA);
var s0 = new Surface(new Point(1, 200), new Point(100, 200));
psystem.addSurface(s0);
var s2 = new Surface(new Point(220, 170), new Point(300, 200));
psystem.addSurface(s2);
var s3 = new Surface(new Point(300, 200), new Point(400, 150));
psystem.addSurface(s3);
var sB = new Surface(new Point(399, 150), new Point(399, 0));
sB.setIsOrientH(false);
psystem.addSurface(sB);
// circle surface
var circA = new CircleSurface(170, 220, 70);
psystem.addSurface(circA);
var leftX  = 10;
var rightX = 50
var widthX = rightX - leftX;
var midX   = leftX + (widthX / 2);
var topY = 160;
// wheels
var wheelA = psystem.addWheel(leftX, topY, 10);
var wheelB = psystem.addWheel(rightX, topY, 10);
wheelA.coeffSlip = 0.0;
wheelB.coeffSlip = 0.0;
// body
var rectA = psystem.addRectangle(new Vector(midX, topY), widthX, 10);
// wheel struts
var conn1 = psystem.addConstraint(wheelA.wp, rectA.p3);
conn1.setRestLength(5);
var conn2 = psystem.addConstraint(wheelB.wp, rectA.p2);
conn2.setRestLength(5);
var conn1a = psystem.addConstraint(wheelA.wp, rectA.p0);
conn1a.setRestLength(5);
var conn2a = psystem.addConstraint(wheelB.wp, rectA.p1);
conn2a.setRestLength(5);
psystem.paintSurfaces();
this.onEnterFrame = function() {
var keySpeed = 2.0;
if(Key.isDown(Key.LEFT)) {
wheelA.rp.vs = -keySpeed;
wheelB.rp.vs = -keySpeed;
} else if(Key.isDown(Key.RIGHT)) {
wheelA.rp.vs = keySpeed;
wheelB.rp.vs = keySpeed;
} else {
wheelA.rp.vs = 0;
wheelB.rp.vs = 0;
}
if (Key.isDown(Key.UP)) {
if (ang.targetTheta &lt; 2.9) ang.targetTheta += .1;
} else {
if (ang.targetTheta &gt; angDefault) ang.targetTheta -= .1;
}
psystem.timeStep();
psystem.paintWheels();
psystem.paintConstraints();
}</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2005/07/13/flade-opensource-2d-physic-engine/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
