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 AppGameKit Corner / My 3D collision example , is there a more precise way ?

Author
Message
micky4fun
11
Years of Service
User Offline
Joined: 15th Sep 2013
Location: uk essex
Posted: 5th Jun 2016 06:06 Edited at: 5th Jun 2016 06:20
Hi All
Being 100% new to 3D I am tinkering around at the moment ,
was looking for a collision between say one bullet and some objects , in this case rectangle boxes

I have used the ObjectSphereCast command , but not 100% accurate , did try the raycast command but could not get that perfect either
wonder if someone knew the right way of doing it without using the physics commands

thought also this would come in handy to all newbies that are having trouble with Object hit detection's

use the WSAD to move small box ( bullet ) the hit rectangles will change to red once hit
if moving bullet left to right the detection seems fine , but as using a sphere detection when moving up and down in a corner of an object
the detection is a bit late , has to overlap a bit.

Thanks
Mick

29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 5th Jun 2016 17:49
As far as the collision is concerned you have a movable sphere colliding with boxes so, yes, the movable white cube would have to overlap at the corner before a collision was detected. The sphere cast does not take into account the shape or size of the box or object the player is moving.

I tend to use sphere casting when I have a complex object but don't need/want polygon perfect collision, for example a humanoid model in a 3rd person shooter.

If you want perfect box-to-box collision you might want to look at the physics commands. I've not had a chance to use them so I couldn't say how it all works.
Hover Car Race Challenge! - available now on Google Play
Invaders of the 29th Dimension - available now on Google Play
Find me on indieDB
micky4fun
11
Years of Service
User Offline
Joined: 15th Sep 2013
Location: uk essex
Posted: 6th Jun 2016 04:24 Edited at: 6th Jun 2016 04:25
Hi All

Thanks 29 games ,
Just making sure I was not missing any easy way of doing it , but after reading your reply I now think sphere casting is going to be fine
for my humble programming skills.


mick

Login to post a reply

Server time is: 2024-11-22 04:03:18
Your offset time is: 2024-11-22 04:03:18