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.

DarkBASIC Professional Discussion / Collision on animated objects?

Author
Message
Bluespark
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location:
Posted: 13th May 2011 20:50
For example I have a humanoid 3d model. I need to check for accurate collision while the character is walking. How would I do this?
Is there a method that works with Enhanced Animation?
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 14th May 2011 10:30
What do you use to check for accurate collision when your character isn't animated?


Tell me if there's a broken link to images in a thread I post, and I'll fix 'em.
Bluespark
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location:
Posted: 15th May 2011 08:18 Edited at: 15th May 2011 08:24
I don't use accurate collision when the character isn't animated. The character is always animated.

I use a ellipsoid to check collision with the character, but I would like to use a collision method that accurately checks for bullet collision with the character.

EDIT: I just thought of some obvious ideas, which involve excluded objects and Sparky. However, for optimization, I would like not to do this method.
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 15th May 2011 15:01 Edited at: 15th May 2011 15:02
I'm not sure why you'd need to use complex collision for the character (edit: oh right, for detection of bullet hits and such), usually it just suffices to use a cylinder. If you have collision for separate legs your character is likely to get stuck in places.



Support a charitable indie game project!
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 15th May 2011 19:07 Edited at: 15th May 2011 19:07
The only way without writing a whole new plugin is to make a new object for each limb in the original object. You can exclude these and glue them to the limbs of the original. You can then use sparky's to detect collision with them.

If this is the method you thought of, then it IS optimised. Believe it or not it's actually the fastest way to do it. I talked to Paul at one of the TGC conventions about it and he said if he did add support for this natively to his plugin, it's effectively how he'd do it.

Simply having more objects loaded doesn't cause a slow-down as long as they are excluded and there is enough memory (and there is always enough memory even on an old PC now)

[b]
Bluespark
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location:
Posted: 15th May 2011 21:31
Oh, I see.

So for instance let's say I have a thousand spheres and exclude them all. This won't cause any slowdown in the loop?
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 16th May 2011 01:37 Edited at: 16th May 2011 01:38
Correction: It shouldn't make a difference. In actual fact I just tested it and it makes a small difference, but I can still have 1000 spheres loaded at 1000 fps. Seems like a bug in DBPro. It shouldn't do ANY additional processing for objects which are both hidden and excluded...

[b]
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 16th May 2011 02:12 Edited at: 16th May 2011 02:19
Hi there.

I made time ago, an example to check health depending on bullet impacts. It was just checking if there was any bullet collision and comparing if the bullet was higher than object position y(enemy)...

if object collision(enemy,bullet) and object position y(bullet)> object position y(enemy)+30 then health=health-30

So we can determine how much damage we do to the enemy or how much they do to the player.



Cheers

I'm not a grumpy grandpa
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 16th May 2011 04:15
Definitely using sparkys you would need to split the object up into zones. Even if you had the collision zones following the object around you probably wouldn't notice much of a slow down in your code as I've noticed lately with my free project. All the zones could easily be put into a group and you just check a bullets collision and retrieve the zones number, ie 1 for the head, 2 for the left arm, etc.
I'm not sure if you can do this with limbs but it's worth looking into, if not then you would need some way of making the collision zones fit.
Apart from that, you could use the Y value of the object and the collision vector and compare the height value. +50=head, -50=legs...

Warning! May contain Nuts!
Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 19th May 2011 19:22
what I did for more accurate and optimized bullet collision is I only checked my raycast when I fired the weapon, meaning that was the only time i updated sparkys
Matty H
17
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 19th May 2011 20:31
I would use box/capsule collision and only in the case that a raycast hits I would then position/orientate small limb sized box/sphere objects where the limbs are and raycast again.

You could have just a few sets of these smaller boxes/spheres and use them for all characters when needed.

Login to post a reply

Server time is: 2026-07-10 16:13:05
Your offset time is: 2026-07-10 16:13:05