Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include("shared.lua")
- /*===========================================================================================================================
- Name: ENT.Initialize
- Purpose: Initialize entity
- Author: Goluch
- ===========================================================================================================================*/
- function ENT:Initialize()
- end
- /*===========================================================================================================================
- Name: ENT.Think
- Purpose: Set the render bounds
- Author: Divran
- ===========================================================================================================================*/
- function ENT:Think() self:SetRenderBounds( Vector(1,1,1)*-10000, Vector(1,1,1)*10000 ) end
- /*===========================================================================================================================
- Name: ENT.Draw
- Purpose: Draw entity
- Author: Goluch
- ===========================================================================================================================*/
- ENT.RenderGroup = RENDERGROUP_BOTH
- function ENT:Draw( )
- local matrix = Matrix( );
- matrix:Translate( self:GetPos( ) )
- matrix:Rotate( self:GetAngles( ) )
- local X,Y,Z = self:GetBoxScale()
- X = X / 2
- Y = Y / 2
- Z = Z / 2
- render.SuppressEngineLighting( true )
- render.SetMaterial( Material( "models/debug/debugwhite" ) )
- render.SetColorModulation(1,0,0)
- render.SetBlend( 160/255 )
- cam.PushModelMatrix( matrix )
- //Corners
- local A = Vector(-X,-Y,Z)
- local B = Vector(X,-Y,Z)
- local C = Vector(X,Y,Z)
- local D = Vector(-X,Y,Z)
- local E = Vector(-X,Y,-Z)
- local F = Vector(-X,-Y,-Z)
- local G = Vector(X,-Y,-Z)
- local H = Vector(X,Y,-Z)
- mesh.Begin( MATERIAL_QUADS, 6 );
- //Top
- mesh.Quad(D,C,B,A)
- //Bottom
- mesh.Quad(E,F,G,H)
- //Left
- mesh.Quad(F,E,D,A)
- //Right
- mesh.Quad(B,C,H,G)
- //Front
- mesh.Quad(C,D,E,H)
- //Back
- mesh.Quad(A,B,G,F)
- mesh.End( )
- cam.PopModelMatrix( )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement