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 / 3d Object Collision

Author
Message
aviles22
10
Years of Service
User Offline
Joined: 1st Dec 2013
Location: New Jersey, USA
Posted: 12th Oct 2014 18:22
In my FPS game I have a dummy object obj. Which is my player hidden slightly behind the camera and when thereis movement or rotation the camera follows my player. DB made it a little easier to detect collision with other players to stop movement when collision was detected. How do I do a simple collision test between my hidden player against other players in AppGameKit? Any examples appreciated in advance.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 12th Oct 2014 18:56 Edited at: 12th Oct 2014 18:58
this combination?

SetObjectCollisionMode
SetObjectVisible
integer ObjectSphereCast( objID, oldx, oldy, oldz, newx, newy, newz, radius )
integer ObjectSphereSlide( objID, oldx, oldy, oldz, newx, newy, newz, radius )

GetObjectRayCastNumHits
GetObjectRayCastHitID
GetObjectRayCastDistance
GetObjectRayCastBounceX
GetObjectRayCastBounceY
GetObjectRayCastBounceZ
GetObjectRayCastNormalX
GetObjectRayCastNormalY
GetObjectRayCastNormalZ
GetObjectRayCastSlideX
GetObjectRayCastSlideY
GetObjectRayCastSlideZ
GetObjectRayCastX
GetObjectRayCastY
GetObjectRayCastZ

http://www.appgamekit.com/documentation/Reference/3D.htm

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini
aviles22
10
Years of Service
User Offline
Joined: 1st Dec 2013
Location: New Jersey, USA
Posted: 12th Oct 2014 19:16
Yes I def saw those commands but they lack any good examples.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 12th Oct 2014 19:54 Edited at: 12th Oct 2014 19:56
a raycast example from me is here.
a ray is similar a line.
http://www.appgamekit.com/documentation/Reference/3D/ObjectRayCast.htm

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini
aviles22
10
Years of Service
User Offline
Joined: 1st Dec 2013
Location: New Jersey, USA
Posted: 12th Oct 2014 20:55
ObjectSphereCast( objID, oldx, oldy, oldz, newx, newy, newz, radius )

So would oldx, oldy, oldz be the current players position and
newx, newy, newz be the position of the players im testing the
collision against?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 12th Oct 2014 21:51 Edited at: 12th Oct 2014 21:52
if u use objID=0 for all the new x,y,z is the target you want go,
~ line of sight, the radius make a tube, all what collides
with it is collected in a collision list.
you can use a helper object to find the target position.
u can set same player pos./rotate then move it local along a axis,
get the world position of it.

ray to each player or other objects would be also possible but it is slower.

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini

Login to post a reply

Server time is: 2024-11-25 10:00:08
Your offset time is: 2024-11-25 10:00:08