Hi,
I'm loving Leadwerks, just wonder if someone can point me in the right direction with this problem...
Is there a way of obtaining the texture name that has been hit in a collision (in C++)?
I'm using the collision callback function and I'm aware this can identify the entities involved in a collision as well as the collision point.
However, I need to be able to find out which material has been hit in the collision, but I can't find a way of obtaining this info from the collision callback.
At the moment my level is essentially one large entity (one gmf) comprised of many submeshes with different materials. One non-programming solution would be to break down my geometry into seperate entities, so I'd know which material would be being hit because each entity would only have one material.
But before I resort to that, I was hoping to be able to get the necessary info from code. Is the only way to get such info to perform a raycast after a collision has been found, perhaps from the point of collision in the direction of the collision normal, or something? I could get surface info from a TPick then, but it doesnt sound like an ideal of doing it. Maybe there's an easier way?
Alternatively, is there a way of breaking up a large entity in Leadwerks into seperate entities in code, rather than manually exporting seperate ones in a 3D modelling app? In other words, can Leadwerks distinguish between submeshes within an entity and create new entities from them?
Thanks in advance for your help with this!