6 registered members (AndrewAMD, Ayumi, degenerate_762, 7th_zorro, VoroneTZ, HoopyDerFrood),
1,268
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: newton
[Re: ventilator]
#113153
02/03/08 10:52
02/03/08 10:52
|
Joined: Aug 2004
Posts: 1,345 Kyiv, Ukraine
VeT
Serious User
|
Serious User
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
|
i had tried that Code:
vec_diff(temp_vec2.x,temp_vec.x,camera.x); // temp_vec2 from camera to target vec_normalize(temp_vec2.x,1); // lenth of temp_vec2 = 1 NewtonAddBodyImpulse(body_temp, vectorf(temp_vec2.x,temp_vec2.y,temp_vec2.z), vectorf(temp_vec.x * QUANTTOMETER, temp_vec.y * QUANTTOMETER, temp_vec.z * QUANTTOMETER) ); but the effect is similar and the origin of model if exactly in the center(just because its your model crate.mdl )
Last edited by VeT; 02/03/08 11:08.
|
|
|
Re: newton
[Re: VeT]
#113156
02/05/08 21:58
02/05/08 21:58
|
Joined: Aug 2004
Posts: 1,345 Kyiv, Ukraine
VeT
Serious User
|
Serious User
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
|
okay, going to materials... so i have bullet Code:
you = ent_create(bullet_mdl,my.x,0); you.scale_x=.5; you.scale_y=.25; you.scale_z=.25; vec_set(you.pan,my.pan); you.skill99 = newton_addentity(you, 1, NEWTON_SPHERE, Bulletforceandtorque); NewtonBodySetMaterialGroupID(you.skill99,bullet_nmat);
and box Code:
action box_weapon_test() { c_setminmax(me); my.skill99 = newton_addentity(me, 15, NEWTON_BOX, onforceandtorque); NewtonBodySetMaterialGroupID(my.skill99,box_nmat); } and collision Code:
NewtonMaterialSetCollisionCallback(nworld, bullet_nmat, box_nmat, 0, collided_ground, collided_ground2, collided_ground3); NewtonMaterialSetDefaultCollidable(nworld, bullet_nmat, box_nmat, 1); collided_ground - just beeps 1,2 and 3 times so, bullet collides with box and nothing changes and beeps...
|
|
|
Re: newton
[Re: VeT]
#113159
02/05/08 23:23
02/05/08 23:23
|
Joined: Aug 2004
Posts: 1,345 Kyiv, Ukraine
VeT
Serious User
|
Serious User
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
|
i find! Code:
my.skill99 = newton_addentity(me, 15, NEWTON_BOX, onforceandtorque); NewtonBodySetMaterialGroupID(my.skill99,box_nmat); this is bad one... Code:
NewtonBodySetMaterialGroupID(newton_addentity(you, 1, NEWTON_SPHERE, Bulletforceandtorque),bullet_nmat); this wokrs
|
|
|
|