Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, VoroneTZ), 396 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
pXent_enable doesnt work #417685
02/15/13 14:21
02/15/13 14:21
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline OP
Senior Member
MPQ  Offline OP
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
Hi guys,

follwing problem has been appearing recently:
when I use the following code lines:

pXent_enable (me, 0);
vec_set (my.pan, vector (3,0,0));
pXent_enable (me, 1);

the physics entity gets automatically restored to its old angle after calling pXent_enable.
But

pXent_enable (me, 0);
vec_set (my.x, vecotr (3,0,0));
pXent_enable (me, 1);

works fine for me. The entity stays at its place after enableing the physX- engine.

So y does the angle-altering not work? Can anybody reproduce the bug?


new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
Re: pXent_enable doesnt work [Re: MPQ] #417724
02/16/13 13:35
02/16/13 13:35
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Originally Posted By: MPQ
...
the physics entity gets automatically restored to its old angle after calling pXent_enable.
...

Yes, if you use PH_CHAR, but not for static and dynamic hulls.

Try pXent_rotate(my,NULL,vector(3,0,0)); directly.

Why do you need pXent_enable if PH_CHAR was used?


Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: pXent_enable doesnt work [Re: rojart] #417887
02/19/13 09:57
02/19/13 09:57
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline OP
Senior Member
MPQ  Offline OP
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
Ye, tried out pXent_rotate, but the same problem kept the same (dont understand that). So I went back to no-physX movement in my project and everything is workin fine now. I gonna use only static physics object from now on.

Last edited by MPQ; 02/19/13 10:00.

new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
Re: pXent_enable doesnt work [Re: MPQ] #417889
02/19/13 10:20
02/19/13 10:20
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Originally Posted By: MPQ
Ye, tried out pXent_rotate, but the same problem kept the same (dont understand that)...
Any example?

pXent_rotate works fine for me, like code below:

Code:
#include <default.c>
#include <ackphysx.h>

void main()
{
	physX_open();
	
	level_load("");

	vec_set(camera->x, vector(-200, 0, 50));

	ENTITY *box = ent_create("CUBE.MDL", NULL, NULL);
	vec_set(box.scale_x,vector(5,5,.1));
	pXent_settype(box, PH_CHAR, PH_BOX);

	while(1)
	{
		draw_text("[Space] - Rotate", 5, 5, COLOR_RED);
		if (key_space)	pXent_rotate(box,NULL,vector(45,0,0));		
		wait(1);
	}
}



Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: pXent_enable doesnt work [Re: rojart] #417893
02/19/13 11:33
02/19/13 11:33
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline OP
Senior Member
MPQ  Offline OP
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
yes you are right, that works for me, too. But I am using angle and position correction for my entites in multiplayer. position correction worked so far via pXent_enable while angle correction was causing the problem above even when I used pXent_rotate the entity's angle got restored within the next frame after calling an other pXent_rotate-instruction. Maybe the pXent_rotate inside an event function caused the problem.

Nevertheless, when I managed to get through all this multiplayer stuff I gonna give physics movement an other chance!

Last edited by MPQ; 02/19/13 13:07.

new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
Re: pXent_enable doesnt work [Re: MPQ] #417894
02/19/13 11:39
02/19/13 11:39
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
rojart@ I faced this problem as well. Try to register object as a PH_CHAR, then move it, after that unregister it and change the angle via vec_set, then wait for one frame and register is as a PH_CHAR again. When I was making respawn system, I've faced this problem, that PH_CHAR (at least what I've noticed) doesn't change the angle.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: pXent_enable doesnt work [Re: 3run] #417896
02/19/13 11:50
02/19/13 11:50
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Hi,

PH_CHAR only have a position, CCT Controller doesn't rotate (internally). If you want to have a CCT that can be rotated, you need to use a kinematic actor.

Re: pXent_enable doesnt work [Re: 3dgs_snake] #417908
02/19/13 13:11
02/19/13 13:11
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline OP
Senior Member
MPQ  Offline OP
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
thx guys, good to know! So it was the right desicion to turn back to non-physics movement in my case.


new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
Re: pXent_enable doesnt work [Re: MPQ] #417911
02/19/13 13:23
02/19/13 13:23
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
That really depends on you. What you can do is create a hidden proxy CCT for physX interactions (like a simple box mirroring the size of real character) and copy its position into another visual entity (The real entity with the details you like), you are then free to rotate it as you like (Only pan rotation is recomended because CCT has a fixed up vector (0, 0, 1)).


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1