AS3 2.1 Port (Alchemy), WCK Update and Kinematic Demos

hello, I'm making a large scrolling scene and something strange happens,
WCK don't render the code when i tween my focus on object to more then 300 frames.
i really don't want to to move it with code cause it's needs to in sync with sound and on stage visuals. i set to kinematic and tweened.
anybody knows how can i solve this?
thanks
Ovals tend to get stuck together excessively easily with few sides.

width 94.60
height 27.30
(seems to default to 3 or 4 "sides" (polygons) based on that size)

put 4 or 5 of them inside a world edged with bouncy walls (walls are 30 thick).
(like an oval-"ball" 2d billiard game i suppose)

dragging any oval near another seems to get them stuck together.
increasing the number of sides to 30 and it resolves some what, and if they do get stuck now, they separate when they bounce off anything.
increase to 90 and it becomes possible to mouse drag the dynamic oval through a static rectangle wall. but they don't get stuck on each other any more.

not sure if this is just wck, or box2d 2.1 as a whole.

i may just use 2 skewed rectangles to represent my ovals for now assuming that takes care of the issue.

thanks for the oval, different decomposition than i would have expected.
mayobutter, thank you for your work! It's very impressive stuff.

I have a question: how to turn body from static to dynamic in a right way?
I'm just start to study wck and writing some test examples.
In this example I've created the world on stage, than attached some static boxes(boxes extends shapes.Box), and than attached listeners to boxes to handle collisions.
On mouse click ball fired, and after collision boxes falling down... but just the body (ball collides with invisible virtual bodies), box sprites remains on the same place, they don't move.
Here is how it looks: http://en.novikovd.com/wcktest/test_wck.html
Why sprite don't follow the body it attached to?

And what am I doing wrong here:

Code:
package 
{
   import Box2DAS.Common.V2;
   import Box2DAS.Dynamics.ContactEvent;
   import flash.geom.Point;
   import shapes.Box;
   import shapes.Circle;
   import wck.World;
   import misc.Util;
   import Box2DAS.Dynamics.b2Body;
   import flash.events.MouseEvent;

   public class test01 extends World
   {
      private var c:Circle;
      private var box:Box;
      
      public function test01()
      {
         super();
         for (var i:int = 0; i < 8; i++) {
            for (var j:int = 0; j < 7; j++){
               box = new boxie();
               box.type = "Static";
               box.restitution = 0.2;
               box._density = 10;
               Util.addChildAtPos(this, box, new Point(10 + i * 30, -110 + 40 * j));
               box.addEventListener( ContactEvent.BEGIN_CONTACT, onContact);
               box.reportBeginContact = true;
            }
         }
         listenWhileVisible(stage, MouseEvent.MOUSE_DOWN, handleMouseDown);
      }
      
      private function onContact(e:ContactEvent):void
      {
         if ( e.other.GetBody().GetFixtureList().GetUserData() is circle) {
            e.fixture.GetBody().SetType(2);
         }
      }
      
      private function handleMouseDown(e:MouseEvent):void
      {
         c = new circle();
            c.width = 15;
            c.height = 15;
            c.restitution = 0.5;
            c._density = 12;
            c._linearVelocity = new V2(8, -10);
            c.bullet = true;
         Util.addChildAtPos(this, c, new Point( -240, 150));
      }
   }
}
dmitry: With the latest commit you can now switch a body's type between "Static", "Dynamic", "Kinematic" and "Animated" using the "type" getter setter. Before, if a body was static on creation, it would never add the event listener that updates the BodyShape.

"Animated" is a new, WCK only body type. You can use this type if you want to tween your BodyShapes or animate them with AS3. Note: There is still an issue if your animation exceeds the maximum linear or angular velocity. This replaces the "tweened" property which is still there (so existing components don't break) but is depreciated and will be removed.

So now your event handler should be something like (depending on how you have things laid out):

Code:
e.target.type = 'Dynamic';


arkzai: It is possible your tween is exceeding the maximum linear velocity. Try turning "debug" on in the world and see what happens.

Everyone Else: Been busy, sorry. I'm going to catch up today.
I take it animated infers the velocity from the change in position? I was thinking of doing that as a tweenlite plugin, but then I realized tweenlite would still be useless until all the Get/Set methods became true getter setters.
What's the issue with max velocities, can you not just turn that off for animated bodies.
Boris: Yes, velocity is inferred from position changes. I didn't think about disabling the limits (since they're applied on the C++ side) but that does seem to help things a bit. You pretty much have to keyframe/teleport an object all the way across the screen for it to break, so its not a huge deal.

Frnk: Regarding Pulleys: Box2d has a setting, b2_minPulleyLength = 2, which is unusually large. I set it to 0.1 and recompiled and Pulleys seem to work better now. The issue is that when a pulley gets close to it's extents, and one of the rope lengths approaches zero, things get unstable. So this constant is there to prevent that.
mayobutter, thanks! Now It works! 😀
Just want to say thanks to whoever has made this port I have found it really easy to use so far. Such a time saver words cannot describe!

😀
hey mayobutter,
i put debug mode on but it still don't render
thanks
Hello.
Question: how can I set "equilibrium" distanceJoint.length in WCK?

Now distanceJoint.length is distance between j1 and j2 instances of Joint class. How can I change it?

Original thread: https://box2d.org/forum/viewtopic.php?t=4105