Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Astralcircle authored Jul 31, 2024
1 parent 3b3337d commit 19e39d9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ e2function void enableConstraintUndo(state)
self.data.constraintUndos = state ~= 0
end


local emptyVector = Vector()
local countLookup = {
Weld = maxWeld,
Rope = maxRope,
Expand Down Expand Up @@ -299,7 +297,7 @@ e2function void ballsocket(entity ent1, vector v, entity ent2, friction)
if not checkEnts(self, ent1, ent2) then return end
if not checkCount(self, "AdvBallsocket", ent1, ent2) then return end

local cons = constraint.AdvBallsocket(ent1, ent2, 0, 0, v, emptyVector, 0, 0, -180, -180, -180, 180, 180, 180, friction, friction, friction, 0, 0)
local cons = constraint.AdvBallsocket(ent1, ent2, 0, 0, v, vector_origin, 0, 0, -180, -180, -180, 180, 180, 180, friction, friction, friction, 0, 0)
if not verifyConstraint(self, cons) then return end

postCreate(self, "AdvBallsocket", ent1, ent2, cons)
Expand All @@ -310,7 +308,7 @@ e2function void ballsocket(entity ent1, vector v, entity ent2, vector mins, vect
if not checkEnts(self, ent1, ent2) then return end
if not checkCount(self, "AdvBallsocket", ent1, ent2) then return end

local cons = constraint.AdvBallsocket(ent1, ent2, 0, 0, v, emptyVector, 0, 0, mins[1], mins[2], mins[3], maxs[1], maxs[2], maxs[3], frictions[1], frictions[2], frictions[3], 0, 0)
local cons = constraint.AdvBallsocket(ent1, ent2, 0, 0, v, vector_origin, 0, 0, mins[1], mins[2], mins[3], maxs[1], maxs[2], maxs[3], frictions[1], frictions[2], frictions[3], 0, 0)
if not verifyConstraint(self, cons) then return end

postCreate(self, "AdvBallsocket", ent1, ent2, cons)
Expand All @@ -321,7 +319,7 @@ e2function void ballsocket(entity ent1, vector v, entity ent2, vector mins, vect
if not checkEnts(self, ent1, ent2) then return end
if not checkCount(self, "AdvBallsocket", ent1, ent2) then return end

local cons = constraint.AdvBallsocket(ent1, ent2, 0, 0, v, emptyVector, 0, 0, mins[1], mins[2], mins[3], maxs[1], maxs[2], maxs[3], frictions[1], frictions[2], frictions[3], rotateonly, 0)
local cons = constraint.AdvBallsocket(ent1, ent2, 0, 0, v, vector_origin, 0, 0, mins[1], mins[2], mins[3], maxs[1], maxs[2], maxs[3], frictions[1], frictions[2], frictions[3], rotateonly, 0)
if not verifyConstraint(self, cons) then return end

postCreate(self, "AdvBallsocket", ent1, ent2, cons)
Expand All @@ -332,7 +330,7 @@ e2function void weldAng(entity ent1, vector v, entity ent2)
if not checkEnts(self, ent1, ent2) then return end
if not checkCount(self, "AdvBallsocket", ent1, ent2) then return end

local cons = constraint.AdvBallsocket(ent1, ent2, 0, 0, v, emptyVector, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 1, 0)
local cons = constraint.AdvBallsocket(ent1, ent2, 0, 0, v, vector_origin, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 1, 0)
if not verifyConstraint(self, cons) then return end

postCreate(self, "AdvBallsocket", ent1, ent2, cons)
Expand Down
48 changes: 24 additions & 24 deletions lua/entities/gmod_wire_expression2/core/custom/prop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -329,15 +329,15 @@ function PropCore.CreateSent(self, class, pos, angles, freeze, data)
Fraction = 0,
Entity = NULL,
HitPos = Vector(pos),
HitNormal = vector_origin,
HitNormal = Vector(0, 0, 0),
HitBox = 0,
Normal = Vector(1, 0, 0),
Hit = true,
HitGroup = 0,
MatType = 0,
StartPos = vector_origin,
StartPos = Vector(0, 0, 0),
PhysicsBone = 0,
WorldToLocal = vector_origin,
WorldToLocal = Vector(0, 0, 0),
}
if sent.t and sent.t.SpawnFunction then
entity = sent.t.SpawnFunction( sent.t, ply, mockTrace, class )
Expand Down Expand Up @@ -1414,112 +1414,112 @@ e2function vector collision:position()
end

e2function vector collision:ourOldVelocity()
if not this then return self:throw("Invalid collision data!", vector_origin) end
if not this then return self:throw("Invalid collision data!",Vector(0,0,0)) end
return Vector(this.OurOldVelocity)
end

e2function vector collision:entityOldVelocity()
if not this then return self:throw("Invalid collision data!", vector_origin) end
if not this then return self:throw("Invalid collision data!",Vector(0,0,0)) end
return Vector(this.OurOldVelocity)
end

e2function vector collision:theirOldVelocity()
if not this then return self:throw("Invalid collision data!", vector_origin) end
if not this then return self:throw("Invalid collision data!",Vector(0,0,0)) end
return Vector(this.TheirOldVelocity)
end

e2function vector collision:hitEntityOldVelocity()
if not this then return self:throw("Invalid collision data!", vector_origin) end
if not this then return self:throw("Invalid collision data!",Vector(0,0,0)) end
return Vector(this.TheirOldVelocity)
end

e2function vector collision:hitNormal()
if not this then return self:throw("Invalid collision data!", vector_origin) end
if not this then return self:throw("Invalid collision data!",Vector(0,0,0)) end
return Vector(this.HitNormal)
end

e2function vector collision:hitSpeed()
if not this then return self:throw("Invalid collision data!", vector_origin) end
if not this then return self:throw("Invalid collision data!",Vector(0,0,0)) end
return Vector(this.HitSpeed)
end

e2function vector collision:ourNewVelocity()
if not this then return self:throw("Invalid collision data!", vector_origin) end
if not this then return self:throw("Invalid collision data!",Vector(0,0,0)) end
return Vector(this.OurNewVelocity)
end

e2function vector collision:entityNewVelocity()
if not this then return self:throw("Invalid collision data!", vector_origin) end
if not this then return self:throw("Invalid collision data!",Vector(0,0,0)) end
return Vector(this.OurNewVelocity)
end

e2function vector collision:theirNewVelocity()
if not this then return self:throw("Invalid collision data!", vector_origin) end
if not this then return self:throw("Invalid collision data!",Vector(0,0,0)) end
return Vector(this.TheirNewVelocity)
end

e2function vector collision:hitEntityNewVelocity()
if not this then return self:throw("Invalid collision data!", vector_origin) end
if not this then return self:throw("Invalid collision data!",Vector(0,0,0)) end
return Vector(this.TheirNewVelocity)
end

e2function vector collision:ourOldAngularVelocity()
if not this then return self:throw("Invalid collision data!", vector_origin) end
if not this then return self:throw("Invalid collision data!",Vector(0,0,0)) end
return Vector(this.OurOldAngularVelocity)
end

e2function vector collision:entityOldAngularVelocity()
if not this then return self:throw("Invalid collision data!", vector_origin) end
if not this then return self:throw("Invalid collision data!",Vector(0,0,0)) end
return Vector(this.OurOldAngularVelocity)
end

e2function vector collision:theirOldAngularVelocity()
if not this then return self:throw("Invalid collision data!", vector_origin) end
if not this then return self:throw("Invalid collision data!",Vector(0,0,0)) end
return Vector(this.TheirOldAngularVelocity)
end

e2function vector collision:hitEntityOldAngularVelocity()
if not this then return self:throw("Invalid collision data!", vector_origin) end
if not this then return self:throw("Invalid collision data!",Vector(0,0,0)) end
return Vector(this.TheirOldAngularVelocity)
end

-- * Numbers
__e2setcost(2)

e2function number collision:speed()
if not this then return self:throw("Invalid collision data!", 0) end
if not this then return self:throw("Invalid collision data!",0) end
return this.Speed
end

e2function number collision:ourSurfaceProps()
if not this then return self:throw("Invalid collision data!", 0) end
if not this then return self:throw("Invalid collision data!",0) end
return this.OurSurfaceProps
end

e2function number collision:entitySurfaceProps()
if not this then return self:throw("Invalid collision data!", 0) end
if not this then return self:throw("Invalid collision data!",0) end
return this.OurSurfaceProps
end

e2function number collision:theirSurfaceProps()
if not this then return self:throw("Invalid collision data!", 0) end
if not this then return self:throw("Invalid collision data!",0) end
return this.TheirSurfaceProps
end

e2function number collision:hitEntitySurfaceProps()
if not this then return self:throw("Invalid collision data!", 0) end
if not this then return self:throw("Invalid collision data!",0) end
return this.TheirSurfaceProps
end

e2function number collision:deltaTime()
if not this then return self:throw("Invalid collision data!", 0) end
if not this then return self:throw("Invalid collision data!",0) end
return this.DeltaTime
end

-- * Entities

e2function entity collision:hitEntity()
if not this then return self:throw("Invalid collision data!", Entity(0)) end
if not this then return self:throw("Invalid collision data!",Entity(0)) end
return this.HitEntity
end

Expand Down
4 changes: 3 additions & 1 deletion lua/entities/gmod_wire_expression2/core/custom/wiring.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ E2Lib.RegisterExtension("wiring", false, "Allows the creation and deletion of wi
__e2setcost(30)

--- Creates an invisible wire between the input <inputname> of <this> and the output <outputname> of <ent2>
local vector_creatwire = Vector(255, 255, 255)

e2function number entity:createWire(entity ent2, string inputname, string outputname)
if not IsValid(this) or not IsValid(ent2) then return 0 end
if not isOwner(self, this) or not isOwner(self, ent2) then return 0 end
Expand All @@ -18,7 +20,7 @@ e2function number entity:createWire(entity ent2, string inputname, string output

local trigger = self.entity.trigger
self.entity.trigger = { false, {} } -- So the wire creation doesn't execute the E2 immediately because an input changed
WireLib.Link_Start(self.player:UniqueID(), this, this:WorldToLocal(this:GetPos()), inputname, "cable/rope", Vector(255,255,255), 0)
WireLib.Link_Start(self.player:UniqueID(), this, this:WorldToLocal(this:GetPos()), inputname, "cable/rope", vector_creatwire, 0)
WireLib.Link_End(self.player:UniqueID(), ent2, ent2:WorldToLocal(ent2:GetPos()), outputname, self.player)
self.entity.trigger = trigger

Expand Down

0 comments on commit 19e39d9

Please sign in to comment.