Class MaterialCollision
Namespace: ValveResourceFormat.IO
Assembly: ValveResourceFormat.dll
The collision that faces with a material compile to in a map.
public sealed class MaterialCollisionInheritance
object ← MaterialCollision
Constructors
MaterialCollision(Material)
Initializes a new instance of the MaterialCollision class with the collision faces with a material compile to.
public MaterialCollision(Material material)Parameters
material Material
The material of the faces.
MaterialCollision(IReadOnlyDictionary<string, long>, IReadOnlyDictionary<string, string>)
Initializes a new instance of the MaterialCollision class with the collision faces with a material that has these attributes compile to.
public MaterialCollision(IReadOnlyDictionary<string, long> intAttributes, IReadOnlyDictionary<string, string> stringAttributes)Parameters
intAttributes IReadOnlyDictionary<string, long>
The integer attributes of the material, see Material.IntAttributes.
stringAttributes IReadOnlyDictionary<string, string>
The string attributes of the material, see Material.StringAttributes.
Properties
CollisionGroup
Gets the collision group of the faces, or empty when the material gives none.
public string CollisionGroup { get; }Property Value
string
InteractAs
Gets the interaction layers the faces are in.
public IReadOnlyList<string> InteractAs { get; }Property Value
IReadOnlyList<string>
InteractExclude
Gets the interaction layers the faces never collide with.
public IReadOnlyList<string> InteractExclude { get; }Property Value
IReadOnlyList<string>
InteractWith
Gets the interaction layers the faces collide with.
public IReadOnlyList<string> InteractWith { get; }Property Value
IReadOnlyList<string>
IsSolid
Gets whether the faces have collision at all.
public bool IsSolid { get; }Property Value
bool
SurfaceProperty
Gets the surface property of the faces, or empty for the default one.
public string SurfaceProperty { get; }Property Value
string
Methods
CompilesTo(KVObject)
Gets whether the faces compile to collision with the given collision attributes. The layers of a material only count when it gives a collision group, and faces in none are in the default one.
public bool CompilesTo(KVObject collisionAttributes)Parameters
collisionAttributes KVObject
Collision attributes of compiled physics, see PhysAggregateData.CollisionAttributes.
Returns
bool
Whether they match.
SplitLayers(string?)
Splits a list of interaction layers as maps write them in keys, separated by commas or whitespace.
public static string[] SplitLayers(string? list)Parameters
list string?
The list, or null for none.
Returns
string[]
The layers of the list.

