Sign in to follow this  
duskndreamz

Physx Triggers Hyrbird Required

Recommended Posts

Help pls, am stuck at this for over a week and the solution is no where in sight.

I am trying to make a simple racing game, with some traffic in it.

The problem which i am facing is while trying to guide my own car onto a specific route, i want it to collide and stop when going on any wrong road.

Simply, i want an invisible wall to be there.
But the catch is I want traffic to be allowed to go throught there.

Is there any way in which static cbjects allow specific dynamic actors to pass through them and but collide with other dynamic actors????




Share this post


Link to post
Share on other sites
I don't recall the exact terminology used in the PhysX API, but PhysX does have the concept of object groups/collision groups/collision masks...something like that. You could put the invisible wall and player vehicle in a group together, but put the traffic vehicles in a different group. In this way, the traffic vehicles would not see the invisible walls. If PhysX uses collision masks, then your invisible wall would be given a mask something like (binary):

10000000000000000000000000000000

And your player vehicle also would have:

1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

(The other x's don't matter as long as the high order bit is set in both the invisible wall and player vehicle.)

The traffic would need to have the high order bit cleared so:

0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

You don't have to use the high order bit...any bit will do. Key is that invisible wall and player vehicle need to have the chosen bit set and traffic needs to have chosen bit cleared. Pretty simple.

Again, I haven't used PhysX in a few years, so I don't remember the exact API or whether it uses masks or group objects of some sort...the reference material should help.

Hope that helps.

Share this post


Link to post
Share on other sites
Quote:
Original post by grhodes_at_work
I don't recall the exact terminology used in the PhysX API, but PhysX does have the concept of object groups/collision groups/collision masks...something like that. You could put the invisible wall and player vehicle in a group together, but put the traffic vehicles in a different group. In this way, the traffic vehicles would not see the invisible walls. If PhysX uses collision masks, then your invisible wall would be given a mask something like (binary):

10000000000000000000000000000000

And your player vehicle also would have:

1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

(The other x's don't matter as long as the high order bit is set in both the invisible wall and player vehicle.)

The traffic would need to have the high order bit cleared so:

0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

You don't have to use the high order bit...any bit will do. Key is that invisible wall and player vehicle need to have the chosen bit set and traffic needs to have chosen bit cleared. Pretty simple.

Again, I haven't used PhysX in a few years, so I don't remember the exact API or whether it uses masks or group objects of some sort...the reference material should help.

Hope that helps.



Thanks a lot for your help, I was down with fever so couldn't try it out. I have now tried it and it indeed works.

You were spot on, as there is a concept of collision group, just that there documentation is not that elaborate and is a bit confusing for a fresher like me.


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this