Tuesday, July 12, 2022
HomeGame DevelopmentSuface Orientation for Raycasting - Cocos Creator

Suface Orientation for Raycasting – Cocos Creator


Hello all,

Is there a method to get the suface orientation from a raycast hit?

I mainly need to create an object at a raycast hit location (which i’m already doing) however then I need the item to be the identical rotation because the floor. So the item is flat in opposition to a floor (comparable to a bullet gap).

Thanks,
-iDev


I imagine what I’m searching for known as floor regular vector. I did discover one of many properties which is returned known as hitNormal. Though rotating or rotating from eular utilizing the hitNormal vector didn’t appear to work :thinking:

Any concepts or am I trying on the unsuitable factor? In an outdated engine I used to make use of you’d inform it the item and the vector of the purpose you wish to know the floor regular.

what you imply of hitNormal vector didn’t work? hitNormal is the traditional of the hit aircraft, in world house.

I attempted to make use of set rotation from eular however that didn’t work and I’m unsure why, it really messed it up so the node simply didn’t present after I tried it. Because the output is a vector and never a quatronion I presume from eular would have to be the best way I take advantage of the hitNormal?

Are you able to present the outcomes you could have achieved to this point?

As quickly as I get residence I’ll get as a lot data as I can togeather and do some extra testing. Thanks to your time to this point.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments