This article's documentation is for anything that uses the Source engine. Click here for more information.

phys_convert

From Valve Developer Community
Jump to: navigation, search
class hierarchy
CPhysConvert defined in physobj.cpp
CLogicalEntity
CServerOnlyEntity
CBaseEntity

phys_convert is a point entity available in all Source Source games. It copies the physical and visual properties of an arbitrary entity onto a new physically simulated entity. The original entity is deleted if successful. Brush entities will turn into simple_physics_brush and model entities will turn into simple_physics_prop. Both are very limited compared to func_physbox and prop_physics. See their respective pages for details.

Note.pngNote:phys_convert cannot be used in reverse. (cannot turn physically simulated entities into arbitrary entities)

Keyvalues

Entity to convert (target) <targetname>
Name of the entity that will be converted to a physics object when the ConvertTarget input is fired.
Model Swap Entity (swapmodel) <string>
If specified, the model of the entity specified here will replace the model of the target object when it is converted.
Tip.pngTip:Use this when the converted object has a separate model used for physics props. (e.g. converting "coolthing001a" when "coolthing001a_physics" exists)
Mass Override (massoverride) <float>
Sets the mass when the object(s) are converted (0 means auto-calculate)

Targetname:
Name (targetname) <string>
The targetname that other entities refer to this entity by.

Flags

  •  [1] : Convert Asleep
  •  [2] : Convert As Debris

Inputs

ConvertTarget
Converts this entity's target to a physically simulated object.
Note.pngNote:Name, model, pose, children, position and velocity are retained after conversion. Keyvalues, e.g. skin and color, are not kept. AddOutput could be used as a workaround depending on the circumstances.
Code: Which fields are transferred can be changed by modifying CPhysConvert::InputConvertTarget().

Outputs

OnConvert
Fires after the conversion has taken place.

See also