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.

AppGameKit Classic Chat / [BUG] ObjectSphereCast with loaded objects.

Author
Message
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 18th May 2018 14:27
I'm having a problem when using ObjectSphereCast with an object loaded with LoadObjectWithChildren.

Using the command so that it checks for all collision enabled objects (ObjectSphereCast(0,pos1x#,pos1y#,pos1z#,pos2x#,pos2y#,pos2z#,0.05) it always returns 0 even if my object is in the line of fire.

The spherecast collosion detection is working fine with generated objects (createobjectsphere, createobjectcapsule etc.) but doesn't detect a collision with a loaded .fbx model. ObjectRayCast works fine which is why I think this is a bug.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 18th May 2018 22:13 Edited at: 18th May 2018 22:21
Could it possibly be a scaling issue ?
I had a similar issue with collisions but my scaling was way off on those objects with problems.
I've also heard similar issues with faces being inside out using blender for the models.

A simple workaround is to create your own invisible collision objects and just place these at the
location of your objects you want collisions. That worked well for my night driving game and
didn't have a bad effect on the frame rates, but really depends on how many objects you have.

Apologies for repeat post I see that you have been on the blender tutorial page, just thought I
could help someone who has not only helped me so much in the past but has been a valuable
help and support person across the forums
fubar
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 19th May 2018 09:37
Thanks fubarpk. I don't think it's a scaling issue. If I cast a ray from the camera position toward the pointer position, I can perfectly detect the outline of the object, but when I try the same with sphere-casting I get nothing at all, regardless of sphere radius. I've worked around the problem by using raycasting for now, but hopefully Paul will spot this and take a look.

@Paul: I'll ping over the fbx and some example code for testing. Thanks!
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 23rd May 2018 03:05
Did paul confirm if it was a bug or not ?
fubar
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th May 2018 13:52
Bone animated collision is only implemented for ray casting, either the sphere casting posed an unsolvable problem or I simply forgot about it. I'll take another look but it might take a while to implement.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 16th Jul 2019 15:11
I ran into this issue again today. It would be really useful to have spherecast collision detection for boned models.

Login to post a reply

Server time is: 2024-04-20 05:06:04
Your offset time is: 2024-04-20 05:06:04