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.

Dark GDK / Limb ray cast detection using Sparky's

Author
Message
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 30th Nov 2010 23:14
How can I do like a "pick limb" using Sparky's? I could swear there was something like that in DBP, but I can't find it and if there's a command in Sparky's that's not in the help (or I'm just overlooking), I would rather use it.

Thanks

The fastest code is the code never written.
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 1st Dec 2010 01:34 Edited at: 1st Dec 2010 01:34
I use Sparky's a lot and I could imagine two ways to achieve this. But these are just ideas, haven't tested them myself...

1) Use SC_GetFaceHit() to get the polygon that was hit by a ray cast. Then check to which limb this polygon/face belongs to. A list that contains this data could be created when the model is loaded to speed things up.

2) Create bounding boxes around each limb and check collision against these boxes. They could be standard primitive boxes that fit to a limb and glued to it.

Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 1st Dec 2010 02:17 Edited at: 1st Dec 2010 02:19
The first one may be practicle. The second one will not work since I have a limb inside a limb sometimes (actually a lot of times). Is there a DGDK funtion to get the subset info?

EDIT: Actually, if I could get a pointer to the mesh, I could do it with a DX command..... Any help?

The fastest code is the code never written.
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 1st Dec 2010 16:24
Quote: "Is there a DGDK funtion to get the subset info?"


What do you mean with subset info?

I think you can get a pointer to an object by using dbGetObject( int id ).

Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 1st Dec 2010 18:18
Quote: "dbGetObject( int id )"
I'll have a look at that. A subset in DX is the same as "limb" in DGDK.

The fastest code is the code never written.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 2nd Dec 2010 01:53
I can't find anywhere the actual LPD3DXBASEMESH. I need to be able to get a pointer to that specifically.... Unless someone can direct me to another path to get what I need. I'll keep searching and post if I find the solution....

thanks.

The fastest code is the code never written.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 2nd Dec 2010 02:35
OK. I have a method now.... I would love to see a better way since this is kinda hacky:
to set it up.
for detection.

Any thoughts? I mean it works, but I would have liked to have something a little better.

The fastest code is the code never written.

Login to post a reply

Server time is: 2024-09-28 14:05:42
Your offset time is: 2024-09-28 14:05:42