Ok, I checked out the studiomdl source to find out how to go about doing
this. It looks like when the collision model is built, it first gets
the vertices, creates a convex hull, and then makes the final collision
element. That's no good so I altered it to take the vertices and turn
them into triangles using the "Poly Soup" functions and then build the
collidable from the soup where I can assign a material id per face.
Unfortunately, only a few of the triangles are actually where they
should be with some having vertices that can't possibly be right. The
model reports 72 vertices, but then the original function to turn the
vertices into convex hulls only reports 14 non-duplicate vertices. If I
try using all 72, it outputs yellow text errors in the command window.
Can you offer any advice? My brain is fried for now, but I suppose it's
just a matter of messing with it until it works. I only hope that the
exported .phy file is actually saving the material index for the faces.
Jay Stelly wrote:
The collision models built by the MDL/studiomdl path have the same
low-level features as the ones built in Hammer. But the tools do not
put per-face materials on the collision models. So you would have to
modify the model compiler or do this in a post-process in your mod. At
runtime, there is a 7-bit material index available per triangle on any
collision model. In vbsp, the world model compiler builds a table of
the different surfaceprops used by the world and stores an index into
that table on each triangle. You could do the same for your models, but
currently our tools do not do this.
Jay
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Saturday, September 03, 2005 8:53 AM
To: [email protected]
Subject: [hlcoders] Model Surface Properties
I want to be able to group faces/triangles of a collision
mesh in one of my models into separate groups. Inside my
mod, I want to be able to tell from a trace which group of
faces was hit by the trace. The closest thing I can see at
doing that is by looking at the "surface" (csurface_t) of the
trace. This doesn't give me much information, but from there
I can use "surface.surfaceProps" to get to surfacedata_t.
From there, I can get to "surfacegameprops_t" which has an
interesting variable named "material".
I was hoping from that I could get information about the
material assigned to the collision mesh's faces.
Unfortunately, the entire model yields the same material no
matter what texture is assigned to it, and it looks like it's
intended for a material defined in Hammer. I'd rather not
use hitboxes, but I will if that's the only alternative.
_______________________________________________
To unsubscribe, edit your list preferences, or view the list
archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders