quatFromAxisAngle
Definition
-- @/lua/common/mathlib.lua:1114
function quatFromAxisAngle(axle, angleRad)
local r = newLuaQuatxyzw(0,0,0,0)
r:setFromAxisAngle(axle, angleRad)
return r
end
Callers
@/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),
if focusedWndData.mouseDragging2 and focusedWndData.lastMouseDragPos then
mainRVData.rot = quatFromAxisAngle(vec3(1,0,0), dy) * mainRVData.rot * quatFromAxisAngle(vec3(0,0,1), dx)
end
if focusedWndData.mouseDragging2 and focusedWndData.lastMouseDragPos then
mainRVData.rot = quatFromAxisAngle(vec3(1,0,0), dy) * mainRVData.rot * quatFromAxisAngle(vec3(0,0,1), dx)
end
@/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/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/ge/extensions/gameplay/crawl/general.lua
local reverseRot180 = quatFromAxisAngle(vec3(0, 1, 0), math.pi)
for _, node in ipairs(M.activeTrail.path.nodes) do
@/lua/ge/extensions/gameplay/markers/bigmapMarker.lua
camToClusterLeft:normalize()
local camToUpperPoint = quatFromAxisAngle(camToClusterLeft, (resolutionFactor * 0.05 * core_camera.getFovRad())):__mul(camToCluster)
if iconInfo then
local iconPos = quatFromAxisAngle(camToClusterLeft, (resolutionFactor * (0.02 + extraHeight) * core_camera.getFovRad())):__mul(camToUpperPoint)
bigMapModeColorI.alpha = bigMapMarkerAlpha *255
if iconInfo then
local iconPosColumn = quatFromAxisAngle(camToClusterLeft, (resolutionFactor * -0.03 * core_camera.getFovRad())):__mul(camToUpperPoint * 1.1)
tmpVec:set(data.camPos)
@/lua/common/jbeam/sections/wheels.lua
local rayRot = quatFromAxisAngle(axis, 2 * math.pi / (wheel.numRays* 2))
--log('D', "jbeam.addWheel","rayRot: " .. tostring(rayRot))
local rayRot = quatFromAxisAngle(axis, 2 * math.pi / (wheel.numRays* 2))
-- initial rotation
local tmpRot = quatFromAxisAngle(axis, 2 * math.pi / (wheel.numRays * 4))
-- all hub node rotation
rayRot = quatFromAxisAngle(axis, 2 * math.pi / (wheel.numRays))
--log('D', "jbeam.addMonoHubWheel","rayVector: " .. tostring(rayVec))
local rayVec = axis:perpendicularN() * wheel.radius
local rayRot = quatFromAxisAngle(axis, 2 * math.pi / (wheel.numRays* 2))
local rayVec = axis:perpendicularN() * wheel.radius
local rayRot = quatFromAxisAngle(axis, 2 * math.pi / (wheel.numRays* 2))
local rayRot = quatFromAxisAngle(axis, 2 * math.pi / (wheel.numRays* 2))
--log('D', "jbeam.addHubWheel","rayRot: " .. tostring(rayRot))
local tmpRot = quatFromAxisAngle(axis, 2 * math.pi / (hubCapNumRays * 4))
-- all hub node rotation
rayRot = quatFromAxisAngle(axis, 2 * math.pi / (hubCapNumRays))
local rayRot = quatFromAxisAngle(axis, 2 * math.pi / (wheel.numRays* 2))
local rayVec
rayVec = axis:perpendicularN() * wheel.radius
rayVec = quatFromAxisAngle(axis, -wheelAngleRad) * rayVec
local hasEvenRayCount = wheel.numRays % 2 == 0
rayVec = axis:perpendicularN() * wheel.hubRadius
rayVec = quatFromAxisAngle(axis, -wheelAngleRad) * rayVec
rayVec = axis:perpendicularN() * hubcapOptions.hubcapRadius
--rayVec = quatFromAxisAngle(axis, - wheelAngleRad + 2 * math.pi / (hubCapNumRays * 4)) * rayVec
rayRot = quatFromAxisAngle(axis, 2 * math.pi / hubCapNumRays)
--rayVec = quatFromAxisAngle(axis, - wheelAngleRad + 2 * math.pi / (hubCapNumRays * 4)) * rayVec
rayRot = quatFromAxisAngle(axis, 2 * math.pi / hubCapNumRays)
@/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/extensions/freeroam/bigMapMode.lua
local upperCamFovAngle = pitch - (camMode.fovMax - (camMode.fovMax * cameraAdditionalHeightFactor))/2
local lowerCamFovDir = quatFromAxisAngle(xVector, (lowerCamFovAngle) / 180 * math.pi):__mul(yVector)
local upperCamFovDir = quatFromAxisAngle(xVector, (upperCamFovAngle) / 180 * math.pi):__mul(yVector)
local lowerCamFovDir = quatFromAxisAngle(xVector, (lowerCamFovAngle) / 180 * math.pi):__mul(yVector)
local upperCamFovDir = quatFromAxisAngle(xVector, (upperCamFovAngle) / 180 * math.pi):__mul(yVector)
local planeNormal = upperCamFovDir:cross(xVector)
camPos = camPos - bbox:getCenter()
camPos = quatFromAxisAngle(zVector, (yaw) / 180 * math.pi):__mul(camPos)
camPos = camPos + bbox:getCenter()
bigMapCamRotation = quatFromDir(vec3(0,0,-1), yVector)
bigMapCamRotation = quatFromAxisAngle(xVector, -(90 - camMode.angle) / 180 * math.pi):__mul(bigMapCamRotation)
bigMapCamRotation = bigMapCamRotation:__mul(quatFromAxisAngle(zVector, camMode.rotAngle / 180 * math.pi))
bigMapCamRotation = quatFromAxisAngle(xVector, -(90 - camMode.angle) / 180 * math.pi):__mul(bigMapCamRotation)
bigMapCamRotation = bigMapCamRotation:__mul(quatFromAxisAngle(zVector, camMode.rotAngle / 180 * math.pi))
local camToClusterLeft = camUp:cross(camToCluster):normalized()
local camToUpperPoint = quatFromAxisAngle(camToClusterLeft, (resolutionFactor * 0.015 * core_camera.getFovRad())):__mul(camToCluster)
@/lua/ge/extensions/util/screenshotCreator.lua
local upperCamFovAngle = fov/2
local upperCamFovDir = quatFromAxisAngle(camLeft, (upperCamFovAngle) / 180 * math.pi):__mul(-camOffsetAxis)
local rightCamFovAngle = horizontalFOV/2
local rightCamFovDir = quatFromAxisAngle(camUp, (rightCamFovAngle) / 180 * math.pi):__mul(-camOffsetAxis)