Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Free Cam (CameraCore)
- @inputs Pod:wirelink HideHolo:number Active
- @persist CamPos:vector CamAngle:angle HoloScale Entity:entity
- @trigger Active
- if (first()|duped()|dupefinished()) {
- function resetCamera() {
- CamPos = entity():pos() + vec(0,0,30)
- CamAngle = ang(0,0,0)
- }
- resetCamera()
- HoloScale = 1
- holoCreate(1,CamPos,vec(HoloScale*!HideHolo),CamAngle)
- cameraCreate(1,holoEntity(1):toWorld(vec(0,0,0)),holoEntity(1):toWorld(ang(0,0,0)))
- cameraParent(1,holoEntity(1))
- }
- if (changed(HideHolo)&HideHolo) {
- holoScale(1,vec(0))
- }
- elseif (changed(HideHolo)&!HideHolo) {
- holoScale(1,vec(HoloScale))
- }
- Active = Pod["Active",number]
- Entity = Pod["Entity",entity]
- if (Active) {
- runOnTick(1)
- # Expand Pod wirelink
- local W = Pod["W",number]
- local A = Pod["A",number]
- local S = Pod["S",number]
- local D = Pod["D",number]
- local R = Pod["R",number]
- local Space = Pod["Space",number]
- local Shift = Pod["Shift",number]
- local Alt = Pod["Alt",number]
- local Speed = 10+(90*Shift)
- if (R) {
- resetCamera()
- }
- else {
- CamAngle = (transpose(matrix(Entity))*Entity:driver():eye()):toAngle()
- CamPos = holoEntity(1):toWorld(vec((W-S)*Speed,(A-D)*Speed,(Space-Alt)*Speed))
- }
- holoPos(1,CamPos)
- holoAng(1,CamAngle)
- }
- else {
- runOnTick(0)
- }
- cameraToggle(1,Active,Entity)
Advertisement
Add Comment
Please, Sign In to add comment