Posted By: Orange Brat
Entity placed lower with gravity... - 09/21/03 00:42
Started doodling with physics, I have a map entity, the motion is fine, but it is placed lower in the level than it is set in WED. I want it hanging from the ceiling, not 10 feet below it. Changing the earthgravity seems to affect the location...the smaller the Z the lower it gets...if I make it 0 it is ALMOST where it should be. So how do I keep it where it should be without compromising my motion?
Code:
Code:
var earthgravity[3] = 0,0,-386;
var hingeID;
var anchor[3];
var axis[3] = 1,0,0;
var allowed_angles[3] = -90,90,0;
action light_sway //level 1 hanging light
{
while(player == null) {wait(1);}
phent_settype( me, PH_RIGID, 0 );
phent_setmass ( me, 2.5, 0 );
phent_setdamping ( me, 30, 30 );
ph_setgravity( earthgravity );
waitt( 16 );
vec_set( anchor, me.x );
//anchor.z = me.z;
hingeID = phcon_add( PH_HINGE, me, 0 );
phcon_setparams1( hingeID, anchor, axis, nullvector );
phcon_setparams2( hingeID, allowed_angles, nullvector, nullvector);
}