IMesh/Draw

From Garry's Mod
Jump to: navigation, search
 IMesh:Draw( )

Description

Renders the mesh with the active matrix.

Examples

Example

Properly renders the mesh using the SENT's model matrix.

self.Mesh
in this case is the IMesh.
local myMaterial = Material( "models/wireframe" ) -- models/debug/debugwhite

function ENT:Draw()
	if ( self.Mesh ) then
		render.SetMaterial( myMaterial )
		cam.PushModelMatrix( self:GetWorldTransformMatrix() )
			self.Mesh:Draw()
		cam.PopModelMatrix()
	end

	-- Other code
end


Personal tools
Navigation