Global/AddOriginToPVS

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
{{Function
+
{{Func
| Name = AddOriginToPVS
+
|Name=AddOriginToPVS
| Namespace = [[Global]]
+
|Parent=Global
| Realm = Server
+
|Description=Adds the specified vector to the PVS which is currently building. This allows all objects in visleafs visible from that vector to be drawn.
 +
|Realm=Server
 +
|IsClass=No
 
}}
 
}}
 
+
{{Arg
{{Syntax
+
|type=Vector
| Name = AddOriginToPVS
+
|name=position
| Description = Adds the specified vector to the PVS which is currently building. This allows all objects in visleafs visible from that vector to be drawn.
+
|desc=The origin to add.
 
+
| Arg1Name = position
+
| Arg1Type = Vector
+
| Arg1Req = true
+
| Arg1Desc = The origin to add.
+
 
}}
 
}}
==Examples==
 
 
{{Example
 
{{Example
 
| Description = Adds an RTCamera's current position to all player's PVS, causing props near it to always render on an rtscreen
 
| Description = Adds an RTCamera's current position to all player's PVS, causing props near it to always render on an rtscreen
Line 22: Line 18:
 
hook.Add("SetupPlayerVisibility", "AddRTCamera", mySetupVis)
 
hook.Add("SetupPlayerVisibility", "AddRTCamera", mySetupVis)
 
}}
 
}}
 
==Additional Notes==
 
* This is only useful in the {{HookLink|Base|SetupPlayerVisibility}} hook
 

Revision as of 16:10, 26 February 2013

 AddOriginToPVS( )

Contents

Description

Adds the specified vector to the PVS which is currently building. This allows all objects in visleafs visible from that vector to be drawn.

Arguments

Vector position

The origin to add.

Examples

Example

Adds an RTCamera's current position to all player's PVS, causing props near it to always render on an rtscreen

local function mySetupVis(ply)
	AddOriginToPVS(RTCamera:GetPos())
end
hook.Add("SetupPlayerVisibility", "AddRTCamera", mySetupVis)


Personal tools
Navigation