HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [Resolved] Raycasting & 3D Math  (Read 1543 times)

sebako

  • General Accounts
  • *
  • Posts: 6
    • View Profile
[Resolved] Raycasting & 3D Math
« on: Oct 30, 10, 11:19:30 PM »

Hey Guys,

i need to find out wether a character is grounded or not, therefor i wanna use a simple raycast from the character down and check it's length. Can anybody point me in a direction where to find methods for that?
I have found RaycastPhysX() , but i didn't find any documentation or something regarding this method or its parameters.

any help appreciated

cheers
« Last Edit: Nov 02, 12, 10:54:06 PM by HE-Cooper »
Logged

HE-CHRISTOPHER

  • HeroEngine
  • *****
  • Posts: 424
    • View Profile
Re: Raycasting & 3D Math
« Reply #1 on: Nov 01, 10, 08:21:46 AM »

Easiest is probably...

Code: [Select]
external function GetGrounding(paramPos as Vector3,checkAbove as Float,walkSlope as Float,groundY references Float) as Boolean

It performs a raycast from the specified position attempting to collide with a surface upon which you can reasonably stand (based on the specified max walkslope). If it fails, it performs a secondary check using the position + checkabove in case the original position was perhaps slightly below the surface. It it successfully collides it returns (by reference) the height (groundY) and returns false if it failed to ground.
Logged
Christopher Larsen
CTO
HeroEngine

sebako

  • General Accounts
  • *
  • Posts: 6
    • View Profile
Re: Raycasting & 3D Math
« Reply #2 on: Nov 01, 10, 01:51:52 PM »

ah thank you, havn't seen that function. :)

 :-*
Logged