📄 quat.inc
字号:
{* ______ ___ ___
* /\ _ \ /\_ \ /\_ \
* \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___
* \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
* \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
* \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
* \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
* /\____/
* \_/__/
*
* Quaternion routines.
*
* By Shawn Hargreaves.
*
* See readme.txt for copyright information.
*}
{$IFDEF ALLEGRO_INTERFACE}
type
P_QUAT = ^QUAT;
QUAT = record
w, x, y, z: single;
end;
var
identity_quat: P_QUAT;
quat_mul: procedure(const p, q: P_QUAT; var outq: QUAT); cdecl;
get_x_rotate_quat: procedure(q: P_QUAT; r: single); cdecl;
get_y_rotate_quat: procedure(q: P_QUAT; r: single); cdecl;
get_z_rotate_quat: procedure(q: P_QUAT; r: single); cdecl;
get_rotation_quat: procedure(q: P_QUAT; x, y, z: single); cdecl;
get_vector_rotation_quat: procedure(q: P_QUAT; x, y, z, a: single); cdecl;
apply_quat: procedure(const q: P_QUAT; x, y, z: single; var xout, yout, zout: single); cdecl;
quat_slerp: procedure(const from, toq: P_QUAT; t: single; var out: QUAT; how: sint32); cdecl;
const
QUAT_SHORT = 0;
QUAT_LONG = 1;
QUAT_CW = 2;
QUAT_CCW = 3;
QUAT_USER = 4;
procedure quat_interpolate(const from, toq: P_QUAT; t: single; var out: QUAT);
{$ENDIF ALLEGRO_INTERFACE}
{$IFDEF ALLEGRO_IMPLEMENTATION}
procedure quat_interpolate(const from, toq: P_QUAT; t: single; var out: QUAT);
begin
quat_slerp(from, toq, t, out, QUAT_SHORT);
end;
{$ENDIF ALLEGRO_IMPLEMENTATION}
{$IFDEF ALLEGRO_LOADVARIABLE}
identity_quat := LoadDLL('identity_quat');
quat_mul := LoadDLL('quat_mul');
get_x_rotate_quat := LoadDLL('get_x_rotate_quat');
get_y_rotate_quat := LoadDLL('get_y_rotate_quat');
get_z_rotate_quat := LoadDLL('get_z_rotate_quat');
get_rotation_quat := LoadDLL('get_rotation_quat');
get_vector_rotation_quat := LoadDLL('get_vector_rotation_quat');
apply_quat := LoadDLL('apply_quat');
quat_slerp := LoadDLL('quat_slerp');
{$ENDIF ALLEGRO_LOADVARIABLE}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -