Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 14th Mar 2009 05:06
In my game, the camera is fixed at a 45 degree angle behind the player. I'm using ray casting to ghost out objects that interfere with the camera viewing the player.

This has worked so far, but now, I've hit a snag.

It seems to me that the ray cast is returning triggers as valid objects in the ray cast. Is this supposed to happen??

In my code, when the ray detects an object between the camera and the player, it will ghost the object, reposition it out of view, and run the ray cast again, until there are no more objects between the camera and player. Afterwards it repositions all the objects back to where they were, so that I am left with a line of ghosted objects and I can easily view my player at all times.

Now... to reposition the object, I use the "phy set rigid body position" command in conjunction with the results from "phy get ray cast object". However, when the ray cast detects a trigger it's returning the ID of the trigger... not a rigid body. This means, the trigger never gets moved out of the way and program freezes.


So, my question is: How do I prevent ray casts from detecting triggers?


The one and only,


HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th Mar 2009 12:10
I don't know if you use chm files or ide help file , however I have listed a htm file into groups of what command we have in physX here list of tirggers we have, if not look these up already there might be one you not tried.



Dark Physics makes any hot drink go cold.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 14th Mar 2009 22:05
I used "phy make trigger box" to create a trigger area. The ray cast I'm performing is detecting this area... I want it to ignore the trigger and ONLY return rigid bodies/softbodies. Is there a way to do that?


The one and only,


Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 15th Mar 2009 19:43
I usually use Sparky's in conjunction with Dark Physics. Raycasting in Dark Physics is just too incomplete IMO. Plus, with Sparky's, you can use a single raycast and get all the objects it intersected.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 16th Mar 2009 06:46 Edited at: 16th Mar 2009 08:15
Thanks, Airslide. Just tried Sparky's, but whenever I use the multipleRayCast command to grab all of the objects, it returns a whole BUNCH of objects that I know for a fact can't be in the ray.

I tell it to raycast from the camera's position to the player's position. I can plainly SEE the player, but it's returning anywhere from 1-40 different objects (NONE of which are the player object) when there aren't even any objects BETWEEN the player and the camera.


EDIT:
Aha! Figured it out. I never updated the object positions.
Thanks, I got it all working now


The one and only,


Login to post a reply

Server time is: 2024-11-24 19:30:10
Your offset time is: 2024-11-24 19:30:10