rad
Definition
-- @/rad:-1
function rad(...)
Callers
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veView.lua
local aspectRatio = availSize.x / availSize.y
view.control.renderView.frustum = Frustum.construct(view.ortho[0], math.rad(view.fov[0]), aspectRatio, view.nearClip[0], view.farClip[0])
view.control.renderView.fov = view.fov[0]
@/lua/ge/extensions/core/cameraModes/chase.lua
rot:set(math.rad(self.camRot.x), math.rad(self.camRot.y), math.rad(self.camRot.z))
rot:set(math.rad(self.camRot.x), math.rad(self.camRot.y), math.rad(self.camRot.z))
rot:set(math.rad(self.camRot.x), math.rad(self.camRot.y), math.rad(self.camRot.z))
@/lua/ge/extensions/render/viewDemo.lua
local farClip = 2000
renderView.frustum = Frustum.construct(renderOrthogonal, math.rad(fov), aspectRatio, nearClip, farClip)
renderView.fov = fov
@/lua/ge/extensions/gameplay/markers/missionMarker.lua
local offsetForTriangle = {
vec3(math.sin(math.rad(topAngle)), math.cos(math.rad(topAngle))*1.15, 0),
vec3(math.sin(math.rad(topAngle+120)), math.cos(math.rad(topAngle+120)), 0),
local offsetForTriangle = {
vec3(math.sin(math.rad(topAngle)), math.cos(math.rad(topAngle))*1.15, 0),
vec3(math.sin(math.rad(topAngle+120)), math.cos(math.rad(topAngle+120)), 0),
vec3(math.sin(math.rad(topAngle)), math.cos(math.rad(topAngle))*1.15, 0),
vec3(math.sin(math.rad(topAngle+120)), math.cos(math.rad(topAngle+120)), 0),
vec3(math.sin(math.rad(topAngle-120)), math.cos(math.rad(topAngle-120)), 0),
vec3(math.sin(math.rad(topAngle)), math.cos(math.rad(topAngle))*1.15, 0),
vec3(math.sin(math.rad(topAngle+120)), math.cos(math.rad(topAngle+120)), 0),
vec3(math.sin(math.rad(topAngle-120)), math.cos(math.rad(topAngle-120)), 0),
vec3(math.sin(math.rad(topAngle+120)), math.cos(math.rad(topAngle+120)), 0),
vec3(math.sin(math.rad(topAngle-120)), math.cos(math.rad(topAngle-120)), 0),
}
vec3(math.sin(math.rad(topAngle+120)), math.cos(math.rad(topAngle+120)), 0),
vec3(math.sin(math.rad(topAngle-120)), math.cos(math.rad(topAngle-120)), 0),
}
@/lua/ge/extensions/core/cameraModes/pacenoteOrbit.lua
self.maxDynamicFov = settings.getValue('cameraOrbitMaxDynamicFov') or 35
self.maxDynamicPitch = math.rad(settings.getValue('cameraOrbitMaxDynamicPitch') or 0)
self.maxDynamicOffset = settings.getValue('cameraOrbitMaxDynamicOffset') or 0
-- Calculate the new camera position based on rotation and distance
local rot = vec3(math.rad(self.camRot.x), math.rad(self.camRot.y), 0)
local calculatedCamPos = vec3(
-- Calculate the new camera position based on rotation and distance
local rot = vec3(math.rad(self.camRot.x), math.rad(self.camRot.y), 0)
local calculatedCamPos = vec3(
@/lua/ge/extensions/editor/masterSpline/homologation.lua
-- Rotate normal around tangent.
local angleRad = rad(step)
geom.rotateVecAroundAxisInlined(normal, tangent, angleRad, rotatedNormal)
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veCrashTester.lua
local startYaw = 90 -- degrees
local startDir = quatFromAxisAngle(vec3(0,0,1), math.rad(startYaw))
local tempStartYaw = startYaw
local tempStartYaw = startYaw
local tempStartDir = quatFromAxisAngle(vec3(0,0,1), math.rad(startYaw))
tempStartYaw = tempStartYaw + io.MouseWheel * 5
tempStartDir = quatFromAxisAngle(vec3(0,0,1), math.rad(tempStartYaw))
end
@/lua/ge/extensions/flowgraph/nodes/util/randomQuaternion.lua
function C:work()
local x = lerp(math.rad(self.pinIn.xMinAngle.value or 0), math.rad(self.pinIn.xMaxAngle.value or 0), math.random())
local y = lerp(math.rad(self.pinIn.yMinAngle.value or 0), math.rad(self.pinIn.yMaxAngle.value or 0), math.random())
function C:work()
local x = lerp(math.rad(self.pinIn.xMinAngle.value or 0), math.rad(self.pinIn.xMaxAngle.value or 0), math.random())
local y = lerp(math.rad(self.pinIn.yMinAngle.value or 0), math.rad(self.pinIn.yMaxAngle.value or 0), math.random())
local x = lerp(math.rad(self.pinIn.xMinAngle.value or 0), math.rad(self.pinIn.xMaxAngle.value or 0), math.random())
local y = lerp(math.rad(self.pinIn.yMinAngle.value or 0), math.rad(self.pinIn.yMaxAngle.value or 0), math.random())
local z = lerp(math.rad(self.pinIn.zMinAngle.value or 0), math.rad(self.pinIn.zMaxAngle.value or 0), math.random())
local x = lerp(math.rad(self.pinIn.xMinAngle.value or 0), math.rad(self.pinIn.xMaxAngle.value or 0), math.random())
local y = lerp(math.rad(self.pinIn.yMinAngle.value or 0), math.rad(self.pinIn.yMaxAngle.value or 0), math.random())
local z = lerp(math.rad(self.pinIn.zMinAngle.value or 0), math.rad(self.pinIn.zMaxAngle.value or 0), math.random())
local y = lerp(math.rad(self.pinIn.yMinAngle.value or 0), math.rad(self.pinIn.yMaxAngle.value or 0), math.random())
local z = lerp(math.rad(self.pinIn.zMinAngle.value or 0), math.rad(self.pinIn.zMaxAngle.value or 0), math.random())
local y = lerp(math.rad(self.pinIn.yMinAngle.value or 0), math.rad(self.pinIn.yMaxAngle.value or 0), math.random())
local z = lerp(math.rad(self.pinIn.zMinAngle.value or 0), math.rad(self.pinIn.zMaxAngle.value or 0), math.random())
@/lua/ge/extensions/editor/sceneView.lua
local aspectRatio = availSize.x / availSize.y
view.control.renderView.frustum = Frustum.construct(view.ortho[0], math.rad(view.fov[0]), aspectRatio, view.nearClip[0], view.farClip[0])
view.control.renderView.fov = view.fov[0]
@/lua/ge/extensions/flowgraph/nodes/gameplay/decalCircle.lua
cosX = math.cos(math.rad(t * 360))
sinY = math.sin(math.rad(t * 360))
cosX = math.cos(math.rad(t * 360))
sinY = math.sin(math.rad(t * 360))
@/lua/ge/extensions/scenario/busdriver.lua
pos = (tpos-xVec*d+yVec*w)
r = tr * quatFromEuler(0, 0, rad(90))
elseif k == 2 then --Top Right
pos = (tpos+xVec*d+yVec*w)
r = tr * quatFromEuler(0, 0, rad(180))
elseif k == 3 then --Bottom Right
pos = (tpos+xVec*d-yVec*w)
r = tr * quatFromEuler(0, 0, rad(270))
elseif k == 4 then --Botton Left
@/lua/ge/extensions/gameplay/markers/parkingMarker.lua
for i = 0, 5 do
local angle = math.rad(topAngle + i * 60)
table.insert(hexagonVertices, vec3(math.sin(angle), math.cos(angle), 0))
@/lua/ge/extensions/gameplay/drift/stuntZones/donut.lua
cosX = math.cos(math.rad(t * 360))
sinY = math.sin(math.rad(t * 360))
cosX = math.cos(math.rad(t * 360))
sinY = math.sin(math.rad(t * 360))
@/lua/ge/extensions/core/cameraModes/relative.lua
local qdirLook = rotateEuler(-math.rad(self.rot.x), -math.rad(self.rot.y), 0) --math.rad(self.rot.z))
local qdirLook2 = rotateEuler(0, 0, math.rad(self.rot.z), qdirLook)
local qdirLook = rotateEuler(-math.rad(self.rot.x), -math.rad(self.rot.y), 0) --math.rad(self.rot.z))
local qdirLook2 = rotateEuler(0, 0, math.rad(self.rot.z), qdirLook)
local qdirLook = rotateEuler(-math.rad(self.rot.x), -math.rad(self.rot.y), 0) --math.rad(self.rot.z))
local qdirLook2 = rotateEuler(0, 0, math.rad(self.rot.z), qdirLook)
local qdirLook = rotateEuler(-math.rad(self.rot.x), -math.rad(self.rot.y), 0) --math.rad(self.rot.z))
local qdirLook2 = rotateEuler(0, 0, math.rad(self.rot.z), qdirLook)
qdir = qdirLook2 * qdir
@/lua/common/jbeam/sections/meshs.lua
local rotDeg = vec3(prop.rotation)
prop.rotation = vec3(math.rad(rotDeg.x), math.rad(rotDeg.y), math.rad(rotDeg.z))
p:setRotation(prop.rotation)
local rotDeg = vec3(prop.rotation)
prop.rotation = vec3(math.rad(rotDeg.x), math.rad(rotDeg.y), math.rad(rotDeg.z))
p:setRotation(prop.rotation)
local rotDeg = vec3(prop.rotation)
prop.rotation = vec3(math.rad(rotDeg.x), math.rad(rotDeg.y), math.rad(rotDeg.z))
p:setRotation(prop.rotation)
rotDeg = vec3(prop.rotationGlobal)
prop.rotationGlobal = vec3(math.rad(rotDeg.x), math.rad(rotDeg.y), math.rad(rotDeg.z))
p:setRotationGlobal(prop.rotationGlobal)
rotDeg = vec3(prop.rotationGlobal)
prop.rotationGlobal = vec3(math.rad(rotDeg.x), math.rad(rotDeg.y), math.rad(rotDeg.z))
p:setRotationGlobal(prop.rotationGlobal)
rotDeg = vec3(prop.rotationGlobal)
prop.rotationGlobal = vec3(math.rad(rotDeg.x), math.rad(rotDeg.y), math.rad(rotDeg.z))
p:setRotationGlobal(prop.rotationGlobal)
if prop.baseRotation then
prop.baseRotation = vec3(math.rad(prop.baseRotation.x), math.rad(prop.baseRotation.y), math.rad(prop.baseRotation.z))
p:setBaseRotation(prop.baseRotation)
if prop.baseRotation then
prop.baseRotation = vec3(math.rad(prop.baseRotation.x), math.rad(prop.baseRotation.y), math.rad(prop.baseRotation.z))
p:setBaseRotation(prop.baseRotation)
if prop.baseRotation then
prop.baseRotation = vec3(math.rad(prop.baseRotation.x), math.rad(prop.baseRotation.y), math.rad(prop.baseRotation.z))
p:setBaseRotation(prop.baseRotation)
if prop.baseRotationGlobal then
prop.baseRotationGlobal = vec3(math.rad(prop.baseRotationGlobal.x), math.rad(prop.baseRotationGlobal.y), math.rad(prop.baseRotationGlobal.z))
p:setBaseRotationGlobal(prop.baseRotationGlobal)
if prop.baseRotationGlobal then
prop.baseRotationGlobal = vec3(math.rad(prop.baseRotationGlobal.x), math.rad(prop.baseRotationGlobal.y), math.rad(prop.baseRotationGlobal.z))
p:setBaseRotationGlobal(prop.baseRotationGlobal)
if prop.baseRotationGlobal then
prop.baseRotationGlobal = vec3(math.rad(prop.baseRotationGlobal.x), math.rad(prop.baseRotationGlobal.y), math.rad(prop.baseRotationGlobal.z))
p:setBaseRotationGlobal(prop.baseRotationGlobal)
end
local rotRad = vec3(math.rad(rotDeg.x), math.rad(rotDeg.y), math.rad(rotDeg.z))
end
local rotRad = vec3(math.rad(rotDeg.x), math.rad(rotDeg.y), math.rad(rotDeg.z))
end
local rotRad = vec3(math.rad(rotDeg.x), math.rad(rotDeg.y), math.rad(rotDeg.z))
@/lua/ge/extensions/core/vehicles.lua
local trailerOffset = MatrixF(true)
local rotOffsetVec = vec3(math.rad(rotOffset.rx or 0), math.rad(rotOffset.ry or 0), math.rad(rotOffset.rz or 0))
trailerOffset:setFromEuler(rotOffsetVec)
local trailerOffset = MatrixF(true)
local rotOffsetVec = vec3(math.rad(rotOffset.rx or 0), math.rad(rotOffset.ry or 0), math.rad(rotOffset.rz or 0))
trailerOffset:setFromEuler(rotOffsetVec)
local trailerOffset = MatrixF(true)
local rotOffsetVec = vec3(math.rad(rotOffset.rx or 0), math.rad(rotOffset.ry or 0), math.rad(rotOffset.rz or 0))
trailerOffset:setFromEuler(rotOffsetVec)
local offsetMat = MatrixF(true)
offsetMat:setFromEuler(vec3(math.rad(offset.rx or 0), math.rad(offset.ry or 0), math.rad(offset.rz or 0)))
offsetMat:setPosition(vec3(offset.x or 0, offset.y or 0, offset.z or 0))
local offsetMat = MatrixF(true)
offsetMat:setFromEuler(vec3(math.rad(offset.rx or 0), math.rad(offset.ry or 0), math.rad(offset.rz or 0)))
offsetMat:setPosition(vec3(offset.x or 0, offset.y or 0, offset.z or 0))
local offsetMat = MatrixF(true)
offsetMat:setFromEuler(vec3(math.rad(offset.rx or 0), math.rad(offset.ry or 0), math.rad(offset.rz or 0)))
offsetMat:setPosition(vec3(offset.x or 0, offset.y or 0, offset.z or 0))
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veVehicleSpawner.lua
local startYaw = 90 -- degrees
local startDir = quatFromAxisAngle(vec3(0,0,1), math.rad(startYaw))
local tempStartYaw = startYaw
local tempStartYaw = startYaw
local tempStartDir = quatFromAxisAngle(vec3(0,0,1), math.rad(startYaw))
tempStartYaw = tempStartYaw + io.MouseWheel * 5
tempStartDir = quatFromAxisAngle(vec3(0,0,1), math.rad(tempStartYaw))
end
@/lua/ge/main.lua
local scale = vec3(1.5, 1.5, 1.5)
local r = quatFromEuler(0, 0, math.rad(45))
local instance = prefab:spawn("", pos, QuatF(r.x, r.y, r.z, r.w), scale)
local scale = vec3(s, s, s)
local r = quatFromEuler(0, 0, math.rad(math.random(0, 360)))
local name = "test_v2_"..tostring(i)
@/lua/common/jbeam/sections/events.lua
local rotDeg = vec3(ab.rotation)
ab.rotation = vec3(math.rad(rotDeg.x), math.rad(rotDeg.y), math.rad(rotDeg.z))
ab.translation = vec3(ab.translation)
local rotDeg = vec3(ab.rotation)
ab.rotation = vec3(math.rad(rotDeg.x), math.rad(rotDeg.y), math.rad(rotDeg.z))
ab.translation = vec3(ab.translation)
local rotDeg = vec3(ab.rotation)
ab.rotation = vec3(math.rad(rotDeg.x), math.rad(rotDeg.y), math.rad(rotDeg.z))
ab.translation = vec3(ab.translation)
local rot = vec3(ab.baseRotation)
ab.baseRotation = vec3(math.rad(rot.x), math.rad(rot.y), math.rad(rot.z))
abo.baseRotation = ab.baseRotation
local rot = vec3(ab.baseRotation)
ab.baseRotation = vec3(math.rad(rot.x), math.rad(rot.y), math.rad(rot.z))
abo.baseRotation = ab.baseRotation
local rot = vec3(ab.baseRotation)
ab.baseRotation = vec3(math.rad(rot.x), math.rad(rot.y), math.rad(rot.z))
abo.baseRotation = ab.baseRotation
@/lua/ge/extensions/editor/toolUtilities/geom.lua
local scaled = min(curv * autoBankTuning, 1.0)
return scaled * bankStrength * rad(maxBankDeg)
end
@/lua/ge/extensions/core/cameraModes/trackir.lua
local q = rotateEuler(
math.rad(t.yaw * rotate_sensitivity)
, math.rad(t.pitch * rotate_sensitivity) + math.pi
math.rad(t.yaw * rotate_sensitivity)
, math.rad(t.pitch * rotate_sensitivity) + math.pi
, math.rad(t.roll * -rotate_sensitivity))
, math.rad(t.pitch * rotate_sensitivity) + math.pi
, math.rad(t.roll * -rotate_sensitivity))
@/lua/ge/extensions/flowgraph/nodes/scene/camera/cameraCircle.lua
local speed = self.pinIn.speed.value or 10
local aRad = math.rad(self.angle)
local prevZ = self.camPos.z == 0 and self.centerPos.z or self.camPos.z
@/lua/ge/extensions/editor/vizHelper.lua
-- rotate the forward vector around the normal
local angle = math.rad(rotation[0])
local fwd = norm:perpendicularN()
@/lua/ge/extensions/editor/gen/world.lua
local farClip = 2000
renderView.frustum = Frustum.construct(renderOrthogonal, math.rad(fov), aspectRatio, nearPlane, farClip)
@/lua/ge/extensions/flowgraph/nodes/scene/rectMarker.lua
corner = (tpos-xVec*d+yVec*w)
r = quatFromEuler(0, 0, math.rad(90))
elseif k == 2 then --Top Right
corner = (tpos+xVec*d+yVec*w)
r = quatFromEuler(0, 0, math.rad(180))
elseif k == 3 then --Bottom Right
corner = (tpos+xVec*d-yVec*w)
r = quatFromEuler(0, 0, math.rad(270))
elseif k == 4 then --Botton Left
@/lua/ge/extensions/core/cameraModes/orbit.lua
defaultCamPos:set(
math.sin(math.rad(self.defaultRotation.x)) * math.cos(math.rad(self.defaultRotation.y))
, -math.cos(math.rad(self.defaultRotation.x)) * math.cos(math.rad(self.defaultRotation.y))
defaultCamPos:set(
math.sin(math.rad(self.defaultRotation.x)) * math.cos(math.rad(self.defaultRotation.y))
, -math.cos(math.rad(self.defaultRotation.x)) * math.cos(math.rad(self.defaultRotation.y))
math.sin(math.rad(self.defaultRotation.x)) * math.cos(math.rad(self.defaultRotation.y))
, -math.cos(math.rad(self.defaultRotation.x)) * math.cos(math.rad(self.defaultRotation.y))
, -math.sin(math.rad(self.defaultRotation.y)))
math.sin(math.rad(self.defaultRotation.x)) * math.cos(math.rad(self.defaultRotation.y))
, -math.cos(math.rad(self.defaultRotation.x)) * math.cos(math.rad(self.defaultRotation.y))
, -math.sin(math.rad(self.defaultRotation.y)))
, -math.cos(math.rad(self.defaultRotation.x)) * math.cos(math.rad(self.defaultRotation.y))
, -math.sin(math.rad(self.defaultRotation.y)))
defaultCamPos = defaultCamPos * self.defaultDistance
self.dynamicPitchLimit = math.max(math.rad(self.fov/2) - angleCamTargetCamBottomRear, 0)
end
if not self.camRot then self.camRot = vec3(self.defaultRotation) end
self.camLastRot = vec3(math.rad(self.camRot.x), math.rad(self.camRot.y), 0)
self.camMinDist = self.distanceMin or 3
if not self.camRot then self.camRot = vec3(self.defaultRotation) end
self.camLastRot = vec3(math.rad(self.camRot.x), math.rad(self.camRot.y), 0)
self.camMinDist = self.distanceMin or 3
self.maxDynamicFov = settings.getValue('cameraOrbitMaxDynamicFov') or 35
self.maxDynamicPitch = math.rad(settings.getValue('cameraOrbitMaxDrivingPitch') or 0)
self.maxDynamicOffset = settings.getValue('cameraOrbitMaxDynamicOffset') or 0
self.camRot:set(self.defaultRotation)
self.camLastRot:set(math.rad(self.camRot.x), math.rad(self.camRot.y) * 1.5, 0)
end
self.camRot:set(self.defaultRotation)
self.camLastRot:set(math.rad(self.camRot.x), math.rad(self.camRot.y) * 1.5, 0)
end
rot:set(math.rad(self.camRot.x), math.rad(self.camRot.y), math.rad(self.camRot.z))
rot:set(math.rad(self.camRot.x), math.rad(self.camRot.y), math.rad(self.camRot.z))
rot:set(math.rad(self.camRot.x), math.rad(self.camRot.y), math.rad(self.camRot.z))
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veStaticRenderView.lua
rot = mainRVData.rot and quat(mainRVData.rot) or quatFromDir(vec3(0,1,0), unitVecs[3]),
gridRot = mainRVData.gridRot and quat(mainRVData.gridRot) or quatFromAxisAngle(vec3(1,0,0), math.rad(90)),
ortho = im.BoolPtr(mainRVData.ortho or false),
local aspectRatio = mainRVSize.x / mainRVSize.y
mainRVData.renderView.frustum = Frustum.construct(mainRVData.ortho[0], math.rad(mainRVData.fov[0]), aspectRatio, mainRVData.nearClip[0], mainRVData.farClip[0])
mainRVData.renderView.fov = mainRVData.fov[0]
local aspectRatio = axisGizmoRVSize.x / axisGizmoRVSize.y
axisGizmoRVData.renderView.frustum = Frustum.construct(false, math.rad(45), aspectRatio, 0.01, 5)
axisGizmoRVData.renderView.fov = math.rad(45)
axisGizmoRVData.renderView.frustum = Frustum.construct(false, math.rad(45), aspectRatio, 0.01, 5)
axisGizmoRVData.renderView.fov = math.rad(45)
axisGizmoRVData.renderView.renderEditorIcons = false
@/lua/ge/extensions/tech/multiscreen.lua
renderDetail = renderDetail or 0.3,
fov = math.rad(fov or 80),
nearClip = nearClip or 1, farClip = farClip or 1000,
@/lua/ge/extensions/gameplay/traffic/trafficUtils.lua
repeat
local angleRad = math.rad(math.random() * 360)
spawnData.dir:set(math.sin(angleRad), math.cos(angleRad), 0)
@/lua/ge/extensions/editor/tech/roadArchitect/geometry.lua
local p, w, hL, hR = pDisc[i], wDisc[i], hLDisc[i], hRDisc[i]
local rotRad, off, pWork = rad(rDisc[i]), oDisc[i], p
for j = numLeftKeys, 1, -1 do
@/lua/ge/extensions/core/settings/graphic.lua
local rightFovDeg = settings.getValue('GraphicTripleMonitorRightFovDeg')
Engine.setRenderMode(((leftFovDeg > 0) or (rightFovDeg > 0)) and "MultiMonitor" or "SingleMonitor", math.rad(centerFovDeg), math.rad(leftFovDeg), math.rad(rightFovDeg), math.rad(borderFovDeg))
else
local rightFovDeg = settings.getValue('GraphicTripleMonitorRightFovDeg')
Engine.setRenderMode(((leftFovDeg > 0) or (rightFovDeg > 0)) and "MultiMonitor" or "SingleMonitor", math.rad(centerFovDeg), math.rad(leftFovDeg), math.rad(rightFovDeg), math.rad(borderFovDeg))
else
local rightFovDeg = settings.getValue('GraphicTripleMonitorRightFovDeg')
Engine.setRenderMode(((leftFovDeg > 0) or (rightFovDeg > 0)) and "MultiMonitor" or "SingleMonitor", math.rad(centerFovDeg), math.rad(leftFovDeg), math.rad(rightFovDeg), math.rad(borderFovDeg))
else
local rightFovDeg = settings.getValue('GraphicTripleMonitorRightFovDeg')
Engine.setRenderMode(((leftFovDeg > 0) or (rightFovDeg > 0)) and "MultiMonitor" or "SingleMonitor", math.rad(centerFovDeg), math.rad(leftFovDeg), math.rad(rightFovDeg), math.rad(borderFovDeg))
else
@/lua/ge/extensions/editor/vehicleDetailViewer.lua
rv.renderEditorIcons = false
rv.fov = math.rad(90)
rv:enterFocusObjectsMode()
@/lua/common/jbeam/utils.lua
tmpVec1:set(rad(-op.x), rad(-op.y), rad(-op.z))
tmpMat2:setFromEuler(tmpVec1)
tmpVec1:set(rad(-op.x), rad(-op.y), rad(-op.z))
tmpMat2:setFromEuler(tmpVec1)
tmpVec1:set(rad(-op.x), rad(-op.y), rad(-op.z))
tmpMat2:setFromEuler(tmpVec1)
else
tmpVec1:set(rad(-op.x), rad(-op.y), rad(-op.z))
tmpMat1:setFromEuler(tmpVec1)
else
tmpVec1:set(rad(-op.x), rad(-op.y), rad(-op.z))
tmpMat1:setFromEuler(tmpVec1)
else
tmpVec1:set(rad(-op.x), rad(-op.y), rad(-op.z))
tmpMat1:setFromEuler(tmpVec1)
if cacheUsingMatrixMath then
tmpVec1:set(rad(-rx), rad(-ry), rad(-rz))
tmpMat1:setFromEuler(tmpVec1)
if cacheUsingMatrixMath then
tmpVec1:set(rad(-rx), rad(-ry), rad(-rz))
tmpMat1:setFromEuler(tmpVec1)
if cacheUsingMatrixMath then
tmpVec1:set(rad(-rx), rad(-ry), rad(-rz))
tmpMat1:setFromEuler(tmpVec1)
tmpVec1:set(rad(-rx), rad(-ry), rad(-rz))
tmpMat1:setFromEuler(tmpVec1)
tmpVec1:set(rad(-rx), rad(-ry), rad(-rz))
tmpMat1:setFromEuler(tmpVec1)
tmpVec1:set(rad(-rx), rad(-ry), rad(-rz))
tmpMat1:setFromEuler(tmpVec1)
@/lua/ge/extensions/core/cameraModes/unicycle.lua
end
local rot = rotateEuler(-math.rad(self.rotVec.x), -math.rad(self.rotVec.y), math.rad(self.rotVec.z))
return self.pos, rot
end
local rot = rotateEuler(-math.rad(self.rotVec.x), -math.rad(self.rotVec.y), math.rad(self.rotVec.z))
return self.pos, rot
end
local rot = rotateEuler(-math.rad(self.rotVec.x), -math.rad(self.rotVec.y), math.rad(self.rotVec.z))
return self.pos, rot
local rot = rotateEuler(-math.rad(self.rotVec.x), -math.rad(self.rotVec.y), math.rad(self.rotVec.z))
local rotHorizontal = rotateEuler(-math.rad(self.rotVec.x), -math.rad(180), math.rad(self.rotVec.z))
local rot = rotateEuler(-math.rad(self.rotVec.x), -math.rad(self.rotVec.y), math.rad(self.rotVec.z))
local rotHorizontal = rotateEuler(-math.rad(self.rotVec.x), -math.rad(180), math.rad(self.rotVec.z))
local rot = rotateEuler(-math.rad(self.rotVec.x), -math.rad(self.rotVec.y), math.rad(self.rotVec.z))
local rotHorizontal = rotateEuler(-math.rad(self.rotVec.x), -math.rad(180), math.rad(self.rotVec.z))
local rot = rotateEuler(-math.rad(self.rotVec.x), -math.rad(self.rotVec.y), math.rad(self.rotVec.z))
local rotHorizontal = rotateEuler(-math.rad(self.rotVec.x), -math.rad(180), math.rad(self.rotVec.z))
local rot = rotateEuler(-math.rad(self.rotVec.x), -math.rad(self.rotVec.y), math.rad(self.rotVec.z))
local rotHorizontal = rotateEuler(-math.rad(self.rotVec.x), -math.rad(180), math.rad(self.rotVec.z))
local rot = rotateEuler(-math.rad(self.rotVec.x), -math.rad(self.rotVec.y), math.rad(self.rotVec.z))
local rotHorizontal = rotateEuler(-math.rad(self.rotVec.x), -math.rad(180), math.rad(self.rotVec.z))
@/lua/ge/extensions/core/cameraModes/driver.lua
local transitionStart = math.rad(50) -- full horizon lock within this margin
local transitionEnd = math.rad(70) -- start fully following vehicle beyond this angle
local transitionStart = math.rad(50) -- full horizon lock within this margin
local transitionEnd = math.rad(70) -- start fully following vehicle beyond this angle
-- orientation
rot:set(math.rad(self.camRot.x), math.rad(self.camRot.y), math.rad(self.camRot.z))
-- avoid physical discomfort by removing smoothers from VR
-- orientation
rot:set(math.rad(self.camRot.x), math.rad(self.camRot.y), math.rad(self.camRot.z))
-- avoid physical discomfort by removing smoothers from VR
-- orientation
rot:set(math.rad(self.camRot.x), math.rad(self.camRot.y), math.rad(self.camRot.z))
-- avoid physical discomfort by removing smoothers from VR
local carPitchFactor = self.stablePitchFactor * sign(carUp.z) * smootheststep(clamp((transitionEnd - abs(carPitch)) / (transitionEnd - transitionStart), 0, 1))
local camPitch = math.rad(self.camRot.y) - carPitch * carPitchFactor
--local roll, pitch, yaw = data.veh:getRollPitchYawAngularVelocity()
camRot = rotateEuler(math.rad(self.camRot.x) + lookAheadAngleOffset, camPitch, camRoll, camRot) -- stable hood line
@/lua/ge/extensions/core/cameraModes/onboard.lua
if data.lookBack then
qdir = rotateEuler(math.rad(180),0,math.atan2(rotatedUp:dot(camLeft), rotatedUp:dot(camUp)),qdir)
data.res.pos:set(data.veh:getSpawnWorldOOBBRearPoint())
else
qdir = rotateEuler(math.rad(self.camRot.x), math.rad(self.camRot.y), math.atan2(rotatedUp:dot(camLeft), rotatedUp:dot(camUp)), qdir)
data.res.pos:setAdd2(carPos, nodePos)
else
qdir = rotateEuler(math.rad(self.camRot.x), math.rad(self.camRot.y), math.atan2(rotatedUp:dot(camLeft), rotatedUp:dot(camUp)), qdir)
data.res.pos:setAdd2(carPos, nodePos)
@/lua/ge/extensions/render/renderViews.lua
local farClip = 2000
renderView.frustum = Frustum.construct(renderOrthogonal, math.rad(fov), aspectRatio, nearPlane, farClip)
renderView.fov = fov
@/lua/ge/extensions/gameplay/police.lua
newQuat:setFromDir(tempFwd2, tempUp)
newQuat:setMul2(newQuat, quatFromAxisAngle(tempUp, math.rad(angle * dir)))
tempFwd2:set(tempPos:rotated(newQuat)) -- actual direction vector for vehicle
@/lua/common/jbeam/sections/wheels.lua
local nodeStabilizerExists = false
local wheelAngleRad = math.rad(wheel.wheelAngle or 0)
@/lua/ge/extensions/tech/impactgen/crashOutput.lua
for angle = 0,359,15 do
table.insert(renderQueue, {request, pos, baseAngle + math.rad(angle), count})
count = count + 1
local function continueLinear(request, angle, aPos, bPos, bRot, throttle, config, ego, other)
local rot = quatFromEuler(0, 0, math.rad(angle))
ego:setPositionRotation(aPos[1], aPos[2], aPos[3], rot.x, rot.y, rot.z, rot.w)
ego:setPositionRotation(aPos[1], aPos[2], aPos[3], rot.x, rot.y, rot.z, rot.w)
rot = quatFromEuler(math.rad(bRot[1]), math.rad(bRot[2]), math.rad(bRot[3]))
other:setPositionRotation(bPos[1], bPos[2], bPos[3], rot.x, rot.y, rot.z, rot.w)
ego:setPositionRotation(aPos[1], aPos[2], aPos[3], rot.x, rot.y, rot.z, rot.w)
rot = quatFromEuler(math.rad(bRot[1]), math.rad(bRot[2]), math.rad(bRot[3]))
other:setPositionRotation(bPos[1], bPos[2], bPos[3], rot.x, rot.y, rot.z, rot.w)
ego:setPositionRotation(aPos[1], aPos[2], aPos[3], rot.x, rot.y, rot.z, rot.w)
rot = quatFromEuler(math.rad(bRot[1]), math.rad(bRot[2]), math.rad(bRot[3]))
other:setPositionRotation(bPos[1], bPos[2], bPos[3], rot.x, rot.y, rot.z, rot.w)
local function continueTBone(request, angle, aPos, bPos, bRot, throttle, config, ego, other)
local rot = quatFromEuler(0, 0, math.rad(angle))
ego:setPositionRotation(aPos[1], aPos[2], aPos[3], rot.x, rot.y, rot.z, rot.w)
ego:setPositionRotation(aPos[1], aPos[2], aPos[3], rot.x, rot.y, rot.z, rot.w)
rot = quatFromEuler(math.rad(bRot[1]), math.rad(bRot[2]), math.rad(bRot[3]))
other:setPositionRotation(bPos[1], bPos[2], bPos[3], rot.x, rot.y, rot.z, rot.w)
ego:setPositionRotation(aPos[1], aPos[2], aPos[3], rot.x, rot.y, rot.z, rot.w)
rot = quatFromEuler(math.rad(bRot[1]), math.rad(bRot[2]), math.rad(bRot[3]))
other:setPositionRotation(bPos[1], bPos[2], bPos[3], rot.x, rot.y, rot.z, rot.w)
ego:setPositionRotation(aPos[1], aPos[2], aPos[3], rot.x, rot.y, rot.z, rot.w)
rot = quatFromEuler(math.rad(bRot[1]), math.rad(bRot[2]), math.rad(bRot[3]))
other:setPositionRotation(bPos[1], bPos[2], bPos[3], rot.x, rot.y, rot.z, rot.w)
local function continuePole(request, angle, pos, throttle, config, ego)
local rot = quatFromEuler(0, 0, math.rad(angle))
ego:setPositionRotation(pos[1], pos[2], pos[3], rot.x, rot.y, rot.z, rot.w)
@/lua/ge/extensions/util/instancedLineRenderDemo.lua
rotY = 50 -- dt * 0.5
local rot = quatFromEuler(0, math.rad(rotY), 0)