59 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Lua
		
	
	
	
	
	
--
 | 
						|
-- DESCRIPTION
 | 
						|
--
 | 
						|
-- @COMPANY **
 | 
						|
-- @AUTHOR **
 | 
						|
-- @DATE ${date} ${time}
 | 
						|
--
 | 
						|
require "UnLua"
 | 
						|
---@type NiagaraActor_C
 | 
						|
local M = UnLua.Class()
 | 
						|
 | 
						|
-- function M:Initialize(Initializer)
 | 
						|
-- end
 | 
						|
 | 
						|
-- function M:UserConstructionScript()
 | 
						|
-- end
 | 
						|
function M:PrintQuat(Label, Quat)
 | 
						|
    print(Label, Quat.X, Quat.Y, Quat.Z, Quat.W)
 | 
						|
end
 | 
						|
function M:PrintRot(Label, Rot)
 | 
						|
    print(Label, Rot.Pitch, Rot.Yaw, Rot.Roll)
 | 
						|
end
 | 
						|
local BindKey = UnLua.Input.BindKey
 | 
						|
BindKey(M, "Q", "Pressed", function(self, Key)
 | 
						|
    local UKismetMathLibrary = UE.UKismetMathLibrary
 | 
						|
    local Pitch = 1
 | 
						|
    local Yaw = 90
 | 
						|
    local Roll = 1
 | 
						|
    local Rot = UE.FRotator(Pitch, Yaw, Roll)
 | 
						|
    local Quat = UKismetMathLibrary.Conv_RotatorToQuaternion(Rot)
 | 
						|
    local ToRot = UKismetMathLibrary.Quat_Rotator(Quat)
 | 
						|
    self:PrintRot("Rot", Rot.test)
 | 
						|
    self:PrintQuat("Quat", Quat)
 | 
						|
    self:PrintRot("NewRot", ToRot)
 | 
						|
 | 
						|
    local Euler = UE.FVector(Roll, Pitch, Yaw)
 | 
						|
    local NewQuat = UKismetMathLibrary.Quat_MakeFromEuler(Euler)
 | 
						|
    local NewToRot = UKismetMathLibrary.Quat_Rotator(NewQuat)
 | 
						|
    self:PrintQuat("Euler", Euler)
 | 
						|
    self:PrintQuat("NewQuat", NewQuat)
 | 
						|
    self:PrintRot("NewToRot", NewToRot)
 | 
						|
end)
 | 
						|
-- function M:ReceiveEndPlay()
 | 
						|
-- end
 | 
						|
 | 
						|
-- function M:ReceiveTick(DeltaSeconds)
 | 
						|
-- end
 | 
						|
 | 
						|
-- function M:ReceiveAnyDamage(Damage, DamageType, InstigatedBy, DamageCauser)
 | 
						|
-- end
 | 
						|
 | 
						|
-- function M:ReceiveActorBeginOverlap(OtherActor)
 | 
						|
-- end
 | 
						|
 | 
						|
-- function M:ReceiveActorEndOverlap(OtherActor)
 | 
						|
-- end
 | 
						|
 | 
						|
return M
 |