prop_physics
![]() |
---|
CPhysicsProp |
![]() |
prop_physics
是一个模型实体,可在所有的 起源 游戏中使用。 用于向世界添加刚性的VPhysics 物理模拟模型 。
prop_physics唯一需要的值是一个模型路径。只要该模型是physics-enabled ,地图启动时就会从中加载正确的数据。可以使用"Override Parameters"键值更改任何嵌入的物理数据。
像prop_physics
这样的物理对象可以被parented ,虽然默认FGD 中没有且可能无法正常工作。建议改用动态物理约束。参见Physics Entity Overview 获取更多信息。



physics_prop
。 生成时类名总是会被改为prop_physics。 


一致性
在处理Source引擎提供的众多道具模型时,一致性成为一大问题。从玩家角度看,物体交互性应在游戏/模组的所有关卡中保持一致,因为如果道具行为只在特定情况下不同,玩家往往难以解谜或快速决策。为确保这一点,道具的游戏相关数据存储在模型本身中。
例如,假设游戏中有一个始终不可移动的板条箱,玩家已习惯其静态特性。但在某一特定情况下,这个板条箱需要被移动才能继续游戏。这会引起大量困扰和混乱,因此保持一致性十分必要。开发者通常会使用不同的皮肤或模型来传达行为差异并保持一致性。
本应进行物理模拟的模型(椅子、桌子、木板等)如果被放置为prop_static或prop_dynamic实体会自行移除(仍可通过prop_dynamic_override实体作为静态道具使用)。其他游戏相关数据,如质量、"health"、gib数量及模型等也都存储在道具模型中。
存储方法及设置指南可在模型QC文件的Prop Data 部分找到。
Keyvalues
- Name (targetname) <target_source>
- 其他实体引用该实体的目标名称。
BasePropPhysics:
- Physics Impact Damage Scale (physdamagescale) <浮点型 >
- 乘以物理冲击受到的伤害。0表示为了向后兼容而禁用该功能。
- Impact damage type (Damagetype) <布尔值 >
- 如果为true(1),伤害类型为锐器且对象可以切割其他物体。
- Damaging it Doesn't Push It (nodamageforces) <布尔值 >
- 是否对实体造成伤害时会施加力。
- Scale Factor For Inertia (inertiascale) <浮点型 >
- 缩放物体的角质量。用于hack角度伤害和碰撞响应。
证实:实际上不影响惯性?
- Mass Scale (massscale) <浮点型 >
- 物体质量的乘数。
- Health Level to Override Motion (damagetoenablemotion) <整数 >
- 如果指定,此对象将以禁用运动开始。一旦其health低于此指定值,将启用运动。
- Physics Impact Force to Override Motion (forcetoenablemotion) <浮点型 >
- 如果指定,此对象将以禁用运动开始。任何施加力大于此值的冲击将启用运动。
BreakableProp:
- Explosion Damage (ExplodeDamage) <浮点型 >
- If non-zero, when this entity breaks it will create an explosion that causes the specified amount of damage. See also Explosion Radius.
- Explosion Radius (ExplodeRadius) <浮点型 >
- If non-zero, when this entity breaks it will create an explosion with a radius of the specified amount. See also Explosion Damage.
- Sound to make when punted (puntsound) <sound > (存在于自
以来)
- Sound to make when punted by gravity gun.
- Break Model Message (BreakModelMessage) <字符串 > (仅存在于
之中)
- "If set, will use this break model message instead of the normal break behavior."
Breakable (common):
- Performance Mode (PerformanceMode) <choices>
- Used to limit the amount of gibs produced when this entity breaks, for performance reasons.
Choices Expand
- Min Damage to Hurt (minhealthdmg) <整数 >
- If a single hit to the object doesn't do at least this much damage, the prop won't take any of the damage it attempted to give.
- Pressure Delay (PressureDelay) <浮点型 >
- Seconds to delay breaking from pressure. Allows creaking/groaning sounds to play.
- Health (health) <整数 >
- How close to breaking the object is.
- Maximum Health (max_health) <整数 >
- Health cannot exceed this amount.
- Physics Impact Damage Scale (physdamagescale) <浮点型 >
- Multiplier for damage amount when this entity is hit by a physics object. With a value of 0 the entity will take no damage from physics.
Who can break this? Expand
GMODSandbox:
- Allow Physics Gun (gmod_allowphysgun) <布尔值 > (仅存在于
之中)
- If set, players cannot use Physics Gun on this entity.
- Sandbox Tool Whitelist (gmod_allowtools) <字符串 > (仅存在于
之中)
- If set, only given tools can be used on this entity. You need to supply the tool class names, the names of the
.lua
files of those tools. This also includes the context menu properties!
- World Model (model) <model >
- The model this entity should appear as. 128-character limit.
- Skin (skin) <整数 >
- Some models have multiple skins. This value selects from the index, starting with 0. May be overridden by game code.
提示:Hammer's model browser automatically updates this value if you use it to view different skins.
- Model Scale (modelscale) <浮点型 > (存在于自
以来) (也存在于
之中)
- A multiplier for the size of the model.
提示:In
Hammer++ with a prop selected in 3D view, hold Ctrl and scroll the mouse wheel to change the modelscale in increments of 0.5. Holding ⇧ Shift will scale it in smaller increments of 0.05.
- Bodygroup (body / SetBodyGroup) <整数 >
- Some models have multiple submodels. This value selects from the index, starting with 0. May be overridden by animations and/or game code.
注意:If both body and SetBodyGroup are present (even if set to 0), body will be prioritized.
- Lighting Origin (lightingorigin) <target_destination>
- Select an entity (not info_lighting!) from which to sample lighting and cubemaps instead of the entity's $illumposition.
阴影:
- Disable Shadows (disableshadows) <布尔值 >
- 防止该实体生成廉价的渲染到纹理的阴影,或如果实体是 prop_static 的光照贴图阴影。不影响影子映射。
- 禁用接收阴影 (disablereceiveshadows) <布尔值 >
- 防止该实体接收动态阴影。
- Shadow Cast Distance (shadowcastdist) <整数 > 不存在于FGD!
- 设置实体投射动态阴影的距离。0 表示从 shadow_control 实体开始的默认距离。
- Disable Shadow Depth (disableshadowdepth) <布尔值 > (存在于自
以来)
- 用于禁用此实体的阴影深度(用于投影纹理)的渲染。
- Disable flashlight (disableflashlight) <布尔值 > (存在于自
以来)
- 用于禁用此实体的投影纹理照明和阴影。
- Projected Texture Cache (shadowdepthnocache) <integer choices > (存在于自
以来)
- 用于提示投影纹理系统缓存此实体的阴影体积是否足够,或改为强制每帧渲染。
选项 Expand
- Render in Fast Reflections (drawinfastreflection) <布尔值 > (存在于自
以来)
- If enabled, this entity will render in fast water reflections (i.e. when a water material specifies
$reflectonlymarkedentities
) and in the world impostor pass.
Flags
BasePropPhysics:
- Start Asleep : [1]
- Don't take physics damage : [2]
- 不承受物理伤害
- Motion Disabled : [8]
- 初始禁用运动直到收到EnableMotion指令。
- Enable motion when grabbed by gravity gun : [64]
- 被重力枪 抓取时启用运动
- Not affected by rotor wash : [128]
- 不受旋翼下洗流影响
- Generate output on +use : [256]
- 是否生成
OnPlayerUse
输出
- Prevent pickup : [512]
- 禁止拾取
- Prevent motion enable on player bump : [1024]
- 防止玩家碰撞时启用运动
- Has Attached Ragdolls : [2048] 不存在于FGD!
- 游戏会在附着布娃娃时设置此标志,道具移动时分离布娃娃
注意:仅用于具有"impale"prop interaction (PROPINTER_PHYSGUN_FIRST_IMPALE)的道具,如半衰期2中的鱼叉(不同于crossbow 箭,后者使用不同方法固定布娃娃)。最好不要手动设置此标志。
- Debris with trigger interaction : [4096]
- 可与触发器交互的碎片
注意:单独使用时不会启用碎片行为。需要与Debris标志或
PROPINTER_PHYSGUN_CREATE_FLARE
道具交互一起使用。
- Force server-side : [8192]
- 仅多人游戏有效;参见sv_pushaway_clientside_size
- Radius Pickup : [16384] 不存在于FGD!
- 使物体更容易抓取
- Gravity gun can ALWAYS pick up. No matter what. : [1048576]
- 允许此道具被标准gravity gun 拾取,即使其$mass 超过physcannon_maxmass(默认250kg)。在没有重力枪的游戏中无效。
- No Collisions : [2097152] 不存在于FGD!
- 生成时禁用碰撞
- Gib : [4194304] 不存在于FGD!
- 如果是碎片,卡在碰撞中时移除
- Zombies can't swat : [8388608] (仅存在于
之中)
- 僵尸在寻找拍打对象时会忽略此道具
BreakableProp:
- Break on Touch : [16]
- Break on Pressure : [32]
- Will break after being stood on for
PressureDelay
seconds.注意:Some models will break instantly if this is or isn't set. (e.g.
militiawindow02_breakable.mdl
,window_industrial.mdl
)
Inputs
BasePropPhysics:
- Sleep
- 告诉道具停止移动。任何物理力(不包括重力和水的浮力)都会使对象恢复移动。当对象没有物理力保持清醒且不再有明显移动时,也会自动进入睡眠。
- Wake
- 如果对象被告知睡眠,告诉它重新开始移动。
- DisableMotion
- 告诉对象完全停止移动。没有任何物理力会重新启用运动,甚至
Wake
也不行。
- EnableMotion
- 如果对象的运动已被完全禁用,告诉它恢复正常移动。如果对象正在
Sleep
,这也会Wake
它。
- DisableFloating
- 如果对象在水中通常会漂浮,告诉它不要漂浮。似乎没有办法重新启用漂浮行为,但编程实现此功能的方法应该相当简单(
CALLBACK_DO_FLUID_SIMULATION
)。
BreakableProp:
- Break
- Breaks the breakable.
- SetHealth <整数 >
- Sets a new value for the breakable's health. If the breakable's health reaches zero it will break.
- AddHealth <整数 >
- Adds health to the breakable.
- RemoveHealth <整数 >
- Removes health from the breakable.
- physdamagescale <浮点型 >
- Sets Physics Impact Damage Scale. 0 means this feature is disabled for backwards compatibility.
- EnablePhyscannonPickup
- Makes the breakable able to picked up by the gravity gun.
- DisablePhyscannonPickup
- Makes the breakable not able to picked up by the gravity gun.
- EnablePuntSound (存在于自
以来)
- Allow this prop from playing its Punt Sound sound when punted by the gravity gun.
- DisablePuntSound (存在于自
以来)
- Prevent this prop from playing its Punt Sound sound when punted by the gravity gun.
Outputs
- OnMotionEnabled
- !activator = !caller = this entity
当道具的运动被启用时触发,无论是通过Health Level to Override Motion键值还是EnableMotion
输入。
- OnAwakened
- !activator = !caller = this entity
当道具被唤醒时触发(当它睡着时施加了力,或调用了Wake
输入)。
- OnOutOfWorld
- !activator = !caller = this entity
每当检测到对象在世界之外时触发。具体来说,它检查对象是否在世界bounding box 之外,或者对象是否在任何基本方向上以超过2000单位/秒的速度移动。
- OnPlayerUse
- !activator = !caller = this entity
当玩家+use道具时触发。

- OnPhysGunDrop
- !activator = the player
!caller = this entity
当玩家放下道具时触发(无论是通过+use
还是重力枪)。
- OnPlayerPickup
- !activator = the player
!caller = this entity
当玩家通过+use
或重力枪(在Half-Life 2中)拾取道具时触发。
BreakableProp:
- OnBreak
- !activator = entity that breaks the object
!caller = this entity
Fired when this object breaks.
- OnHealthChanged <浮点型 >
- !activator = entity that caused the health change
!caller = this entity
Fired whenever the health of the breakable has increased or decreased. This output automatically puts the new health amount as a decimal percent (e.g. 45% = 0.45) into the parameter box for inputs, if the mapper does not override the parameter with something else. - OnTakeDamage
- !activator = entity that caused the damage
!caller = this entity
Fired when damage is taken. - OnPhysCannonAnimatePreStarted
- !activator = none
!caller = this entity
Fired when prop starts itsACT_PHYSCANNON_ANIMATE_PRE
activity. Caused by the object being picked up by the gravity gun.
- OnPhysCannonAnimatePullStarted
- !activator = none
!caller = this entity
Fired when prop has started itsACT_PHYSCANNON_ANIMATE
activity.ACT_PHYSCANNON_ANIMATE_PRE
plays once, thenACT_PHYSCANNON_ANIMATE
starts looping.
- OnPhysCannonDetach
- !activator = none
!caller = this entity
Fired when prop has started itsACT_PHYSCANNON_DETACH
activity (caused by the gravity gun ripping it from a wall).
- OnPhysCannonAnimatePostStarted
- !activator = none
!caller = this entity
Fired when prop has started itsACT_PHYSCANNON_ANIMATE_POST
activity (caused by the player letting the prop go from the gravity gun).
- OnPhysCannonPullAnimFinished
- !activator = none
!caller = this entity
Fired when prop has finished all gravity gun-related animations.