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
Chiblue
15
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 23rd Jan 2010 03:36
Here is my problem, I am using DP for my Ray cast, this is my problem.. I have a wall which is about twice the height of the player... when I shoot at the wall (this is mapped as a rigid static mesh in DP)... I may or maynot get my bullet holes... but then when I shoot at different spoke on the wall, I get bullet holes...

When I dump the variables to a file my vectors are consistent, but the object it is hitting when I am not hitting the wall is a long way behind the way... i.e. z=5000, instead if z=100...

Can someone help with sopme suggestions...

This is how I am registering the wall in DP.



This is my ray cast code...



in this example the wall is object say 6, which when I get a bullet hole is the collision object, but when I do not I get other objects other than 6, and the hit distance is 4000+ instead of <100 when I hit 6.

This is my last attempt at using DP for this, I have struggled with this now for several days... Please do not respond telling me I should use sparky or NGC, NGC ray cast SUCKS, and sparkys does not have the physics control I need... I tried using Sparky and DP but to get the sparky ray cast working I have to register all my objects with Sparky, but then the DP engine cannot move them unless I perform sc_update on the objects to allow them to reposition...
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 23rd Jan 2010 12:04 Edited at: 23rd Jan 2010 12:07
welcome to physx beast, sound like you got a long way and this bit needs some help.

I'll try to help first off do you use and have the Visual debugger if not click on the link.
replace
l# = sqrt(rx# ^ 2 + ry# ^ 2 + rz# ^ 2)
with this
l# = vectorlength( rx#,ry#,rz#)

my bad, helps if I read all of some else code, looks like you are doing that bit right with first line.

worth a look at the linki below unless this where you got it from.

code found here for more info.

Dark Physics makes any hot drink go cold.
Chiblue
15
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 23rd Jan 2010 15:06
Thanks for the info, yes have building my own normalization routine for the vectors, and having the same issue, I tried the info in this forum post... I did not understand this part...

Quote: "and use the first 4 numbers

a# = 0.7071
b# = -0.7071

in 'value = phy ray cast all shapes ( x#, y#, z#, a#, b#, 0)'
the ray cast still works, BUT if you change the numbers

e.g. :
a# = 0.707 and b# = -0.707
or
a# = 0.7072 and b# = -0.7072

the ray cast ceases funtioning.
"


When I use the normal float result it works on most surfaces.,.. Yes I have the debug tool and checked all bounding surfaces and everything looks find... on those objects that fail to get a raycast response, I still get collisions with my character..

Given the other stuff I am going, DP helps a lot, but without the raycat I am out of luck using it as a solution.. Funny thing is, this is the only collision system that does not have a FPS type shooting example.. my thought is that even TGC know they have a problem with this, unless I am completely wrong.. The strange and frustrating thing is that it works on an object 90% but then for somew reason certaion parts will not work..
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 23rd Jan 2010 15:12 Edited at: 23rd Jan 2010 15:14
if you can try changing your code to use the while endwhile system as shown in the chm guide, because you are using the if statement it may have missed the collision.

plus form what saw in that like i would use the cos sin math for it in instead of direct numbers.

Dark Physics makes any hot drink go cold.
Chiblue
15
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 24th Jan 2010 03:56
I don't see a while/endwhile in the forum post code, all I see is an if...



This is inside a function called by the main loop... or am I missing something..
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 24th Jan 2010 12:21
you're correct there nothing about a while endwhile in your code.

I am on about the shooting demo in the resource files that come with PhysX, there it show how to use the collision system and what errors you may get if use wrongly.

Dark Physics makes any hot drink go cold.
Chiblue
15
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 25th Jan 2010 16:29
Maybe I am missing something but I do not have a shooting demo in my Physx folder?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 25th Jan 2010 17:26 Edited at: 25th Jan 2010 17:27
found in the information file. under getting started.

look like this.



Dark Physics makes any hot drink go cold.

Attachments

Login to view attachments
Chiblue
15
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 25th Jan 2010 20:26
I took the ray cast example and modified it to add additional boxes, changed 3 to use static mesh and 3 to use static box, I then offset them and rotated them randomly to create different normals... It works perfectly see code...I even changed the order of the object numbers i.e. lowest on top, highest on bottom.. I even changed the object creation order so the lowest were created first and vise versa... still appears to be working correclty.. obviously these are simple shapes, but with the static mess it should represent different impact locations and normals...



As far as I can tell Ray cast is working as expected in this example, so I must be doing something wrong in my code, but what.... any thoughts? this does however give me some confidence in the Ray cast solution.. I prefer it being my problem..
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 25th Jan 2010 20:53
I had ago at changing it to use the while command system and it now can show two boxes at a time?

have a look. might be me noyt understanding the code.



Dark Physics makes any hot drink go cold.
Chiblue
15
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 25th Jan 2010 21:39 Edited at: 25th Jan 2010 21:43
The reason 2 objects were on was becuase you can move the "gun" in the while loop but the color reset was not inside the same loop... as a result when you move across overlapping objects the ray cast does not intersect both but the program is still in the while and as a result it stays in the loop.. Either way it appears to work as expected... I even did the same using a complex mesh model at as the objecs on the top and it did not accurately map those objects, but when I changed "mesh" to "convex" it appears to work better... not sure why...

Chiblue
15
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 26th Jan 2010 05:24
Well here I am again... I am more confused, I built a kind of laser to follow the camera, and place a red on the ray cast hit point and norm... what seems to be happening is that based upon the angle the ray cast hits the mesh it does not recognize the hit... If I run my laser up a wall, it shows fine then I will hit a point in the wall when the ray cast goes through the object.. if I change the angle of the ray cast it shows sometimes and not others.. Take a look at the attached images... they tell an interesting story... These are DBO objects.. loaded from 3DWS..



Now I should also add that this works perfectly with both NGC and Sparky.. but as I said, DP needs to do this to be viable, I wonder if the issue is that this is custom, not PhysX function??? Which would suggest a bug!

Attachments

Login to view attachments
Chiblue
15
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 26th Jan 2010 05:28
Just before anyone asks here is the Remote Debugger image for the object at the same time I took the screen shots, as you can see the phy mesh is perfect... i.e. no holes..

Guess dust off Sparky or NGC for the raycast...

Attachments

Login to view attachments
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 3rd Feb 2010 23:26
@Chiblue

I know you may have changed to one of the other raycast system but did you ever try this.



or try it in your testing code.

Dark Physics makes any hot drink go cold.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 3rd Feb 2010 23:51 Edited at: 4th Feb 2010 00:04
are your models x or 3ds, as dark physX does not like .x but 3ds are fine and work how they should.

Dark Physics makes any hot drink go cold.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Feb 2010 00:27
here your test code changed to load two cad made object one .x and the other is 3DS.

front row is 3DS and they show new values when you move across them x ones don't

Dark Physics makes any hot drink go cold.

Attachments

Login to view attachments
Chiblue
15
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 4th Feb 2010 05:14 Edited at: 4th Feb 2010 05:16
Sorry I have been working with Leadwerks engine, kinda frustrated by these issues, I would like to move forward but with this... I guess you think I will have better luck using 3DS objects... I can give it a try..

The leadwerks engine is very nice... thier physics engine uses Newton so if you don't mind working in C++ life is good...

I will try this tomorrow night to see what happens.. thanks for the help..

Oh and yes I tried getting the first hit found but still got the objects behind... even tried reading through all collisions the got the one with the lowest distance... still did not see it...
trogdor
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: Portsmouth, VA, USA
Posted: 5th Feb 2010 04:52
HowDo, thanks for the test. I was having same problems but did not know about the .x models

They should really fix this. DP is been out for a while now to have these kind of bugs.

Last night I lay in bed looking up at the stars in the sky and I thought to myself, where the heck is the ceiling.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 5th Feb 2010 13:04
as a note it may be they way I export models in AC3D as I know thier 3DS export works fine but not found the right way for exporting .x .

worth testing the above code with models made as 3ds and .x in other modeling packages, just so that we could say this works but the other does not.

Dark Physics makes any hot drink go cold.
Chiblue
15
Years of Service
User Offline
Joined: 6th Nov 2009
Location: NE PA, USA
Posted: 5th Feb 2010 20:35
HowDo, I tried this, all the models I use are exported from 3DWS, the original on the example I showed is a .x file imported into 3DWS... so that may make sense, apart from the fact that I have several textured pimitive objects from 3DWS like boxes and spheres that are not .x, but all of these have the same issues, i.e. I get a hit in some places/angles and not in others. So I do not believe it is a problem with .X... The other consideration is that the DP collision works perfectly... i.e. I have a box that supports a ramp... the box will not report raycast from one whole side, yet in debug and when I move my body mesh into it, it causes a collision so I know that the mesh is mapped into DP correctly.. thanks I appreciate the help, but this does not appear to be my problem, unless 3DWS exports all limb objects within a DBO as a .x format... which maybe the case...

But this would not explain why the collision works...

Login to post a reply

Server time is: 2024-11-24 14:57:45
Your offset time is: 2024-11-24 14:57:45