-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added disappear distance option, changed fgd keyvalues to mimic portal 2 linked_portal_door, fixed portal rotation, fixed #1 (portal shaking), resolved bliptec/world-portals/#4 (missing pair failing hard)
- Loading branch information
Showing
11 changed files
with
244 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
worldportals = {} | ||
|
||
-- Load required files | ||
if SERVER then | ||
|
||
include( "worldportals/render_sv.lua" ) | ||
|
||
AddCSLuaFile( "worldportals/render_cl.lua" ) | ||
|
||
else | ||
|
||
include( "worldportals/render_cl.lua" ) | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
include( "shared.lua" ) | ||
|
||
AccessorFunc( ENT, "texture", "Texture" ) | ||
|
||
|
||
--Draw world portals | ||
function ENT:Draw() | ||
|
||
--self:DrawModel() | ||
|
||
if ( worldportals.drawing ) then return end | ||
|
||
render.ClearStencil() | ||
render.SetStencilEnable( true ) | ||
|
||
render.SetStencilWriteMask( 1 ) | ||
render.SetStencilTestMask( 1 ) | ||
|
||
render.SetStencilFailOperation( STENCILOPERATION_KEEP ) | ||
render.SetStencilZFailOperation( STENCILOPERATION_KEEP ) | ||
render.SetStencilPassOperation( STENCILOPERATION_REPLACE ) | ||
render.SetStencilCompareFunction( STENCILCOMPARISONFUNCTION_ALWAYS ) | ||
render.SetStencilReferenceValue( 1 ) | ||
|
||
render.SetMaterial( worldportals.matDummy ) | ||
render.SetColorModulation( 1, 1, 1 ) | ||
|
||
render.DrawQuadEasy( self:GetPos(), self:GetForward(), self:GetWidth(), self:GetHeight(), Color( 255, 255, 255, 255), self:GetAngles().roll ) | ||
|
||
render.SetStencilCompareFunction( STENCILCOMPARISONFUNCTION_EQUAL ) | ||
render.SetStencilPassOperation( STENCILOPERATION_REPLACE ) | ||
render.SetStencilReferenceValue( 1 ) | ||
|
||
worldportals.matView:SetTexture( "$basetexture", self:GetTexture() ) | ||
render.SetMaterial( worldportals.matView ) | ||
render.DrawScreenQuad() | ||
|
||
render.SetStencilEnable( false ) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
ENT.Type = "anim" | ||
ENT.Spawnable = false | ||
ENT.AdminOnly = false | ||
ENT.Editable = false | ||
|
||
|
||
--ENT.Model = Model("models/props/cs_office/microwave.mdl") | ||
|
||
function ENT:Initialize() | ||
|
||
local mins = Vector(-1, -self:GetWidth() /2, -self:GetHeight() /2) | ||
local maxs = -mins | ||
|
||
if CLIENT then | ||
|
||
self:SetTexture( GetRenderTarget("portal" .. self:EntIndex(), | ||
ScrW(), | ||
ScrH(), | ||
false | ||
) ) | ||
|
||
self:SetRenderBounds( mins, maxs ) | ||
|
||
end | ||
|
||
--[[self:SetModel(self.Model) | ||
self:PhysicsInit(SOLID_VPHYSICS) | ||
self:SetMoveType(MOVETYPE_VPHYSICS) | ||
self:SetSolid(SOLID_BBOX) | ||
local b = 32 | ||
self:SetCollisionBounds(Vector(-b, -b, -b), Vector(b,b,b)) | ||
local phys = self:GetPhysicsObject() | ||
--phys:EnableMotion( true ) | ||
--phys:Wake()]]-- | ||
|
||
end | ||
|
||
|
||
function ENT:SetupDataTables() | ||
|
||
self:NetworkVar( "Entity", 0, "Exit" ) | ||
self:NetworkVar( "Int", 1, "Width" ) | ||
self:NetworkVar( "Int", 2, "Height" ) | ||
self:NetworkVar( "Int", 2, "DisappearDist" ) | ||
|
||
end |
Oops, something went wrong.