Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by 3run. 02/28/20 09:28
Editting
by peterhw. 02/27/20 15:20
PS1 texturing bubbling ?
by 3run. 02/27/20 13:36
enum case / if else
by danatrader. 02/27/20 00:07
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
8 registered members (Quad, 3run, AndrewAMD, Zheka, FLD, Dalla, jenGs, smamax), 965 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Emrah06, zac, DebraSteed, Ricard, Apollo1
18379 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
EVENT_ENTITY with PhysX #442584
06/25/14 21:34
06/25/14 21:34
Joined: Jun 2013
Posts: 108
Alberta, Canada
C
CanadianDavid Offline OP
Member
CanadianDavid  Offline OP
Member
C

Joined: Jun 2013
Posts: 108
Alberta, Canada
I notice that when I use the PhysX engine to move an object, the EVENT_ENTITY never triggers despite saying in the documentation that it also responds to "physics entity movement".

Consider the following code (download demo):
Code:
#include <acknex.h>
#include <ackphysx.h>

function ball_event(){
	beep();
}

action ball(){
	my.emask |= ENABLE_ENTITY;
	my.event = ball_event;
	pXent_settype (me, PH_RIGID, PH_SPHERE); // set the physics entity type
	pXent_setfriction (me,50); // set the friction on the ground
	pXent_setdamping (me,10,10); // set the damping
	pXent_setelasticity (me,50); // set the elasticity
	
	while(1){
		//c_move(me,nullvector,vector(time_step,0,0),GLIDE);
		pXent_addforcecentral(me,vector(time_step,0,0));
		wait(1);
	}
}

action hero(){
	player = me;
	while(1){
		vec_set(camera.x, my.x);
		camera.pan = my.pan;
		c_move(me,vector(key_w-key_s,key_a-key_d,0),nullvector,GLIDE);
		wait(1);
	}
}

void main() {
	physX_open();
	level_load("level1.wmb");
}

When the ball collides with the player using c_move, the event is triggered and a beep is heard. When PhysX is used, the event is not triggered. How can I trigger an EVENT_ENTITY using PhysX?

Re: EVENT_ENTITY with PhysX [Re: CanadianDavid] #442586
06/25/14 21:53
06/25/14 21:53
Joined: Jun 2007
Posts: 1,293
Hiporope and its pain
txesmi Online
Serious User
txesmi  Online
Serious User

Joined: Jun 2007
Posts: 1,293
Hiporope and its pain
Hi,
take a look to pXent_setcollisionflag.

Salud!

Re: EVENT_ENTITY with PhysX [Re: txesmi] #442597
06/26/14 09:18
06/26/14 09:18
Joined: Jun 2013
Posts: 108
Alberta, Canada
C
CanadianDavid Offline OP
Member
CanadianDavid  Offline OP
Member
C

Joined: Jun 2013
Posts: 108
Alberta, Canada
To react with the player, would I need to either register the player model as a PhysX enabled object or attach a dummy PhysX object to it for it to work? How might I attach a dummy PhysX object to the player model since I cannot modify the xyz values directly unless I first unregister the dummy object?

My current player model is not a registered PhysX object; the player is moved using c_move instructions.


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