Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@ local function predict(dt)

--M.target_transform.angular_velocity = M.received_transform.angular_velocity + M.received_transform.angular_acceleration * M.received_transform.time_past
--local rotation_delta = M.target_transform.angular_velocity * M.received_transform.time_past
M.target_transform.rotation = quat(M.received_transform.rotation)-- * quatFromEuler(rotation_delta.x, rotation_delta.y, rotation_delta.z)

local rotation_delta = (M.received_transform.angular_velocity + M.received_transform.angular_acceleration * M.received_transform.time_past) * M.received_transform.time_past

if rotation_delta:length() > 0 then
local axis = rotation_delta:normalized()
local half_angle = rotation_delta:length() * 0.5
local q_delta = quat(axis.x * math.sin(half_angle), axis.y * math.sin(half_angle), axis.z * math.sin(half_angle), math.cos(half_angle))
M.target_transform.rotation = quat(M.received_transform.rotation) * q_delta
end
end

local function try_rude()
Expand Down