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.

Newcomers DBPro Corner / Sparky's collision box

Author
Message
GWL
13
Years of Service
User Offline
Joined: 2nd Jan 2011
Location:
Posted: 2nd Feb 2011 03:24
Hello,
I'm using Sparky's dll. Can anyone tell me why the collision box for my model is not centered? My model's origin is centered, but if I change the origin to his feet then the collision box fits right. But my model is then standing above the ground. (SEE ATTACTED IMAGE FOR EXAMPLE)

If its helpful, here is my player function:


Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 2nd Feb 2011 13:35 Edited at: 2nd Feb 2011 13:36
You are doing a spherecast with a radius of zero.

Add this line before your spherecast:


GWL
13
Years of Service
User Offline
Joined: 2nd Jan 2011
Location:
Posted: 3rd Feb 2011 01:02
Thanks for the response baxslash.
But that does not affect the the position of the collision box around the model. I actually already had radius# defined as you suggested as a global variable (for testing). Any way, I'm gonna abandon this type of collision detection in favor of one of these other methods:

1. Create an invisible elliptical sphere and shape it tightly around the model and use it as the collision box.

OR

2. Create legs, arms, and torso separately and attach as limbs and create a collision box for each limb.

I'll try to see if I can get one of these methods to work and then update this post on how it goes. Anyone with experience with this, feel free to give advice, as it would be greatly appreciated.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 3rd Feb 2011 05:09
I have had success fixing this using one of two methods.

1. In your modeling program, place the model halfway up on the Y axis from 0.0, so that half of it is above 0.0 and half is below 0.0. You would have to move the joints and the verts exactly the same amount. (With my program you have to move them separately).
2. If it already is positioned halfway up from 0.0 on the Y axis, and it still doesn't work, place the first joint at 0.0,0.0,0.0 (it may mean it will have to be re-rigged / animated. It might be easier to make the elliptical sphere around it.

Anyway, these methods are how I got models to work correctly in the past.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 3rd Feb 2011 10:05
Yeah, I wondered whether there might be a problem with the model but it shouldn't affect your positioning because you aren't using the model itself to detect sliding collision.

There are two problems here:
1- Positioning of the model from the spherecast
2- Collision box position is offset from model

To solve 1 you can just add a vertical offset to your collision Y but it would make more sense to try to solve 2 first by looking at how it was modelled or how it was set up. What is the code you used to set up the model using "sc_setupobject"? Did you apply any offsets to limbs or use "Fix Object Pivot"? If not then maybe you need to edit the model.

GWL
13
Years of Service
User Offline
Joined: 2nd Jan 2011
Location:
Posted: 13th Feb 2011 06:29
Quote: " If it already is positioned halfway up from 0.0 on the Y axis, and it still doesn't work, place the first joint at 0.0,0.0,0.0 (it may mean it will have to be re-rigged / animated."


Thanks LBFN, took a little bit of time to redo, but worked like charm!
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 13th Feb 2011 14:39
You're welcome; glad you got it figured out.

Good luck with your game.

LB

Login to post a reply

Server time is: 2024-11-23 03:20:19
Your offset time is: 2024-11-23 03:20:19