Prop sphere: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (1. it's a not an. 2. JESUS CHRIST WHY SO MANY TEMPLATES)
m (Updated old entity format to {{this is a}}. This action was perfomed by a bot.)
Line 1: Line 1:
{{Ent not in fgd}}
{{Ent not in fgd}}


{{entity|type=e0|engine=2|prop_sphere}} It is not in any of Valve's FGDs, however.
{{this is a|name=prop_sphere|engine=2|e0}} It is not in any of Valve's FGDs, however.


It is essentially a [[prop_physics]] with a perfectly spherical [[VPhysics]] collision model. 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]]!
It is essentially a [[prop_physics]] with a perfectly spherical [[VPhysics]] collision model. 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]]!

Revision as of 13:39, 4 January 2024

Icon-NotInFGD.png
This entity is not in the FGD by default.
See below for instructions on making it available.

prop_sphere is an e0 available in all Template:2 games.Template:2 topicon

Warning.pngWarning:
  • The {{{engine}}} parameter is inconsistent with the name defined by the {{2}} template.
    If a parameter is consistent but you're still seeing this warning, it may be an issue with the template itself. Please discuss it on the template's talk page.

It is not in any of Valve's FGDs, however.

It is essentially a prop_physics with a perfectly spherical VPhysics collision model. 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!

C++ In code, it is represented by theCPhysSphereclass, defined in theprops.cppfile.
Tip.pngTip:The only spherical model in Half-Life 2 is models\combine_helicopter\helicopter_bomb01.mdl.
Icon-Bug.pngBug:The collision mesh will not be visible with the vcollide_wireframe 1 command.  [todo tested in ?]

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."
[
]

Extending prop_sphere

Visit this snippet, on how you can improve the existing prop_sphere code.

Keyvalues

Radius (radius) <float> (only in Portal 2: Community Edition)
The radius for the sphere.
Note.pngNote:Page left for viewable history, content moved to prop_physics

RenderFields:


Render Mode (rendermode) <byte choices>
Set a non-standard rendering mode on this entity.
Render Modes
  • 0: Normal
  • 1: Color
  • 2: Texture
  • 3: Glow
  • 4: Solid/Alphatest Obsolete
  • 5: Additive
  • 6: Removed, does nothing Obsolete
  • 7: Additive Fractional Frame
  • 8: Alpha Add
  • 9: World Space Glow
  • 10: Don't Render
Render FX (renderfx) <byte choices>
Various somewhat legacy alpha effects. See render effects.
Render Amount / Transparency (renderamt) <byte>
Transparency amount, requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.
Render Color (R G B) (rendercolor) <color255>
Color tint.


Flags

Note.pngNote:Page left for viewable history, content moved to prop_physics

Inputs

Note.pngNote:Page left for viewable history, content moved to prop_physics

RenderFields:

Alpha <integer 0–255>
Sets the entity's transparency to a number from 0 (invisible) to 255 (fully visible). Requires the entity to have its rendermode set to a number other than 0.
Color <color255RedirectInput/color32>
Sets an RGB color for the entity.


Outputs

Note.pngNote:Page left for viewable history, content moved to prop_physics