Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (M_D), 1,501 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Alternative zu event_entity? #15618
05/13/03 13:04
05/13/03 13:04
Joined: Nov 2001
Posts: 176
M
mss Offline OP
Member
mss  Offline OP
Member
M

Joined: Nov 2001
Posts: 176
Event_entity,event_block und event_impact funktioniert ja nur mit ent_move Anweisungen. Also sind diese Events für die Kollisionserkennung mit Physik-Entities (im Moment?) nicht brauchbar.

Gibt es irgendeine Möglichkeit festzustellen ob eine Physik-Entity kollidiert, sei es mit Levelgeometrie(z.B. Sound beim Auftreffen) oder einer anderen Entity?

Bis jetzt sehe ich nur die Möglichkeit über phent_getvelocity zwei Vektoren zwischen zu speichern und über das Punktprodukt deren Winkeländerung festzustellen. Dann weiß ich aber auch nur das meine Physik_Entity kollidiert ist, und das auch nur sehr vage.

Vieleicht mach mir das Leben auch nur unnötig schwer und es gibt schon so etwas.

Re: Alternative zu event_entity? #15619
05/14/03 03:13
05/14/03 03:13

A
Anonymous
Unregistered
Anonymous
Unregistered
A



Wenn ein Physikobjekt mit anderen Modellen kollidiert, wird ein EVENT_FRICTION fuer die betroffenen Objekte ausgefuehrt- dies passiert sehr haeufig, daher muss der Eventhandler schnell sein. TARGET enthaelt den Kollisionspunkt. Wird die Variable PH_CANCEL_CONTACT anschliessend auf einen Wert ungleich 0 gesetzt, dann wird dieser Kontakt ignoriert.

Re: Alternative zu event_entity? #15620
05/14/03 03:22
05/14/03 03:22

A
Anonymous
Unregistered
Anonymous
Unregistered
A



Marco,

could explain these:
EVENT_FRICTION
PH_CANCEL_CONTACT

In english as it sounds like what I need and there is no reference in the manual to them...

Re: Alternative zu event_entity? #15621
05/14/03 03:52
05/14/03 03:52

A
Anonymous
Unregistered
Anonymous
Unregistered
A



When a physics object collides with any models, an EVENT_FRICTION is being generated for all involved physics objects (i.e. phent vs MDL: 1 event, phent vs. phent: 2 events)
The TARGET variable is set to the point of impact. Also, if you set PH_CANCEL_CONTACT to a non-zero value inside the event handler, the physics engine will discard the contact.
A single collision can generate a large number of events therefore it is advisable to make the event handler as fast as possible.

Re: Alternative zu event_entity? #15622
05/14/03 11:57
05/14/03 11:57
Joined: Nov 2001
Posts: 176
M
mss Offline OP
Member
mss  Offline OP
Member
M

Joined: Nov 2001
Posts: 176
quote:
Originally posted by Marco Grubert:
Wenn ein Physikobjekt mit anderen Modellen kollidiert, ...

Danke, das ist was ich suchte. Wie steht es mit Kollision einer Physik-Entity und der Levelgeometrie(event_block)?

Re: Alternative zu event_entity? #15623
05/15/03 03:20
05/15/03 03:20

A
Anonymous
Unregistered
Anonymous
Unregistered
A



A physics entity colliding with the level causes an EVENT_BLOCK to be sent to the physics entity. TARGET contains the point of impact, NORMAL the surface normal and BOUNCE the estimated surface reflection vector.

---------

Wenn ein Physikobjekt mit dem Level zusammenstoesst wird ein EVENT_BLOCK an dieses Objekt geschickt. TARGET enthaelt dann den Kollisionspunkt, NORMAL die Oberflaechennormale und BOUNCE ist der Abprallvektor.

Re: Alternative zu event_entity? #15624
05/15/03 13:21
05/15/03 13:21
Joined: Nov 2001
Posts: 176
M
mss Offline OP
Member
mss  Offline OP
Member
M

Joined: Nov 2001
Posts: 176
Das mit dem EVENT_FRICTION klappt nicht so ganz.
Wenn ich meiner Physic-Entity das my.enable_friction auf on setzten will, meckert der Compiler(unbekannter Parameter enable_friction Parameter). Ohne enable_friction wird das script zwar compiled, aber es erfolgt keine Reaktion auf der Abfrage "if (EVENT_TYPE == EVENT_FRICTION)" innerhalb des EVENT_Handlers. Was dann auch logisch wäre.

Habe ich hier irgendetwas falsch gemacht?

Re: Alternative zu event_entity? #15625
05/16/03 08:12
05/16/03 08:12

A
Anonymous
Unregistered
Anonymous
Unregistered
A



Sorry, ENABLE_FRICTION is missing in A6.0- thus you can not have an event handler for phent vs. phent collisions.
I was also pondering the PH_CANCEL_CONTACT idea and it does not seem that useful anymore, as it could lead to object getting stuck halfway in between walls.
So for A6.1 ENABLE_FRICTION/EVENT_FRICTION will be defined but only for querying contact data.

EDIT: Just checked again, and phent vs. level collisions do work
code:
{
action Init()
{
phent_settype(my,ph_rigid,ph_sphere);
phent_setmass(my,4,ph_sphere);
my.enable_block= on;
my.EVENT = bounce_event;
}
function bounce_event()
{
breakpoint;
target.x= target.x; // point of impact
target.y= target.y;
target.z= target.z;
}



Re: Alternative zu event_entity? #15626
05/16/03 11:42
05/16/03 11:42
Joined: Nov 2001
Posts: 176
M
mss Offline OP
Member
mss  Offline OP
Member
M

Joined: Nov 2001
Posts: 176
Thanks Marco. With Event_Bounce i don't have any problems and for Event_Friction i'm looking forward to v6.1.

Re: Alternative zu event_entity? #15627
06/06/03 01:25
06/06/03 01:25
Joined: Sep 2001
Posts: 237
Maine, USA
J
Jason Bryant Offline
Member
Jason Bryant  Offline
Member
J

Joined: Sep 2001
Posts: 237
Maine, USA
A simple work around that may work: Use a 2nd dummy object (invisible and passable for each object that you need an event handler for. Use the dummy objects for testing as a trigger and such. Hope this makes sense. [Smile]

It does double the number of objects... just a suggestion.

Jason


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