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

Prop sphere: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(make the link to fgd code translated in the fgd template)
No edit summary
 
(10 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{LanguageBar}}
{{Ent not in fgd}}
{{Ent not in fgd}}
{{CD|CPhysSphere|file1=props.cpp}}
{{this is a|model entity|name=prop_sphere|engine=Source}}
It is essentially a [[prop_physics]] with a perfectly spherical [[VPhysics]] collision model of 12 units radius. If you want to create a spherical entity, it is far more efficient to use prop_sphere than try to create a spherical [[collision mesh]]!


{{entity|type=e0|engine=2|prop_sphere}} It is not in any of Valve's FGDs, however.
{{tip|The only spherical model in Half-Life 2 is <code>models\combine_helicopter\helicopter_bomb01.mdl</code>.}}
{{confirm|Not all prop_physics KVs are applicable to this entity. Changing ''modelscale'' for example seems to produce effects with the physics.}}
{{bug|The collision mesh will not be visible with the ''[[vcollide_wireframe]] 1'' command.}}


It is essentially a [[prop_physics]] with a perfectly spherical [[VPhysics]] collision model. If you want to create an spherical entity, it is far more efficient to use prop_sphere than try to create a spherical [[collision mesh]]!
== Keyvalues ==
 
{{code class|CPhysSphere|props.cpp}}
 
{{tip|The only spherical model in Half-Life 2 is <code>models\combine_helicopter\helicopter_bomb01.mdl</code>.}}


{{bug|The collision mesh will not be visible with the ''vcollide_wireframe 1'' command.}}
{{KV|Radius|intn=radius|float|The radius for the sphere.|only={{P2CE}}{{gmod}}}}


== FGD Code ==
== FGD Code ==
Line 21: Line 23:
</source>
</source>


== Extending prop_sphere ==
== See also ==
 
* [[Extending_Prop_Sphere|Visit this snippet, on how you can improve the existing prop_sphere code.]]
 
* {{ent|prop_data}}
[[Extending_Prop_Sphere|Visit this snippet, on how you can improve the existing prop_sphere code.]]
* [[Prop Types Overview]]
 
** {{ent|prop_physics}}
== Keyvalues ==
** {{ent|prop_physics_multiplayer}}
 
** {{ent|prop_physics_respawnable}}
{{KV|Radius|intn=radius|float|The radius for the sphere.|only={{P2CE}}}}
** {{ent|prop_physics_override}}
{{KV BasePropPhysics}}
** {{ent|prop_dynamic}}
{{KV RenderFields}}
** {{ent|prop_static}}
{{KV BaseEntity}}
** {{ent|prop_ragdoll}}
 
== Flags ==
 
{{Fl BasePropPhysics}}
 
== Inputs ==
 
{{I BasePropPhysics}}
{{I RenderFields}}
{{I BaseEntity}}
 
== Outputs ==
 
{{O BasePropPhysics}}
{{O BaseEntity}}


[[Category:Free source code]]
[[Category:Free source code]]
[[Category:Physics]]
[[Category:Physics]]
[[Category:Custom FGDs]]
[[Category:Custom FGDs]]
[[Category:Prop entities|sphere]]

Latest revision as of 02:24, 30 June 2025

English (en)中文 (zh)Translate (Translate)
Icon-NotInFGD.png
This entity is not in the FGD by default.
See below for instructions on making it available.
C++ Class hierarchy
CPhysSphere
CPhysicsProp
CBreakableProp
CBaseProp
CBaseAnimating
CBaseEntity
C++ props.cpp

prop_sphere is a model entity available in all Source Source games. It is essentially a prop_physics with a perfectly spherical VPhysics collision model of 12 units radius. If you want to create a spherical entity, it is far more efficient to use prop_sphere than try to create a spherical collision mesh!

Tip.pngTip:The only spherical model in Half-Life 2 is models\combine_helicopter\helicopter_bomb01.mdl.
Confirm:Not all prop_physics KVs are applicable to this entity. Changing modelscale for example seems to produce effects with the physics.
Icon-Bug.pngBug:The collision mesh will not be visible with the vcollide_wireframe 1 command.  [todo tested in ?]

Keyvalues

Radius (radius) <float> (only in Portal 2: Community EditionGarry's Mod)
The radius for the sphere.

FGD Code

If you don't intend to make any changes to the entity's C++ code, use this:

@PointClass base(BasePropPhysics, RenderFields) studioprop() = prop_sphere : "Creates a perfect sphere."
[
]

See also