About Store Forum Documentation Contact



Post Reply 
How to get material from PhysHit ?
Author Message
tipforeveryone Offline
Bronze Supporter

Post: #1
How to get material from PhysHit ?
As far as I know, PhysHit hitInfo; only return hitInfo.face (this is face id of source mesh)
How can I get the MaterialPtr of touched mesh of ray casting from this ?
06-25-2023 02:24 PM
Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Member

Post: #2
RE: How to get material from PhysHit ?
i would look into doing this :

create a switch for phys_hit.group

case AG_X:
ClassX*t_classX = (ClassX*)phys_hit.obj;

from there you can do custom draw of material from your class or query the mesh and grab the material, tho not sure how you would query it if there is different meshpart to get the one touched, tho i am sure its possible
(This post was last modified: 06-25-2023 06:56 PM by RedcrowProd.)
06-25-2023 06:54 PM
Find all posts by this user Quote this message in a reply
tipforeveryone Offline
Bronze Supporter

Post: #3
RE: How to get material from PhysHit ?
Yeah I want to get material on a specified mesh part of ray touch. There is a function to get material of a mesh part but no function to get mesh part from hitInfo.
06-26-2023 07:38 AM
Find all posts by this user Quote this message in a reply
Post Reply