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.

Author
Message
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 20th Mar 2018 15:17
Is there any polygon collisions in AGK1 I have looked through the docs to no avail it seems there are loads of shapes but no poly collisions?

-EdzUp
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 20th Mar 2018 15:55 Edited at: 20th Mar 2018 15:59
does that work with 3d objects?

https://www.appgamekit.com/documentation/Reference/3DPhysics/SetObjectShapeStaticPolygon.htm

seems to be OK for asteroids etc
-EdzUp
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 20th Mar 2018 18:16
FYI: Polygon collision shapes are for STATIC OBJECTS ONLY!
The coffee is lovely dark and deep,and I have code to write before I sleep.
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 29th Apr 2018 20:26
Is there something I am doing wrong as I still pass through objects, yes I am a newb to physics collisions as I used to use a simple distance algorithm or bounds check.

On the players ship (which doesnt move) I have:


And for the asteroids which do move depending on the players angle I have:


Unfortunately I dont collide with anything and just fly straight through :/

Anyone have any ideas on this one I have trawled the forum briefly but to no avail.
-EdzUp
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 29th Apr 2018 21:14
SetObjectShapeStaticPolygon is for static objects only... that's objects that don't move... like landscapes and walls. Playership and asteroids don't count. Instead of using physics, take a look at raycasting for your collision tests.
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 29th Apr 2018 21:18
Thanks CJB will take a look
-EdzUp
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 1st May 2018 03:23 Edited at: 1st May 2018 18:17
To have collisions with 3d objects you need to raycast

Collisions between two objects

Collision between a Sprite and a Mesh Object
Technically raycasting cant be used here so this function checks if the sprites vectors would intercept with the mesh


Object raycast help
https://www.appgamekit.com/documentation/Reference/3D/ObjectRayCast.htm
fubar
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 1st May 2018 07:08
Thanks fubarpk will definitely dig into those and get the collision sorted
-EdzUp

Login to post a reply

Server time is: 2024-11-23 20:05:46
Your offset time is: 2024-11-23 20:05:46