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
0 registered members (), 18,767 guests, and 5 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
[newton] Detecting collisions, entitys and blocks #71914
04/23/06 12:07
04/23/06 12:07
Joined: Apr 2006
Posts: 41
S
style_riser Offline OP
Newbie
style_riser  Offline OP
Newbie
S

Joined: Apr 2006
Posts: 41
Im playing with newton physics collision detection. Only place can think where to detect to is:

Code:
 
function NewtonCollisionEndEvent(material)
{

//i have added this part
if ((my != p_vehicle) && (you != null)) {
// ########## do what ever i want here...
}


var sound;
var volume;
var error;

sound = NewtonMaterialGetSoundEffect (material);

if (sound) {
if (maxCollisionSpeed > MIN_IMPACT_SPEED) {
error = (maxCollisionSpeed - MIN_IMPACT_SPEED);
volume = 10 + error * error * 0.05;
if (volume > 100) {
volume = 100;
}

if (my.Skill28 < total_frames) {
my.Skill28 = total_frames + SOUND_IMPACT_DELAY;
ENT_playSOUND (my, sound, volume);
}

if (you.Skill28 < total_frames) {
you.Skill28 = total_frames + SOUND_IMPACT_DELAY;
ENT_playSOUND (you, sound, volume);
}
}
}
}



Problem is how do i detect difference between level blocks & an entity?

Re: [newton] Detecting collisions, entitys and blocks [Re: style_riser] #71915
04/23/06 23:57
04/23/06 23:57
Joined: Apr 2006
Posts: 41
S
style_riser Offline OP
Newbie
style_riser  Offline OP
Newbie
S

Joined: Apr 2006
Posts: 41
Im currently using str_for_entname() to get the objects entitiy name, if it has no name then it's a level block, it works but is there a more elegant way?


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