Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TedMar, AndrewAMD), 1,067 guests, and 0 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
min/max_xyz pseudo-collision #334696
07/24/10 17:33
07/24/10 17:33
Joined: Apr 2010
Posts: 38
D
deianthropus Offline OP
Newbie
deianthropus  Offline OP
Newbie
D

Joined: Apr 2010
Posts: 38
I'm trying to detect when the player passes through a passable entity, using min_ and max_, and a convoluted series of if statements. I need help sorting out the &'s and |'s to make this work as simply as possible. (I would use a collision event, but the object must be passable, as the player is a physics entity and must continue without bouncing, as in collecting coins).

What I essentially want to do is detect whether any of the points of the bounding box of the first object is within the space of the second, but as short-hand as possible, using min_x/y/z and max_x/y/z. Does anyone have any suggestions as to how to organize that? I have been using <= and => to compare the points, but should I just use c_trace?

Re: min/max_xyz pseudo-collision [Re: deianthropus] #334857
07/25/10 16:49
07/25/10 16:49
Joined: Apr 2010
Posts: 38
D
deianthropus Offline OP
Newbie
deianthropus  Offline OP
Newbie
D

Joined: Apr 2010
Posts: 38
Update: I am now using C-trace to check for objects with skill30 (which I am using as an object type reference for WED models) along the vector from the center of the player's model (a rolling sphere) to the corners of its bounding box. This is simpler than the code i had imagined. Basically, I'm using

Code:
if(c_trace(player.x,vector(player.min_x,player.min_y,player.min_z),IGNORE_WORLD|IGNORE_FLAG2){collision_event();}



for each of the combinations of min, max, x, y, and z.

This works fairly well, however there are issues - objects well past the end of the tracing vector are detected when they are directly under the player. And perhaps I should use a wait() function to only detect passable objects every other frame, to save proc time.


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