Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, howardR), 1,001 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 3 of 4 1 2 3 4
Re: AckphysX3 development thread [Re: Rackscha] #416226
01/29/13 12:54
01/29/13 12:54
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline OP
Senior Member
3dgs_snake  Offline OP
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Ok, ok, I'll try blush

Re: AckphysX3 development thread [Re: 3dgs_snake] #420979
04/08/13 05:03
04/08/13 05:03
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline OP
Senior Member
3dgs_snake  Offline OP
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Updated physX3 plugin ( v0.90.2.0 - physX 3.2.2 ).

The main features are :
  • Some bugfixes (Update loop, CCT, capsulecheck)
  • More stable
  • Added :
    • pX3_gpusupport : Check GPU support
    • New functions for raycast with one additional ignoreFlag parameter (pX3_*_ignore) that can be used to filter entities (PX_IGNORE_ME, PX_IGNORE_YOU, PX_IGNORE_FLAG2, PX_IGNORE_PASSABLE)
    • ...
  • Removed watermark (the plugin is free for non commercial use)

Last edited by 3dgs_snake; 04/08/13 05:13.
Re: AckphysX3 development thread [Re: 3dgs_snake] #420989
04/08/13 11:05
04/08/13 11:05
Joined: Jan 2013
Posts: 17
B
BySharDe2 Offline
Newbie
BySharDe2  Offline
Newbie
B

Joined: Jan 2013
Posts: 17
Excellent!
BTW, what is the relation between nowaday PhysX plugin and "native" acknex's PhysX plugin ?

Last edited by BySharDe2; 04/08/13 11:06.
Re: AckphysX3 development thread [Re: BySharDe2] #420990
04/08/13 11:17
04/08/13 11:17
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline OP
Senior Member
3dgs_snake  Offline OP
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Hi,
"Native" acknex's physX plugin uses physX 2.8.5, this plugin uses physX 3.2.2. Internally, physX 3.x is not the same as physX 2.x but I tried to make them look the same when used (similar function names ex pX3ent_settype in ackphysX3 and pXent_settype in ackphysX). There are also many additional things, like better cct, scenequeries (raycast, sweep, overlap) or a different vehicle implementation. I'm working on a better documentation and guide/tutorial.

Re: AckphysX3 development thread [Re: 3dgs_snake] #420992
04/08/13 12:01
04/08/13 12:01
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir
Dude... You are unbelievable! i am still using a7 and it works very well with a7. You save my life. laugh

Re: AckphysX3 development thread [Re: Emre] #420998
04/08/13 13:14
04/08/13 13:14
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline OP
Senior Member
3dgs_snake  Offline OP
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Good.

Re: AckphysX3 development thread [Re: 3dgs_snake] #421015
04/08/13 15:28
04/08/13 15:28
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir
Okay. i think there is little bug with 3.2.2. (20130408)

pX3ent_setcollisionflag is doesn't work with null pointer.
pX3ent_setcollisionflag(me,NULL,PX_PF_NOTIFY_TOUCH);

but it work's in previous version (20121008)
sorry for bad english.

Re: AckphysX3 development thread [Re: Emre] #421046
04/09/13 04:44
04/09/13 04:44
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline OP
Senior Member
3dgs_snake  Offline OP
Senior Member

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

That's strange, I thought that the bug was in the previous versions, for me it is working.

Try the code bellow (create a level in WED with a simple box in the center)
Code:
#include <acknex.h>
#include <default.c>
#include <ackphysX3.h>

#define PRAGMA_PATH "C:\\Program Files (x86)\\GStudio8\\templates\\sounds";

SOUND *snd_left="shot1.wav";
SOUND *snd_impact = "aiimpact.wav";
SOUND *trigger_enter = "tap.wav";
SOUND *trigger_leave = "splash.wav";

ENTITY *cube1 = NULL;
ENTITY *cube2 = NULL;
ENTITY *trigger = NULL;

// Impact event : 
void impact_event()
{
   if (event_type == EVENT_FRICTION && hit->flags & PX_EVENT_TOUCH_LOST)
   {
      ent_playsound(me, snd_left, 100);
   }
   else if (event_type == EVENT_FRICTION && hit->flags & PX_EVENT_TOUCH_FOUND)
   {
      ent_playsound(me, snd_impact, 100);
   }
}

// Cube action : 
void cube_action()
{
   while(trigger == NULL || cube2 == NULL) wait(1);
   pX3ent_settype(me, PH_RIGID, PH_BOX);
   set(me, SHADOW);
   
   pX3ent_setcollisionflag(me, NULL, PX_PF_NOTIFY_TOUCH);
   //pX3ent_setcollisionflag(me, cube2, PX_PF_NOTIFY_TOUCH_LOST);
   
   me->event = impact_event;  
}

// Trigger event : 
void trigger_event()
{
   if (event_type != EVENT_TRIGGER)
      return;
   
   if (hit->flags & PX_EVENT_TOUCH_FOUND)
      ent_playsound(me, trigger_enter, 100);
   
   if (hit->flags & PX_EVENT_TOUCH_LOST)
      ent_playsound(me, trigger_leave, 100);
}

// Trigger action :
void trigger_action()
{
   while(cube1 == NULL || cube2 == NULL) wait(1);
   pX3ent_settype(me, PH_STATIC, PH_BOX);
   
   pX3ent_settriggerflag(me, PX_TF_TRIGGER_ENABLE, 1);
   
   me->event = trigger_event;
}

// App entry point
void main()
{
   // Open physX : 
   physX3_open();
   
   // Level config : 
   shadow_stencil = 2;
   
   // Load level : 
   level_load("IMPACT_LEVEL.WMB");
   vec_set(camera.x, vector(-253, -6, 128));
   camera.tilt = -26;
   
   // Create cube : 
   cube1 = ent_create(CUBE_MDL, vector(0, 0, 300), cube_action);
   cube2 = ent_create(CUBE_MDL, vector(0, 0, 30), NULL);
   trigger = ent_create(CUBE_MDL, vector(0, 0, 60), trigger_action);
   vec_set(trigger->scale_x, vector(2, 2, 2));
   set(trigger, TRANSLUCENT);
   
   pX3ent_settype(cube2, PH_RIGID, PH_BOX);
   
   wait(-5);
   
   pX3ent_addforcecentral(cube1, vector(0, -5, 10));
   
   diag(str_printf(NULL, "Cube1:%X, Cube2:%X, Cube3:%X\n", handle(cube1), handle(cube2), handle(level_ent)));
}


Re: AckphysX3 development thread [Re: 3dgs_snake] #421048
04/09/13 05:48
04/09/13 05:48
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir
Thanks. Yes your code is works but i don't want to use trigger action. Try this code:

Code:
#include <acknex.h>
#include <default.c>
#include <ackphysX3.h>

#define PRAGMA_PATH "C:\\Program Files\\GStudio8\\templates\\sounds";
#define PRAGMA_PATH "C:\Program Files\\GStudio8\templates\models";

#define PRAGMA_PATH "C:\\Program Files (x86)\\GStudio8\\templates\\sounds";
#define PRAGMA_PATH "C:\\Program Files (x86)\\GStudio8\\templates\\models";

SOUND *snd_impact = "aiimpact.wav";

ENTITY* terrain_ent;


// Impact event : 
void impact_event()
{
	if (event_type == EVENT_FRICTION)
	{
		ent_playsound ( my, snd_impact,100);
	}

}


// App entry point
void main()
{
	// Open physX : 
	physX3_open();
	
	// Load level : 
	level_load("");
	vec_set(camera.x, vector(-253, -6, 128));
	camera.tilt = -26;
	
	// Create cube : 
	terrain_ent = ent_create("water.hmp", vector(0, 0, 0), NULL);
	pX3ent_settype(terrain_ent, PH_STATIC, PH_TERRAIN);
	
}

VECTOR p_target;
VECTOR kick_vec;
void on_space_event()
{
	p_target.x=camera.x+cos(camera.pan)*cos(camera.tilt)*50;
	p_target.y=camera.y+sin(camera.pan)*cos(camera.tilt)*50;
	p_target.z=camera.z+sin(camera.tilt)*50;
	
	you=ent_create(CUBE_MDL, p_target.x, NULL);
	pX3ent_settype(you, PH_RIGID, PH_BOX);
	you.emask|=(ENABLE_FRICTION);
	pX3ent_setcollisionflag(you, NULL,PX_PF_NOTIFY_TOUCH);
	
	kick_vec.x=100;
	kick_vec.y=0;
	kick_vec.z=0;
	vec_rotate(kick_vec,camera.pan);
	pX3ent_addvelcentral(you, vector(kick_vec.x, kick_vec.y, kick_vec.z));
	you.event=impact_event;
	
}



it only works in the previous version. (0.85.0)

Re: AckphysX3 development thread [Re: Emre] #421050
04/09/13 07:00
04/09/13 07:00
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline OP
Senior Member
3dgs_snake  Offline OP
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
laugh Yes, you found the bug I was talking about. NULL is used only for level geometries (level_ent). Here, you are creating a terrain, called terrain_ent. So to enable event between those two entities, you need to change

Code:
pX3ent_setcollisionflag(you, NULL,PX_PF_NOTIFY_TOUCH);



to

Code:
pX3ent_setcollisionflag(you, terrain_ent,PX_PF_NOTIFY_TOUCH);



In the previous version, event is always called after you used an entity to register for an event, even if the entity is colliding with a different entity.

Page 3 of 4 1 2 3 4

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