Entity.SetRenderClipPlane

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity.SetRenderClipPlane( Vector normal, Vector distance )
Where is this used?
Description:
Clips a model along a plane
Returns: nil
Part of Library: Entity
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.SetRenderClipPlane]Entity.SetRenderClipPlane [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example Usage

DescriptionCuts a model in half
Used onNewerClient.png
Code
 
function Clip(ent)
    local normal = ent:GetRight()
    local pos = ent:LocalToWorld(ent:OBBCenter())
    local distance = normal:Dot(pos)
 
    ent:SetRenderClipPlaneEnabled(true)
    ent:SetRenderClipPlane(normal, distance)
end
 
OutputN/A


Additional Notes

Riddler 12:58, 12 May 2010 (UTC)

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox