|
Re: pXent official release! (using NVIDIA PhysX)
[Re: Chris3D]
#289865
09/15/09 22:51
09/15/09 22:51
|
Joined: Oct 2007
Posts: 5,210 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
|
Hey Chris, I was usin PH_POLY, now i tried with PH_TERRAIN and it doesnt seem to be workin at all. Objects just fall thru terrains, and RemoteDebugger crashes(with PH_TERRAIN). here is the code(using PH_TERRAIN), i setup entites this way. there is a large block, and 2 terrains in level, one of them is not scaled and one of them is scaled in wed:
function main()
{
fps_max = 70;
video_mode=8;
wait(1);
pX_setgravity(vector(0,0,-9.81));
pX_SetWorldSize(0.05);
level_load("level.wmb");
pXent_settype(level_ent,3,3);
you = ent_next(NULL); // retrieve first entity
while (you) // repeat until there are no more entities
{
if(ent_type(you)==2 || ent_type(you)==3 || ent_type(you)==5)
{
pXent_settype(you,3,PH_POLY);
}
if (ent_type(you)==4){
pXent_settype(you,3,PH_TERRAIN);
}
you = ent_next(you); // get next entity
}
while(1){
DebugPicking();
wait(1);
}
}
same code with PH_POLY works but the bug above occurs(prev post, scaling issue). ____________________________________ also: is this possible: i want to make character a bit more realistic and also want to use ragdolls. So i will use sperate boxes/capsules for diffrent limbs, and make them kinematic, and will constantly set them to bone positions and they will react to physical objects right? if the answer of the question is yes, then can i turn kinematic objects to normal physical ones at runtime.(except for removing them and creating dynamic objects at their places.) like by using pxent_settype again? Then can i convert them back to kinematic again? also i can constraint 2 kinematic objects right?
Last edited by Quadraxas; 09/15/09 22:52.
3333333333
|
|
|
Re: pXent official release! (using NVIDIA PhysX)
[Re: Chris3D]
#289871
09/16/09 00:29
09/16/09 00:29
|
Joined: Aug 2008
Posts: 2,838 take me down to the paradise c...
Cowabanga
Expert
|
Expert
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
|
@Cowbanga: Can you discribe the situation more detailed? when do the obejcts hang on its place? I haven't seen such case, yet. Hang on a sec, someone has modified my name in this forum.You probably mean Cowabanga . EDIT: It's back again. Anyway, i just made a sphere entity.
Last edited by Cowabanga; 09/16/09 00:35.
|
|
|
Re: pXent official release! (using NVIDIA PhysX)
[Re: Cowabanga]
#290069
09/17/09 06:40
09/17/09 06:40
|
Joined: Sep 2003
Posts: 271 Germany
Chris3D
OP
Member
|
OP
Member
Joined: Sep 2003
Posts: 271
Germany
|
@Quadraxas: At first, you should use pXent_settype(terrain,3,PH_POLY); because it is more precisely. Secondly, when I scale the terrain in MED I don't get any offset in A7, everything fits. If I scale it per code, only my physcis terrian gets scale, but this is normal, because you can't scale terrains per code (maybe an A7 engine bug). Consequently, I can't find any scaling bugs done by my plugin. However, this function can help you to manual work against a wrong offset:
pXent_LocalOffsetEntity(terrain,0,vector(0,0,50),nullvector);
//this sets the terrain 50 quants up
(must be set after the pXent_settyp function) @rojart: I have to ask jcl about the event thing, I need to find out how the wait() functions work intern. as a workaround make a seperate function like this:
function waiter()
{
wait (random(-10));
pXent_settype(me, 0, 0);
ptr_remove(me);
}
function EventImpact()
{
waiter();
}
By the way, remove all "set(ent,SHADOW);" functions if you don't use it or you might get crashes. Greets Chris P.S.: There will be a ragdoll tutorial/testlevel.
Last edited by Chris3D; 09/17/09 07:23.
website coming soon!
|
|
|
Re: pXent official release! (using NVIDIA PhysX)
[Re: Chris3D]
#290078
09/17/09 08:00
09/17/09 08:00
|
Joined: Sep 2003
Posts: 271 Germany
Chris3D
OP
Member
|
OP
Member
Joined: Sep 2003
Posts: 271
Germany
|
Ok, I fixed the event bug and will send the new version to my customers Cheers, Chris
website coming soon!
|
|
|
Re: pXent official release! (using NVIDIA PhysX)
[Re: Chris3D]
#290153
09/17/09 15:21
09/17/09 15:21
|
Joined: Oct 2007
Posts: 5,210 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
|
thanks for the input, yes when i scale it from MED it works, i was talking aboutt scaling in WED but i also guess that it is not supposed to be scaled in WED
3333333333
|
|
|
Re: pXent official release! (using NVIDIA PhysX)
[Re: Quad]
#290245
09/17/09 21:31
09/17/09 21:31
|
Joined: Sep 2003
Posts: 271 Germany
Chris3D
OP
Member
|
OP
Member
Joined: Sep 2003
Posts: 271
Germany
|
@Quadraxas: use vec_scale(my.scale_x,1/my.scale_x); before you run pXent_settype and it should work with WED scaled terrains!
#include <acknex.h>
#include "pXent.h"
#include <default.c>
#include <d3d9.h>
function ball()
{
pXent_settype(my, PH_RIGID, 1);
pXent_setfriction(my, 0);
pXent_setelasticity(my, 10);
}
function on_mouse_left_event()
{
while (mouse_left) {wait (1);}
ent_create ("earth.mdl", nullvector, ball);
}
function main()
{
fps_max = 70;
video_mode=8;
pX_setgravity(vector(0,0,-9.81));
pX_SetWorldSize(0.05);
level_load("level.wmb");
wait(1);
pXent_settype(level_ent,3,3);
while(1)
{
DebugPicking();
wait(1);
}
}
// Skill1: body 1
// Skill2: hull 0
action set_physics()
{
vec_scale(my.scale_x,1/my.scale_x);
pXent_settype(my,my.skill1,my.skill2);
}
website coming soon!
|
|
|
Re: pXent official release! (using NVIDIA PhysX)
[Re: PigHunter]
#290371
09/18/09 17:15
09/18/09 17:15
|
Joined: Sep 2003
Posts: 271 Germany
Chris3D
OP
Member
|
OP
Member
Joined: Sep 2003
Posts: 271
Germany
|
Hi again! I am splitting up the the pXent_setmass function, into two functions:
pXent_setmass (ENTITY* , var ); //sets only the mass
pXent_kinematic ( ENTITY*, var ); // set / reset kinematics
Because, I think it is easier to understand ! I will send/release the updated version on sunday. Bye Chris P.s.:you are right pighunter, when i have more time, I will do it
website coming soon!
|
|
|
|