Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,449 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
What is the best way #428663
08/31/13 16:31
08/31/13 16:31
Joined: Aug 2011
Posts: 42
F
fabiomartins Offline OP
Newbie
fabiomartins  Offline OP
Newbie
F

Joined: Aug 2011
Posts: 42
What is the best way to check if the Physic Entity (ball) is moving or stopped?

Re: What is the best way [Re: fabiomartins] #428664
08/31/13 17:19
08/31/13 17:19
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
first call pXent_getvelocity, then check if the magnitude of the velocity is larger than 0.01 or some other value.


Visit my site: www.masterq32.de
Re: What is the best way [Re: MasterQ32] #428665
08/31/13 17:31
08/31/13 17:31
Joined: Aug 2011
Posts: 42
F
fabiomartins Offline OP
Newbie
fabiomartins  Offline OP
Newbie
F

Joined: Aug 2011
Posts: 42
Put a litle example in Lite-C please

Re: What is the best way [Re: fabiomartins] #428666
08/31/13 17:41
08/31/13 17:41
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
A little example: The grenade will explode when hitting a wall or something.
Code:
pXent_getvelocity(nade, vVel, nullvector); 
if((vec_length(vVel) - oldVel) <= -20)
{
	sv_blowGrenade(nade);
	break;
}
				
oldVel = vec_length(vVel);


Last edited by Ch40zzC0d3r; 08/31/13 17:42.
Re: What is the best way [Re: Ch40zzC0d3r] #428667
08/31/13 18:35
08/31/13 18:35
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
i would prefer a simpler solution:

[code]
VECTOR vel;
pXent_getvelocity(ent, vel, vector(0,0,0));
if(vec_length(vel) < 0.2)
{
// ent is not moving
}


Visit my site: www.masterq32.de
Re: What is the best way [Re: MasterQ32] #428668
08/31/13 18:49
08/31/13 18:49
Joined: Aug 2011
Posts: 42
F
fabiomartins Offline OP
Newbie
fabiomartins  Offline OP
Newbie
F

Joined: Aug 2011
Posts: 42
Good! Thank you for information!
This is my work (table soccer)
http://imageshack.us/photo/my-images/854/kx0i.jpg/

Now I search for a simple soluction to check if the ball hit de goal

Re: What is the best way [Re: fabiomartins] #428670
08/31/13 19:10
08/31/13 19:10
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
you can use region_check for checking if the ball is in a specific area. create a region in WED with the one name for each goal (eg. "Goal A", "Goal B")
now you can check with

Code:
if(region_check("Goal A", ent.x, ent.x) != 0)
{
// Ball is in the region/goal
}



Visit my site: www.masterq32.de
Re: What is the best way [Re: MasterQ32] #428693
09/01/13 20:10
09/01/13 20:10
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
or use pXent_settriggerflag
Quote:
This function uses the volume of a static physics entity as a trigger area that generates an ENABLE_TRIGGER event.


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

Moderated by  HeelX, Spirit 

Gamestudio download | 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