Collision rigid body as kinematic

Software: Away3D 4.x

zkr13, Newbie
Posted: 26 March 2015 07:20 PM   Total Posts: 12

Hi there, i’m new in physics programing, I’m trying to create several objects to represent hands joints and bones controlled by leap motion device, but i’m having a really hard time finding any documentation for awayPhysics and there’s apparently none. I’ve been juggling with the Bullet documentation but with out any luck; I fond out how to create rigid bodies and make those kinematic (i think) but the listener for the collisions seems to be out of place (detects collision in places where there’s none… or may be, but i’m not aware of them) it will be fantastic to see some example of a kinematic rigid body controlled by the user, moving in all axis causing collision on other objects in the physic world. Thanks.

   

zkr13, Newbie
Posted: 27 March 2015 03:11 PM   Total Posts: 12   [ # 1 ]
_handPhalangePhysicShape=new AWPSphereShape(12);
_handPhalangeRigidBody=new AWPRigidBody(_handPhalangePhysicShape,_handPhalangeMesh,1);
_handPhalangeRigidBody.collisionFlags=AWPCollisionFlags.CF_KINEMATIC_OBJECT;
_handPhalangeRigidBody.addEventListener(AWPEvent.COLLISION_ADDEDdoCollision);

private function 
doCollision(e:AWPEvent):void{
trace
(e.target.totalForce+" "+e.collisionObject);}

//traced-> Vector3D(0, 0, 0) [object AWPRigidBody] 

Ok, i may have found the root of the problem, the object has no force, so, there is collision (not always the collision is detected, may be something with the kinematic collision flag?) but when i tried to modify the “totalForce” its seems to be a protected var, i’ll keep searching how to deal with this, any advice, apportation, help will be appreciated. Thanks.

 

   

zkr13, Newbie
Posted: 27 March 2015 06:48 PM   Total Posts: 12   [ # 2 ]

I managed to improve the collision reactions passing some values and apply those by central impulse… however, the collision still glitchy, BUT, i noticed something, the white debugging draw box is green when i’m not able to make collision with the object. what does the green color mean? Is this a BUG?

 

Image Attachments
collisionGlitch.jpg
   

zkr13, Newbie
Posted: 27 March 2015 10:38 PM   Total Posts: 12   [ # 3 ]

ok, i found something on package awayphysics.debug :

switch(obj.activationState){
case  AWPCollisionObject.ACTIVE_TAG:
 
color 0xffffff; break;
case 
AWPCollisionObject.ISLAND_SLEEPING:
 
color 0x00ff00; break;
case 
AWPCollisionObject.WANTS_DEACTIVATION:
 
color 0x00ffff; break;
case 
AWPCollisionObject.DISABLE_DEACTIVATION:
 
color 0xff0000; break;
case 
AWPCollisionObject.DISABLE_SIMULATION:
 
color 0xffff00; break;
default:
 
color 0xff0000;
 
}
debugDrawObject
(obj.worldTransformobj.shapecolor); 

it seems the object “deactivates” it self, so, if you want to be active “for ever” you must “Disable Deactivation”, the only info i’ve found about this is this: http://bulletphysics.org/mediawiki-1.5.8/index.php/Activation_States

P.S. it’s really sad how the last topics i’ve found on this forum are people asking and answering to them selfs. Hope this is helpfull to someone.

 

   

zkr13, Newbie
Posted: 30 March 2015 11:22 PM   Total Posts: 12   [ # 4 ]

Is this project dead or just the forum and the “pro help”? Btw, is the transformation matrix the only way to make a AWPShape “looks At” something… i know theres no chance i get an answer, but some times i like to talk to myself.

 

   

zkr13, Newbie
Posted: 31 March 2015 06:03 PM   Total Posts: 12   [ # 5 ]

i found an other issue, when you add .activationState=AWPCollisionObject.DISABLE_DEACTIVATION; to the rigid kinematic body it stops getting the position, so it just stands there in (0,0,0)... and when you remove it only gets the position after the “timer” set it to AWPCollisionObject.ISLAND_SLEEPING… i don’t even know why… so, basically, i still don’t know how in the best practice to create a rigid kinematic object. and probably i’ll never will, at least not in awayphysics… may be it’s time to search a library with documentation and support, it seems awayphyisics doesn’t have any.

 

   

zkr13, Newbie
Posted: 09 April 2015 08:01 PM   Total Posts: 12   [ # 6 ]

I may got it, use AWPCollisionObject.WANTS_DEACTIVATION; instead of AWPCollisionObject.DISABLE_DEACTIVATION and it worked. So the rigid body gets:

rigidBody.collisionFlags=AWPCollisionFlags.CF_KINEMATIC_OBJECT;
rigidBody.activationState=AWPCollisionObject.WANTS_DEACTIVATION

It’s really a shame how only a few get “support” on this forum and only hard core C programers are taken seriously… the rest are ignored.

 

   

therealloft, Member
Posted: 12 April 2015 08:09 PM   Total Posts: 63   [ # 7 ]

Yeah I know how you feel, seems the main as3 development has died in favour for html5 not sure why. I mean come on guys help fellow devs out or they will start shopping for alternatives!!!

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X