Author Topic: Collision Movement  (Read 124 times)

Ahmed Irfan   «   on: April 19, 2012, 05:59:14 AM »
Hi all,

I am using sphere collision for my flare3d project, I've one doubt based on that. Consider two objects A and B at Positions P1 and P2. I am Making collision between these two objects, and the two objects collided. Now I move B out of P2 to new Position P3, and now am moving A towards P2 where B was resided before, when it reaches P2 it is getting collided with B which is actually not there. It shows that Object A is getting collided with Position P2 but not with Object B.

How can we make the object collide with other object even when it is moved out of its original position.. Help us out.. Thanks

Ivan Vodopiviz   «   Reply #1 on: April 20, 2012, 12:49:10 PM »
Hi,

What are you trying to do? Collide two spheres? SphereCollision must be used to check sphere <-> mesh collisions, two spheres can't be collided. But in any case, do you have some example code of what you're trying to accomplish?

Thanks!

Ahmed Irfan   «   Reply #2 on: April 21, 2012, 06:39:41 AM »
Here is The Example code:
         private var main_object:Pivot3D;

         public var line:Pivot3D;
         public var line1:Pivot3D;

         main_object = scene.addChildFromFile("EngineFinal.f3d");

         line1=scene.getChildByName("Piston_Top04");
         line=scene.getChildByName("Piston_Trunk04");
         
         collisions=new SphereCollision(line1,7.5,new Vector3D(0, 0, 0));
         collisions.addCollisionWith(line,true);

Marcos Lazo   «   Reply #3 on: April 23, 2012, 11:16:00 AM »
Hi,
The problem is a bug in the method for change positions of CollisionPrimitive. Anyway, changing the matrix of transformations works.
You can look at the following code to solve the problems, until we fix these bugs.

http://dl.dropbox.com/u/23110110/TestSphereCollisions.txt



Thanks!!