This link has been bookmarked by 3 people . It was first bookmarked on 28 Aug 2007, by Ako Z°om.
-
27 Mar 08
-
28 Aug 07
-
The compile tools need a QC file containing model information
-
Unlike a regular brush, any
$surfacepropset in the prop's material (.VMT) files is ignored; instead, it is set here in the .QC file. -
-
if it was UV-mapped using
pcgmag.tga, the model will use the materialpcgmag.vmt. You can use multiple texture files on the same model. -
UV map the model in Blender will be used as the name of the material file for the model.
-
$texturegroup skinfamilies { { "pcgmag" } { "pcgmag_cover2" } }
-
Adding collisions
-
Complex collision models
-
But to make it a non-convex object, such as a table, we have to be more careful if we want the prop to collide with things as we would expect.
-
each leg is a tapered cuboid
-
As before, we need a table_idle.smd file to define the idle animation, which can be identical to the pcgmag_idle.smd file we used above.
Now we need a .qc file for the table prop:
$modelname rof/table.mdl $cdmaterials "models/rof" $scale 12.0 $body studio "table.smd" $sequence idle "table_idle" fps 1 $staticprop $surfaceprop "Wood_Furniture" $collisionmodel "table_phys.smd" { $automass $concave } $keyvalues { "prop_data" { "base" "Wooden.Large" } }Note the differences from before. We've upped the scale a little, and set the $surfaceprop to "Wood_Furniture" and the prop data to "Wooden.Large" to reflect the type of prop we're making. In the $collisionmodel section, instead of the $mass command, we've used $automass. This makes the model compiler compute a mass for the object based on its size and material type. We could instead have explicitly specified the object's mass with the $mass command as before.
We've also added the $concave command to that section. This makes the compiler build a non-convex collision mesh for each part of the table_phys.smd file, rather than lump them all together in one convex shape. We can tell if this has worked when compiling the .qc file.
-
$concave command
-
check the collision model by using the model viewer (
hlmv.exe). On the "physics" tab, click the Highlight button and the collison mesh shows as a red wireframe. If we've got it right, it should look like the picture on the left: the wireframe follows each part individually. If we've got it wrong, it might look the picture on the right: the wireframe is a single shape wrapping the whole object.
-
-
01 Jun 07
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.