Posted By: nacrug
PhysX door with frame breakable. using PH_HINGE constraint - 03/12/12 12:42
Hi everyone,
I've done my research for shadows and i started to physX plugin with very basic constraints.
What i try to achieve is: there is door with frames and when i press the button i want to door open. However, when i try to use force over break limit of constraint, i want to break door from constraint and fall down to floor. But even i try a lot of things i couldn't be successful.
Here it is my constraint definition;
pXcon_add ( PH_HINGE,door ,doorFrame , 0);
pXcon_setparams1(door, vector(-10.50,0,34.5), vector(0,0,-1), vector(10,10,0));
pXcon_setparams2(door, vector(-90,90,1.5), NULL, NULL);
My door action;
action door()
{
pXent_settype(my,PH_RIGID,PH_CONVEX);
pXent_setfriction(my, 101);
pXent_setelasticity(my, 0);
pXent_setdamping ( my, 100,100 );
//pXent_setmass(my,1);
door = my;
// wait(1);
}
My door frame action;
action doorF()
{
pXent_settype(my,PH_STATIC,PH_POLY);
pXent_setfriction(my, 101);
pXent_setelasticity(my, 0);
pXent_setdamping ( my, 100, 100 );
// pXent_setmass(my,10);
doorFrame = my;
//wait(1);
}
My force functions:
function add_force()
{
VECTOR temp;
temp.x= 0; temp.y= -0.5; temp.z= 0;
// now myCrate will continue to move along the x axis forever, with constant speed
//pXent_addvelcentral( door, temp );
pXent_addforcecentral( door, temp );
wait(1);
}
function add_forceWithBreak()
{
VECTOR temp;
temp.x= 0; temp.y= 50; temp.z= 0;
// now myCrate will continue to move along the x axis forever, with constant speed
//pXent_addvelcentral( door, temp );
pXent_addforcecentral( door, temp );
wait(1);
}
What it is wrong with that. I couldn't figure out cause. However, when door is moving with little force. When i use "pXcon_remove(door);" it is falling down correctly.
Thanks
Nacrug
I've done my research for shadows and i started to physX plugin with very basic constraints.
What i try to achieve is: there is door with frames and when i press the button i want to door open. However, when i try to use force over break limit of constraint, i want to break door from constraint and fall down to floor. But even i try a lot of things i couldn't be successful.
Here it is my constraint definition;
pXcon_add ( PH_HINGE,door ,doorFrame , 0);
pXcon_setparams1(door, vector(-10.50,0,34.5), vector(0,0,-1), vector(10,10,0));
pXcon_setparams2(door, vector(-90,90,1.5), NULL, NULL);
My door action;
action door()
{
pXent_settype(my,PH_RIGID,PH_CONVEX);
pXent_setfriction(my, 101);
pXent_setelasticity(my, 0);
pXent_setdamping ( my, 100,100 );
//pXent_setmass(my,1);
door = my;
// wait(1);
}
My door frame action;
action doorF()
{
pXent_settype(my,PH_STATIC,PH_POLY);
pXent_setfriction(my, 101);
pXent_setelasticity(my, 0);
pXent_setdamping ( my, 100, 100 );
// pXent_setmass(my,10);
doorFrame = my;
//wait(1);
}
My force functions:
function add_force()
{
VECTOR temp;
temp.x= 0; temp.y= -0.5; temp.z= 0;
// now myCrate will continue to move along the x axis forever, with constant speed
//pXent_addvelcentral( door, temp );
pXent_addforcecentral( door, temp );
wait(1);
}
function add_forceWithBreak()
{
VECTOR temp;
temp.x= 0; temp.y= 50; temp.z= 0;
// now myCrate will continue to move along the x axis forever, with constant speed
//pXent_addvelcentral( door, temp );
pXent_addforcecentral( door, temp );
wait(1);
}
What it is wrong with that. I couldn't figure out cause. However, when door is moving with little force. When i use "pXcon_remove(door);" it is falling down correctly.
Thanks
Nacrug