CPointEntity: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{stub}}
{{CD|CPointEntity|file1=1}}
{{CD|CPointEntity|file1=1}}
CPointEntity is a code class in {{Source|4}}.
CPointEntity is a code class in {{Source|4}}. [[:Category:CPointEntity|Entities inheriting this class]] are never rendered as 3D models.
{{Confusion|Not the same thing as [[point entity]] which is determined by how entity is defined in [[FGD]], and also the logic behind the name choice differs}}
{{Confusion|Not the same thing as [[point entity]] which is determined by how entity is defined in [[FGD]], and also the logic behind the name choice differs}}
{{clr}}


[[:Category:CPointEntity|Entities inheriting this class]] are never rendered as 3D models and are not allowed to modify its mins/maxs via keyvalues.
{{Linked entities|info_player_start|info_landmark|info_teleport_destination|info_target_helicopter_crash| info_hang_lighting}}
<syntaxhighlight lang=cpp>
bool CPointEntity::KeyValue( const char *szKeyName, const char *szValue )
{
if ( FStrEq( szKeyName, "mins" ) || FStrEq( szKeyName, "maxs" ) )
{
Warning("Warning! Can't specify mins/maxs for point entities! (%s)\n", GetClassname() );
return true;
}


return BaseClass::KeyValue( szKeyName, szValue );
== Keyvalue handling ==
}
{{KV|mins / maxs|intn=0||Prints warning to console about not being allowed to modify mins/maxs of point entity.
</syntaxhighlight>
:{{tip|Can be avoided by specifying # symbol. Example "mins#25 100 100 100". See keyvalue handling of [[CBaseEntity]] for more information about this.}}
}}
{{KV|<anything else>|intn=0|any|Handled by [[CBaseEntity]] KeyValue method.}}


{{Linked entities|info_player_start|info_landmark|info_teleport_destination|info_target_helicopter_crash| info_hang_lighting}}
{{Class def section}}


== See Also ==
== See Also ==
* [[CServerOnlyPointEntity]]
* [[CServerOnlyPointEntity]]
* [[CLogicalEntity]]

Revision as of 08:52, 30 September 2024

C++ Class hierarchy
CPointEntity
CBaseEntity
C++ subs.cpp

CPointEntity is a code class in Source Source. Entities inheriting this class are never rendered as 3D models.

Warning.pngRisk of Confusion:Not the same thing as point entity which is determined by how entity is defined in FGD, and also the logic behind the name choice differs

Entities linked to this class

Keyvalue handling

mins / maxs
Prints warning to console about not being allowed to modify mins/maxs of point entity.
Tip.pngTip:Can be avoided by specifying # symbol. Example "mins#25 100 100 100". See keyvalue handling of CBaseEntity for more information about this.
<anything else> <any>
Handled by CBaseEntity KeyValue method.

C++ definitions from Source 2013 Multiplayer Source 2013 Multiplayer [edit]

baseentity.h

class CPointEntity : public CBaseEntity
{
public:
	DECLARE_CLASS( CPointEntity, CBaseEntity );

	void	Spawn( void );
	virtual int	ObjectCaps( void ) { return BaseClass::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
	virtual bool KeyValue( const char *szKeyName, const char *szValue );
private:
};

baseentity.cpp

bool CPointEntity::KeyValue( const char *szKeyName, const char *szValue ) 
{
	if ( FStrEq( szKeyName, "mins" ) || FStrEq( szKeyName, "maxs" ) )
	{
		Warning("Warning! Can't specify mins/maxs for point entities! (%s)\n", GetClassname() );
		return true;
	}

	return BaseClass::KeyValue( szKeyName, szValue );
}

subs.cpp

void CPointEntity::Spawn( void )
{
	SetSolid( SOLID_NONE );
//	UTIL_SetSize(this, vec3_origin, vec3_origin);
}

See Also