A small warehouse located opposite of the motel…
Researching 2D collisions to deal with a potential edge case for my 2D engine.
Nobody told me there would be this much math!
update: making random generation system using all these assets (ITS HARD)
Yo! Is that my free model?
Is that an RTX 3080? (my dream graphics card)
So close!
It´s the rtx 3070 Founders Edition from Nvidia.
Check the post here:
(Pc component feedback (RTX 3070 Founders Editon))
I just made an NYS Trooper Lightbar (I tried my best)
I am currently creating wireless systems for a Touring Production. My old Furman (Posted here previously) with the new Shure UA845UWB Ultra Wide Band Antenna
Below are mock wireless systems that will be replaced with actual SurfaceGuis in the near future.
https://devforum.roblox.com/t/coder-challenge-the-fourth-dimension/1565756/23
I managed to code a place with 4D hypersphere collision.
It’s a bit counter intuitive. was initially going to reply there but it got locked.
Code
-- Code
local VelocityW = 0 -- CurrentVelocity in 4 dimension
local PositionW = math.random(-8,8) -- Position of hypersphere in 4D
local RadiusW = 4 -- Radius of sphere MAX
-- Position is of central 4d axis so we get proper values.
local THIRD_DIMENSION_W = 0 -- Plane does not move in relation to 4 Dimension...yet
local Collision = script.Parent.Collision
local Intersection = script.Parent.Visualize
local RunService = game:GetService("RunService")
local cos = math.cos
local acos = math.acos
local sqrt = math.sqrt
local rad = math.rad
local deg = math.deg
local pi = math.pi
local tan = math.tan
local clamp = math.clamp -- They cannot escape
local abs = math.abs --hard abs
-- Radius of intersection calculated by cosine. Intersection always happens at W = 0 so angle is always Cos distance from 0
local Debounce = false
local function lerp(from: number, to: number, alpha): number -- prelerprel
local diff = to - from
diff *= alpha
return from + diff -- ff
end
Intersection.Touched:Connect(function(otherPart: BasePart)
if Debounce or otherPart.Name ~= "HumanoidRootPart" then return end -- collide only pp hitbx cus other cannot hit
Debounce = true
local CF = otherPart.AssemblyLinearVelocity.Magnitude
-- LimitCollision force speed
local A = abs(PositionW - THIRD_DIMENSION_W) / RadiusW
local B = 0
if A < 1 then -- haha no edge go away
B = lerp(B,CF,A)
end
VelocityW += B
Debounce = false
end)
local function Stepped(runTime: number, deltaTime: number)
--PositionW = -10 + runTime
PositionW += VelocityW * deltaTime
PositionW = clamp(PositionW,-16,16)
local DIFF = abs(PositionW - THIRD_DIMENSION_W)
local A = DIFF / RadiusW -- CAH
local B = DIFF^2
local C = RadiusW^2
local D = 2 * DIFF * RadiusW * A -- SAS
local E = B + C - D
local F = sqrt(E) -- neg as
if F ~= F then -- neg as -ind(nan) no visualze bc size < 0
Intersection.Transparency = 1
Intersection.CanCollide = false
else
Intersection.Transparency = 0
Intersection.CanCollide = true
end
Intersection.Size = Vector3.new(F,F,F)--Boom wonderful variable names
end
RunService.Stepped:Connect(Stepped)
local ChangeUp = workspace.ChangeUp
local ChangeDown = workspace.ChangeDown
ChangeUp.Touched:Connect(function()
if Debounce then return end
Debounce = true
THIRD_DIMENSION_W += 1
task.wait(0.1)
Debounce = false
end)
ChangeDown.Touched:Connect(function()
if Debounce then return end
Debounce = true
THIRD_DIMENSION_W -= 1
task.wait(0.1)
Debounce = false
end)
This is really neat! From my understanding, 4th dimension collision is when you interact and collide with an object that is in an intersecting plane of reality, causing it to phase and the rift between our plane and its normal plane, right?
Just curious, is the object just getting scaled or is there an actual simulated ‘4th dimension’ where the objects go and move around, then eventually reappear? Also, where is that code placed in the explorer?
Yes there is an actual 4 dimension here. The only thing that might not be right is how I have handled collisions and velocity. I had a hard time understanding how collisions between a 3D character object would interact. So I made a couple of assumptions.
- The Walls are infinitely huge in the 4D plane (Ball won’t phase through wall)
- The Character is only a 3D object(Ball can phase through character)
This video you can see how they phase out of existence
I am able to calculate how large the intersection between the 3D should be using the law of cosines.
It looks like this
Yeah. I don’t think I will be able to create 4D Cubes unless I study more maths lol.
I think I am almost correct to assume that the 4D hyperspheres moves the same however I can’t “negate” the collision of the normal 3D sphere unless there is a Vector4 Module out there.
Huh very interesting. It is definitely impressive you got this far, but to further you really should implement the dicing where an object can be half-phased instead of smaller.
How do you create the wall destruction? I assume it might be procedural, but if not and it is actually just cubes, then what do you do to the cubes upon impact?
Well the filament ended up getting stuck and I couldn’t complete it lol. Also here’s some roblox legs from a previous test.
My workstation is a mess…
Dunno, just used this module: https://devforum.roblox.com/t/destructionmodule-for-in-game-destruction-needs/1191430
Oof, i just realized the numbers were made of parts, Made a selfie (nice you added freecam for all)
The free-cam is built into Roblox, so I didn’t add anything.
Ah, I forgot about that. Yes, I enabled it for people to take screenshots with.
I didn’t think it was there for non-owners unless you enabled it somehow…?? hmm, anyway check out this fire cam view:
https://devforum.roblox.com/t/how-do-i-let-other-players-use-the-free-cam/1100977