Box2D Flash - Perfect Character Collision? (AS3) - actionscript-3

I was wondering if it's possible to get almost perfect character collision with Box2D (Flash)?
I know the basics of Actionscript 3 but know very little about Box2D. I can create character collision to stop the character running through platforms and such with Actionscript 3 but because the character isn't a simple shape, it's quite glitchy.
Thanks

In a word, yes. See the interactive ragdoll example right on the Box2DFlash homepage. You can download the source code for the examples from the same page to see how they work.

Related

Using Physics Editor and using it's .plist Cocos2d-x V3 for better collision detection

I was working on a cocos2d-x project. Its a simple game. Everything is working right apart from collision. Though, It is working but collision is not very realistic. I browsed and discovered something called - Physics Editor. I read tutorials from - http://www.codeandweb.com. It generates a .plist of your sprite. I'm making game for android in c++.
Now the problem -
How to use that .plist with cocos2d-x V3.8. Is it a good idea to make collision detection better this way?
I want to start with box2d and chipmunk but there are no good and new tutorials. In case you have anything, Feel free to suggest. Thanks is advance !
Actually Physics Editor itself provides special C++ class for loading its plist and creating PhysicsObjects from it.
You can easily get it on github: https://github.com/CodeAndWeb/PhysicsEditor-Loaders/tree/master/cocos2d-x

How can I optimize rigid body collidsions with Ogre3D and BulletPhysics

I am developing some games with my friends, using Ogre3D and Bullet Physics.
I managed to get our game character moving (just simple run and turn).
I guess I can implement 'jumping' by this class:
btCollisionWorld::ClosestRayResultCallback res(btFrom, btTo);.
However, my big issue is collision optimization.
I tried:
adding 100~500 rigidbody objects (after we changed these to mapobject in our game)
one staticplanecollision object (ground)
one character rigidbody object
FPS for just moving on plane is 60~80 = ok. But when my character collides with any other rigidbody object, FPS is going down to 7.
I have no idea that fix this problem.
I am not useing DynamicCharacterController or KineticCharacterController.
Character is controlled by setLinearVelocity() and rigidbody->getWorldTransform().setRotation(quat) function
Some more information:
PhysicsManager::GetInstance()->getDynamicsWorld()->stepSimulation(evt.timeSinceLastFrame,8);
I've had this issue before, I don't know if that's your case, but we were implementing Damned (game), and when we modeled the kitchens we were using the stoves' meshes as collision objects (btDbvtTriangleMeshShape), and everytime the character got close to a stove the FPS went down...
The solution was to use a simple collision shape for each stove (like btCompound with a few boxes), and the FPS issue went away :)
Hope your issue is similar to this so you can solve it by reducing the complexity of the collision shapes you're using.
If this isn't the case, please, show me the code you run when handling your character (also, KinematicCharacterController is highly recommended, and moving from Bullet to PhysX is even more recommended ;D).
Best.

Actionscript - Detect simple shape in Image

I wonder if it's possible to detect a simple shape like a circle or a rectangle in an image with ActionScript 3. Can somebody guide me into the right direction or even give me a link to a good tutorial? I want to detect a logo with the webcam. Thanks in advance.
Yes, it is possible I did a ball detecting algorythm for a video. Once you access the bitmap each frame, (ex. a vector>, where uint is the color of the pixyel in vector[x][y]), it is only universal detection algorithms. Hugh transform, etc.. So you go ahead, and detect rectangles. There are lots of tutorials. Its high math.. There is also FLARManager, what can detect cool qr codes in Flash. Lee Brimelow did a great video tutorial of it.

AS3 - Moving a line through guide

I'm trying to animate a nodal with flash for teaching purposes. This is what I want to animate:
My questions:
How can I move the line through a guide?
Can guides hold z positions, so I could make the rope's top and bottom parts more real?
Can a vector image (rope) move through a guide path?
Which way is this possible, strokes or brushes?
Does as3 scripting support "decorated brush" effects?
Is there a simpler way to do this such as sandy or awake3d or beziercurves?
If you're using the IDE like CS4 or CS5 there are some menu options to do this. I only use a text editor and Flex SDK to compile. While I know what you're talking about, I can't really answer this one since I don't have the program. There's plenty of tutorials on the subject, however.
I believe the path-following tools in CS* only follow (x,y) coordinates. No Z values in the menus, but you can code them yourself. Again, I don't have the program, but from the tutorials I read it looks like no.
I suppose it could. Instead of a line drawing like you have here, you could simply use an image of one rope segment (as in a picture of rope whose length is equal to one twist of the rope), then apply transformations to get the correct 3D perspective.
Basic flash programs only draw fills. You can, however, run a shader program (called pixel bender) within flash which will draw strokes for you.
Not on it's own, no. But there is nothing stopping you from programming your own decorated brush class.
Bezier curves are probably the way to go.

hitTestObject() collide somehow not working how it should

Or that's what I think, at least.
I just began with AS3 and I'm trying to do a little game where one ball moves on its own and the other one is handled by the player. So far, so good. That works.
What isn't working is hitTestObject(); it just returns true when it's like 2 cm from the other object. Here's a picture so you can see: http://dl.dropbox.com/u/37057843/coll2.jpg
I've read that hitTestObject just creats a rectangle around the objects and then tests for collisions on those rectangles, is it because of that?
If you need any piece of code I'll deliver. I know there are some other opensource libraries/engines like Box2D to solve this in a better way, but I don't want to jump to engines directly.
Thanks for reading!
Yes, hitTestObject will use the clips bounding box.
Check out this link, it has a lot of great information as well as a class that will do what you're looking for
http://sierakowski.eu/list-of-tips/39-collision-detection-methods-hittest-and-hittestobject-alternatives.html
Direct link to the package
http://code.google.com/p/collisiondetectionkit/