mirror of
https://github.com/open-goal/jak-project
synced 2026-10-23 03:09:24 -04:00
[decompiler] More inline vector functions (#3861)
This adds more recognition for inlined vector functions to the decompiler, which can clean up a bunch of ugly looking code/`rlet`s.  Unfortunately, this changes the numbering of ops in the decomp, since all the vector instructions get combined in a single "operation" by the decompiler. I really tried to avoid having this ever happen in the decompiler and this is one of the few cases where it has. So I had to update a bunch of type casts. For that reason I haven't turned this on in Jak 2 yet, although I am planning to do that at some point. (probably at the same time as porting back a bunch of jak 3 improvements to jak 2) --------- Co-authored-by: water111 <awaterford1111445@gmail.com>
This commit is contained in:
@@ -369,8 +369,12 @@ std::string get_simple_expression_op_name(SimpleExpression::Kind kind) {
|
||||
return "vec4dot";
|
||||
case SimpleExpression::Kind::VECTOR_LENGTH:
|
||||
return "veclength";
|
||||
case SimpleExpression::Kind::VECTOR_LENGTH_SQUARED:
|
||||
return "veclength-squared";
|
||||
case SimpleExpression::Kind::VECTOR_PLUS_FLOAT_TIMES:
|
||||
return "vecplusfloattimes";
|
||||
case SimpleExpression::Kind::VECTOR_PLUS_TIMES:
|
||||
return "vecplustimes";
|
||||
case SimpleExpression::Kind::SET_ON_LESS_THAN:
|
||||
case SimpleExpression::Kind::SET_ON_LESS_THAN_IMM:
|
||||
return "set-on-less-than";
|
||||
@@ -440,8 +444,10 @@ int get_simple_expression_arg_count(SimpleExpression::Kind kind) {
|
||||
case SimpleExpression::Kind::SET_ON_LESS_THAN_IMM:
|
||||
return 2;
|
||||
case SimpleExpression::Kind::VECTOR_LENGTH:
|
||||
case SimpleExpression::Kind::VECTOR_LENGTH_SQUARED:
|
||||
return 1;
|
||||
case SimpleExpression::Kind::VECTOR_PLUS_FLOAT_TIMES:
|
||||
case SimpleExpression::Kind::VECTOR_PLUS_TIMES:
|
||||
return 4;
|
||||
default:
|
||||
ASSERT(false);
|
||||
|
||||
@@ -262,7 +262,9 @@ class SimpleExpression {
|
||||
VECTOR_3_DOT,
|
||||
VECTOR_4_DOT,
|
||||
VECTOR_LENGTH, // jak 2 only.
|
||||
VECTOR_LENGTH_SQUARED, // jak 2 only.
|
||||
VECTOR_PLUS_FLOAT_TIMES, // jak 2 only.
|
||||
VECTOR_PLUS_TIMES,
|
||||
SET_ON_LESS_THAN,
|
||||
SET_ON_LESS_THAN_IMM
|
||||
};
|
||||
|
||||
@@ -247,6 +247,7 @@ TP_Type SimpleExpression::get_type(const TypeState& input,
|
||||
case Kind::VECTOR_3_DOT:
|
||||
case Kind::VECTOR_4_DOT:
|
||||
case Kind::VECTOR_LENGTH:
|
||||
case Kind::VECTOR_LENGTH_SQUARED:
|
||||
return TP_Type::make_from_ts("float");
|
||||
default:
|
||||
throw std::runtime_error("Simple expression cannot get_type: " +
|
||||
|
||||
@@ -1890,8 +1890,12 @@ std::string fixed_operator_to_string(FixedOperatorKind kind) {
|
||||
return "mouse-hold?";
|
||||
case FixedOperatorKind::VECTOR_LENGTH:
|
||||
return "vector-length";
|
||||
case FixedOperatorKind::VECTOR_LENGTH_SQUARED:
|
||||
return "vector-length-squared";
|
||||
case FixedOperatorKind::VECTOR_PLUS_FLOAT_TIMES:
|
||||
return "vector+float*!";
|
||||
case FixedOperatorKind::VECTOR_PLUS_TIMES:
|
||||
return "vector+*!";
|
||||
case FixedOperatorKind::FOCUS_TEST:
|
||||
return "focus-test?";
|
||||
default:
|
||||
|
||||
@@ -231,6 +231,7 @@ class SimpleExpressionElement : public FormElement {
|
||||
void update_from_stack_vector_plus_float_times(const Env& env,
|
||||
FormPool& pool,
|
||||
FormStack& stack,
|
||||
FixedOperatorKind op,
|
||||
std::vector<FormElement*>* result,
|
||||
bool allow_side_effects);
|
||||
void update_from_stack_vectors_in_common(FixedOperatorKind kind,
|
||||
|
||||
@@ -1652,6 +1652,7 @@ void SimpleExpressionElement::update_from_stack_vector_plus_float_times(
|
||||
const Env& env,
|
||||
FormPool& pool,
|
||||
FormStack& stack,
|
||||
FixedOperatorKind op,
|
||||
std::vector<FormElement*>* result,
|
||||
bool allow_side_effects) {
|
||||
std::vector<Form*> popped_args = pop_to_forms({m_expr.get_arg(0).var(), m_expr.get_arg(1).var(),
|
||||
@@ -1668,9 +1669,8 @@ void SimpleExpressionElement::update_from_stack_vector_plus_float_times(
|
||||
}
|
||||
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::VECTOR_PLUS_FLOAT_TIMES),
|
||||
std::vector<Form*>{popped_args.at(0), popped_args.at(1), popped_args.at(2),
|
||||
popped_args.at(3)});
|
||||
GenericOperator::make_fixed(op), std::vector<Form*>{popped_args.at(0), popped_args.at(1),
|
||||
popped_args.at(2), popped_args.at(3)});
|
||||
result->push_back(new_form);
|
||||
}
|
||||
|
||||
@@ -2585,8 +2585,17 @@ void SimpleExpressionElement::update_from_stack(const Env& env,
|
||||
update_from_stack_vectors_in_common(FixedOperatorKind::VECTOR_LENGTH, env, pool, stack,
|
||||
result, allow_side_effects);
|
||||
break;
|
||||
case SimpleExpression::Kind::VECTOR_LENGTH_SQUARED:
|
||||
update_from_stack_vectors_in_common(FixedOperatorKind::VECTOR_LENGTH_SQUARED, env, pool,
|
||||
stack, result, allow_side_effects);
|
||||
break;
|
||||
case SimpleExpression::Kind::VECTOR_PLUS_FLOAT_TIMES:
|
||||
update_from_stack_vector_plus_float_times(env, pool, stack, result, allow_side_effects);
|
||||
update_from_stack_vector_plus_float_times(
|
||||
env, pool, stack, FixedOperatorKind::VECTOR_PLUS_FLOAT_TIMES, result, allow_side_effects);
|
||||
break;
|
||||
case SimpleExpression::Kind::VECTOR_PLUS_TIMES:
|
||||
update_from_stack_vector_plus_float_times(
|
||||
env, pool, stack, FixedOperatorKind::VECTOR_PLUS_TIMES, result, allow_side_effects);
|
||||
break;
|
||||
default:
|
||||
throw std::runtime_error(
|
||||
|
||||
@@ -171,7 +171,9 @@ enum class FixedOperatorKind {
|
||||
PPOINTER_TO_PROCESS,
|
||||
VECTOR_4_DOT,
|
||||
VECTOR_LENGTH,
|
||||
VECTOR_LENGTH_SQUARED,
|
||||
VECTOR_PLUS_FLOAT_TIMES,
|
||||
VECTOR_PLUS_TIMES,
|
||||
SEND_EVENT,
|
||||
CPAD_PRESSED_P,
|
||||
CPAD_HOLD_P,
|
||||
|
||||
@@ -1962,6 +1962,75 @@ std::unique_ptr<AtomicOp> convert_6(const Instruction& i0,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<AtomicOp> convert_vector_length_squared(const Instruction* instrs, int idx) {
|
||||
// 0: lqc2 vf1, 0(a0)
|
||||
if (instrs[0].kind != InstructionKind::LQC2 || instrs[0].get_dst(0).get_reg() != make_vf(1) ||
|
||||
!instrs[0].get_src(0).is_imm(0)) {
|
||||
return nullptr;
|
||||
}
|
||||
Register vec_src = instrs[0].get_src(1).get_reg();
|
||||
|
||||
auto vf0 = make_vf(0);
|
||||
auto vf1 = make_vf(1);
|
||||
auto vf2 = make_vf(2);
|
||||
|
||||
// 1: vaddw.x vf2, vf0, vf0
|
||||
if (instrs[1].kind != InstructionKind::VADD_BC || instrs[1].get_dst(0).get_reg() != vf2 ||
|
||||
instrs[1].get_src(0).get_reg() != vf0 || instrs[1].get_src(1).get_reg() != vf0 ||
|
||||
instrs[1].cop2_dest != 0b1000 || instrs[1].cop2_bc != 3) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// 2: vmul.xyzw vf1, vf1, vf1
|
||||
if (instrs[2].kind != InstructionKind::VMUL || instrs[2].get_dst(0).get_reg() != vf1 ||
|
||||
instrs[2].get_src(0).get_reg() != vf1 || instrs[2].get_src(1).get_reg() != vf1 ||
|
||||
instrs[2].cop2_dest != 0b1111) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// 3: vmulax.x acc, vf2, vf1
|
||||
if (instrs[3].kind != InstructionKind::VMULA_BC || instrs[3].get_src(0).get_reg() != vf2 ||
|
||||
instrs[3].get_src(1).get_reg() != vf1 || instrs[3].cop2_dest != 0b1000 ||
|
||||
instrs[3].cop2_bc != 0) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// 4: vmadday.x acc, vf2, vf1
|
||||
if (instrs[4].kind != InstructionKind::VMADDA_BC || instrs[4].get_src(0).get_reg() != vf2 ||
|
||||
instrs[4].get_src(1).get_reg() != vf1 || instrs[4].cop2_dest != 0b1000 ||
|
||||
instrs[4].cop2_bc != 1) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// 5: vmaddz.x vf1, vf2, vf1
|
||||
if (instrs[5].kind != InstructionKind::VMADD_BC || instrs[5].get_dst(0).get_reg() != vf1 ||
|
||||
instrs[5].get_src(0).get_reg() != vf2 || instrs[5].get_src(1).get_reg() != vf1 ||
|
||||
instrs[5].cop2_dest != 0b1000 || instrs[5].cop2_bc != 2) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// 6: qmfc2.i v0, vf1
|
||||
if (instrs[6].kind != InstructionKind::QMFC2 || instrs[6].src->get_reg() != vf1) {
|
||||
return nullptr;
|
||||
}
|
||||
auto dst = instrs[6].get_dst(0).get_reg();
|
||||
return std::make_unique<SetVarOp>(
|
||||
make_dst_var(dst, idx),
|
||||
SimpleExpression(SimpleExpression::Kind::VECTOR_LENGTH_SQUARED, make_src_atom(vec_src, idx)),
|
||||
idx);
|
||||
}
|
||||
|
||||
std::unique_ptr<AtomicOp> convert_7(const Instruction* instrs, int idx, GameVersion version) {
|
||||
if (version == GameVersion::Jak3) {
|
||||
auto as_vector_length_squared = convert_vector_length_squared(instrs, idx);
|
||||
if (as_vector_length_squared) {
|
||||
return as_vector_length_squared;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<AtomicOp> convert_vector_plus_float_times(const Instruction* instrs, int idx) {
|
||||
// lqc2 vf2, 0(a2)
|
||||
if (instrs[0].kind != InstructionKind::LQC2 || instrs[0].get_dst(0).get_reg() != make_vf(2) ||
|
||||
@@ -2029,11 +2098,83 @@ std::unique_ptr<AtomicOp> convert_vector_plus_float_times(const Instruction* ins
|
||||
idx);
|
||||
}
|
||||
|
||||
std::unique_ptr<AtomicOp> convert_8(const Instruction* instrs, int idx) {
|
||||
std::unique_ptr<AtomicOp> convert_vector_plus_times(const Instruction* instrs, int idx) {
|
||||
// 0: mfc1 a3, f0
|
||||
if (instrs[0].kind != InstructionKind::MFC1) {
|
||||
return nullptr;
|
||||
}
|
||||
Register flt_src_3 = instrs[0].get_src(0).get_reg();
|
||||
Register temp = instrs[0].get_dst(0).get_reg();
|
||||
|
||||
// 1: qmtc2.i vf7, a3
|
||||
if (instrs[1].kind != InstructionKind::QMTC2 || instrs[1].get_dst(0).get_reg() != make_vf(7) ||
|
||||
instrs[1].get_src(0).get_reg() != temp) {
|
||||
return nullptr;
|
||||
}
|
||||
// 2: lqc2 vf5, 0(a2)
|
||||
if (instrs[2].kind != InstructionKind::LQC2 || instrs[2].get_dst(0).get_reg() != make_vf(5) ||
|
||||
!instrs[2].get_src(0).is_imm(0)) {
|
||||
return nullptr;
|
||||
}
|
||||
Register vec_src_2 = instrs[2].get_src(1).get_reg();
|
||||
|
||||
// 3: lqc2 vf4, 0(a1)
|
||||
if (instrs[3].kind != InstructionKind::LQC2 || instrs[3].get_dst(0).get_reg() != make_vf(4) ||
|
||||
!instrs[3].get_src(0).is_imm(0)) {
|
||||
return nullptr;
|
||||
}
|
||||
Register vec_src_1 = instrs[3].get_src(1).get_reg();
|
||||
|
||||
// 4: vaddx.w vf6, vf0, vf0
|
||||
if (instrs[4].kind != InstructionKind::VADD_BC || instrs[4].get_dst(0).get_reg() != make_vf(6) ||
|
||||
instrs[4].get_src(0).get_reg() != make_vf(0) ||
|
||||
instrs[4].get_src(1).get_reg() != make_vf(0) || instrs[4].cop2_bc != 0 ||
|
||||
instrs[4].cop2_dest != 0b0001) {
|
||||
return nullptr;
|
||||
}
|
||||
// 5: vmulax.xyz acc, vf5, vf7
|
||||
// vmulax.xyz acc, vf5, vf7
|
||||
if (instrs[5].kind != InstructionKind::VMULA_BC || instrs[5].get_src(0).get_reg() != make_vf(5) ||
|
||||
instrs[5].get_src(1).get_reg() != make_vf(7) || instrs[5].cop2_dest != 0b1110 ||
|
||||
instrs[5].cop2_bc != 0) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// 6: vmaddw.xyz vf6, vf4, vf0
|
||||
if (instrs[6].kind != InstructionKind::VMADD_BC || instrs[6].get_dst(0).get_reg() != make_vf(6) ||
|
||||
instrs[6].get_src(0).get_reg() != make_vf(4) ||
|
||||
instrs[6].get_src(1).get_reg() != make_vf(0) || instrs[6].cop2_dest != 0b1110 ||
|
||||
instrs[6].cop2_bc != 3) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// 7: sqc2 vf6, 0(a0)
|
||||
if (instrs[7].kind != InstructionKind::SQC2 || instrs[7].get_src(0).get_reg() != make_vf(6) ||
|
||||
!instrs[7].get_src(1).is_imm(0)) {
|
||||
return nullptr;
|
||||
}
|
||||
Register dst = instrs[7].get_src(2).get_reg();
|
||||
|
||||
return std::make_unique<SetVarOp>(
|
||||
make_dst_var(dst, idx),
|
||||
SimpleExpression(SimpleExpression::Kind::VECTOR_PLUS_TIMES, make_src_atom(dst, idx),
|
||||
make_src_atom(vec_src_1, idx), make_src_atom(vec_src_2, idx),
|
||||
make_src_atom(flt_src_3, idx)),
|
||||
idx);
|
||||
}
|
||||
|
||||
std::unique_ptr<AtomicOp> convert_8(const Instruction* instrs, int idx, GameVersion version) {
|
||||
auto as_vector_float_plus_times = convert_vector_plus_float_times(instrs, idx);
|
||||
if (as_vector_float_plus_times) {
|
||||
return as_vector_float_plus_times;
|
||||
}
|
||||
|
||||
if (version == GameVersion::Jak3) {
|
||||
auto as_vector_plus_times = convert_vector_plus_times(instrs, idx);
|
||||
if (as_vector_plus_times) {
|
||||
return as_vector_plus_times;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -2378,13 +2519,21 @@ int convert_block_to_atomic_ops(int begin_idx,
|
||||
}
|
||||
|
||||
if (!converted && n_instr >= 8) {
|
||||
op = convert_8(&instr[0], op_idx);
|
||||
op = convert_8(&instr[0], op_idx, version);
|
||||
if (op) {
|
||||
converted = true;
|
||||
length = 8;
|
||||
}
|
||||
}
|
||||
|
||||
if (!converted && n_instr >= 7) {
|
||||
op = convert_7(&instr[0], op_idx, version);
|
||||
if (op) {
|
||||
converted = true;
|
||||
length = 7;
|
||||
}
|
||||
}
|
||||
|
||||
if (!converted && n_instr >= 6) {
|
||||
// try 6 instructions
|
||||
op = convert_6(instr[0], instr[1], instr[2], instr[3], instr[4], instr[5], op_idx);
|
||||
|
||||
@@ -2398,7 +2398,7 @@
|
||||
(define-extern quaternion-rotate-y-to-vector! (function quaternion quaternion quaternion float quaternion))
|
||||
(define-extern vector-rotate-around-axis!
|
||||
"Rotate along y so z-axis points to match another. Use arg3 as the max rotation amount."
|
||||
(function vector quaternion float vector vector))
|
||||
(function vector vector float vector vector))
|
||||
(define-extern vector-rotate-x! "Rotate vector along x axis." (function vector vector float vector))
|
||||
(define-extern vector-rotate-y! "Rotate vector along y axis." (function vector vector float vector))
|
||||
(define-extern vector-rotate-z! "Rotate vector along z axis." (function vector vector float vector))
|
||||
@@ -17618,7 +17618,7 @@
|
||||
exit ;; 16
|
||||
)
|
||||
(:methods
|
||||
(talker-method-17 (_type_) none) ;; 17
|
||||
(draw-text (_type_) none) ;; 17
|
||||
)
|
||||
)
|
||||
|
||||
@@ -19477,6 +19477,21 @@
|
||||
;; ---aligner-h:align-opts
|
||||
|
||||
(deftype align-control (basic)
|
||||
"Align-control is a utility for moving a process-drawable based on its animation.
|
||||
The animation format has two special parent-like joints: prejoint and align.
|
||||
The prejoint is the parent for all joints, so it causes all bones to move.
|
||||
The align joint has no children, but the convention is that moving align will
|
||||
cause the entire process-drawable's root to move, effectively moving the entire character.
|
||||
Most of the time, this is the preferable way to move a character as part of an animation -
|
||||
it will update their velocity and when the animation ends or is canceled,
|
||||
the offset in position from playing the animation will stay. For example, if Jak punches,
|
||||
his velocity will increase due to the animated align in the punch animation.
|
||||
To implement this, the align-control computes the relative transform between align frames.
|
||||
To apply the position offset, typically the velocity is updated, then the normal per-frame
|
||||
physics update will end up moving the position. For orientation, there is no concept of
|
||||
angular velocity, so instead align-control directly modifies the quaternion.
|
||||
Unlike normal animation evaluation, the alignment's blend is computed in a different way
|
||||
that doesn't blend and instead just picks the most recently pushed animation."
|
||||
((flags align-flags :offset-assert 4) ;; guessed by decompiler
|
||||
(process process-drawable :offset-assert 8) ;; guessed by decompiler
|
||||
(frame-group art-joint-anim :offset-assert 12) ;; guessed by decompiler
|
||||
@@ -19492,11 +19507,12 @@
|
||||
:flag-assert #xe00000134
|
||||
(:methods
|
||||
(new (symbol type process) _type_) ;; 0
|
||||
(compute-alignment! (_type_) transformq) ;; 9
|
||||
(align! (_type_ align-opts float float float) trsqv) ;; 10
|
||||
(align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv) ;; 11
|
||||
(first-transform (_type_) transform) ;; 12
|
||||
(second-transform (_type_) transform) ;; 13
|
||||
(compute-delta-align! "Compute the change in align since the last time this was called." (_type_) transformq) ;; 9
|
||||
(align! "Apply the alignment to the process-drawable." (_type_ align-opts float float float) trsqv) ;; 10
|
||||
(adjust-root-no-gravity! "Adjust the quat and transv of the process drawable to take into account the
|
||||
most recent change in align." (_type_ align-opts vector int float float) trsqv) ;; 11
|
||||
(first-transform "Get the more recent align transform" (_type_) transform) ;; 12
|
||||
(second-transform "Get the second most recent align trasnform" (_type_) transform) ;; 13
|
||||
)
|
||||
)
|
||||
|
||||
@@ -42344,6 +42360,7 @@
|
||||
)
|
||||
|
||||
(deftype joint-exploder-list (structure)
|
||||
"Linked list of joint-exploder-joint."
|
||||
((head int32 :offset-assert 0)
|
||||
(pre-moved? symbol :offset-assert 4) ;; guessed by decompiler
|
||||
(bbox-valid? symbol :offset-assert 8) ;; guessed by decompiler
|
||||
@@ -42364,6 +42381,8 @@
|
||||
)
|
||||
|
||||
(deftype joint-exploder (process-drawable)
|
||||
"The joint-exploder animates an object exploding into pieces.
|
||||
For example, geyser rock dummies, or the jak 1 zoomer."
|
||||
((parent (pointer process-drawable) :override)
|
||||
(die-if-below-y float :offset-assert 200)
|
||||
(die-if-beyond-xz-dist-sqrd float :offset-assert 204)
|
||||
@@ -42379,14 +42398,14 @@
|
||||
:size-assert #x158
|
||||
:flag-assert #x1e00e00158
|
||||
(:methods
|
||||
(add-joint-to-list (_type_ joint-exploder-list int) int) ;; 20
|
||||
(update-bbox-for-joint (_type_ joint-exploder-list joint-exploder-joint) none) ;; 21
|
||||
(add-joint-to-list "Add a joint to the given linked list of joints." (_type_ joint-exploder-list int) int) ;; 20
|
||||
(update-bbox-for-joint "Update the bounding box to include the joint" (_type_ joint-exploder-list joint-exploder-joint) none) ;; 21
|
||||
(do-collision-response (_type_ joint-exploder-list) none) ;; 22
|
||||
(init-joint-list (_type_) none) ;; 23
|
||||
(remove-from-list-and-reset (_type_ joint-exploder-list int) int) ;; 24
|
||||
(remove-from-list-and-reset "Remove a joint from the list and clear its transform" (_type_ joint-exploder-list int) int) ;; 24
|
||||
(final-adjust (_type_ joint-exploder-list int) int) ;; 25
|
||||
(integrate-and-kill (_type_ joint-exploder-list) none) ;; 26
|
||||
(remove-joint-from-list (_type_ joint-exploder-list int) int) ;; 27
|
||||
(remove-joint-from-list "Remove a joint from the linked list and invalidate the bbox." (_type_ joint-exploder-list int) int) ;; 27
|
||||
(adjust-bbox-for-limits-along-axis (_type_ joint-exploder-list int) joint-exploder-list) ;; 28
|
||||
(adjust-bbox-for-limits (_type_ joint-exploder-list) none) ;; 29
|
||||
)
|
||||
@@ -42395,7 +42414,7 @@
|
||||
)
|
||||
)
|
||||
|
||||
(define-extern joint-exploder-joint-callback (function draw-control cspace-array joint-control none))
|
||||
(define-extern joint-exploder-joint-callback "Postbind callback to set bones to the result of the joint-exploder." (function draw-control cspace-array joint-control none))
|
||||
(define-extern joint-exploder-init-by-other (function skeleton-group int joint-exploder-tuning joint-exploder-static-params object :behavior joint-exploder))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
@@ -558,7 +558,7 @@
|
||||
"(method 32 task-manager-dark-punch-training)": [[53, 0]],
|
||||
"(method 32 task-manager-lightjak-training-shield)": [[53, 0]],
|
||||
"(trans credits highres-viewer-manager)": [[185, 0]],
|
||||
"(trans idle hirez-viewer)": [[356, 0]],
|
||||
"(trans idle hirez-viewer)": [[342, 0]],
|
||||
"(trans idle burning-bush)": [
|
||||
[171, 1],
|
||||
[202, 0]
|
||||
|
||||
@@ -1927,7 +1927,6 @@
|
||||
[16, "vector"],
|
||||
[32, ["array", "collide-shape", 384]]
|
||||
],
|
||||
"(method 35 fac-gun-tower)": [[32, "vector"]],
|
||||
"fac-robotank-init-by-other": [[32, "vector"]],
|
||||
"(trans flying factory-fighter)": [[16, "vector"]],
|
||||
"(method 16 factory-manager)": [
|
||||
|
||||
@@ -584,7 +584,7 @@
|
||||
[6, "gp", "joint-mod-ik"],
|
||||
[9, "gp", "joint-mod-ik"],
|
||||
[[1, 35], "gp", "joint-mod-ik"],
|
||||
[[1, 422], "gp", "joint-mod-ik"]
|
||||
[[1, 414], "gp", "joint-mod-ik"]
|
||||
],
|
||||
"real-joint-mod-gun-look-at-handler": [
|
||||
[1, "v1", "joint-mod"],
|
||||
@@ -2226,13 +2226,16 @@
|
||||
[512, "v1", "camera-slave"],
|
||||
[542, "v1", "camera-slave"],
|
||||
[611, "a0", "vector"],
|
||||
[799, "v1", "float"],
|
||||
[784, "v1", "vector"],
|
||||
[789, "v1", "float"],
|
||||
[792, "v1", "float"],
|
||||
[794, "v0", "float"],
|
||||
|
||||
// [784, "v1", "vector"],
|
||||
[589, "v1", "float"],
|
||||
[593, "v1", "float"],
|
||||
[602, "v1", "float"],
|
||||
[606, "v1", "float"],
|
||||
[796, "v1", "float"]
|
||||
[606, "v1", "float"]
|
||||
// [796, "v1", "float"]
|
||||
],
|
||||
"master-track-target": [
|
||||
[53, "gp", "process-focusable"],
|
||||
@@ -3339,7 +3342,7 @@
|
||||
[298, "a0", "process-focusable"],
|
||||
[300, "a0", "process-focusable"]
|
||||
],
|
||||
"(method 14 rigid-body-control)": [[18, "v1", "vector"]],
|
||||
"(method 14 rigid-body-control)": [[11, "v1", "vector"]],
|
||||
"transform-rigid-body-prims": [[4, "v1", "collide-shape-prim-group"]],
|
||||
"(method 67 collide-shape-moving)": [
|
||||
[8, "v1", "collide-shape-prim-group"],
|
||||
@@ -3554,10 +3557,10 @@
|
||||
[314, "s1", "process-focusable"]
|
||||
],
|
||||
"gun-fire-red-1": [
|
||||
[147, "v1", "manipy"],
|
||||
[191, "v1", "manipy"],
|
||||
[194, "v1", "manipy"],
|
||||
[197, "v1", "manipy"]
|
||||
[140, "v1", "manipy"],
|
||||
[184, "v1", "manipy"],
|
||||
[187, "v1", "manipy"],
|
||||
[190, "v1", "manipy"]
|
||||
],
|
||||
"(method 23 gun-red-shot)": [[10, "s4", "process-focusable"]],
|
||||
"(method 26 gun-red-shot)": [
|
||||
@@ -3930,10 +3933,10 @@
|
||||
[254, "a0", "(state target)"]
|
||||
],
|
||||
"collide-list-fill-bg-using-line-sphere": [
|
||||
[261, "a0", "collide-hash-scratch"],
|
||||
[[279, 285], "v1", "collide-hash-scratch"],
|
||||
[[246, 251], "v1", "collide-hash-scratch"],
|
||||
[293, "a0", "collide-hash-scratch"],
|
||||
[287, "a0", "collide-hash-scratch"],
|
||||
[[272, 280], "v1", "collide-hash-scratch"],
|
||||
[[239, 246], "v1", "collide-hash-scratch"],
|
||||
[255, "a0", "collide-hash-scratch"],
|
||||
[102, "v1", "float"]
|
||||
],
|
||||
"collide-list-fill-bg-using-box": [
|
||||
@@ -3994,9 +3997,9 @@
|
||||
"(method 9 collide-edge-edge)": [[20, "a0", "collide-shape-moving"]],
|
||||
"(method 13 collide-edge-work)": [[[8, 119], "s1", "collide-edge-edge"]],
|
||||
"(method 20 collide-edge-work)": [
|
||||
[100, "a0", "collide-shape-moving"],
|
||||
[179, "v1", "int"],
|
||||
[179, "a1", "int"]
|
||||
[93, "a0", "collide-shape-moving"],
|
||||
[172, "v1", "int"],
|
||||
[172, "a1", "int"]
|
||||
],
|
||||
"collide-shape-draw-debug-marks": [
|
||||
[24, "v1", "connection"],
|
||||
@@ -4048,7 +4051,7 @@
|
||||
],
|
||||
"(method 19 collide-shape-prim)": [[[3, 32], "s4", "collide-shape-prim"]],
|
||||
"(method 18 collide-shape-prim-sphere)": [
|
||||
[79, "s4", "collide-shape-prim-mesh"]
|
||||
[72, "s4", "collide-shape-prim-mesh"]
|
||||
],
|
||||
"(method 66 collide-shape-moving)": [[[29, 58], "s0", "collide-cache-prim"]],
|
||||
"(method 56 collide-shape-moving)": [
|
||||
@@ -4096,10 +4099,10 @@
|
||||
[65, "s4", "(inline-array collide-cache-prim)"]
|
||||
],
|
||||
"(method 20 collide-cache)": [
|
||||
[50, "v1", "connection"],
|
||||
[51, "s1", "collide-shape"],
|
||||
[114, "v1", "connection"],
|
||||
[115, "s1", "collide-shape"]
|
||||
[44, "v1", "connection"],
|
||||
[45, "s1", "collide-shape"],
|
||||
[108, "v1", "connection"],
|
||||
[109, "s1", "collide-shape"]
|
||||
],
|
||||
"(method 19 collide-cache)": [
|
||||
[26, "a0", "connection"],
|
||||
@@ -4806,7 +4809,7 @@
|
||||
[3, "v1", "process-drawable"],
|
||||
[36, "s5", "collide-shape"],
|
||||
[41, "s5", "collide-shape"],
|
||||
[85, "s5", "collide-shape-moving"]
|
||||
[78, "s5", "collide-shape-moving"]
|
||||
],
|
||||
"target-mech-collision": [[108, "v0", "carry-info"]],
|
||||
"(anon-function 8 target-mech)": [
|
||||
@@ -4925,7 +4928,7 @@
|
||||
[3, "v1", "process-drawable"],
|
||||
[36, "s5", "collide-shape"],
|
||||
[41, "s5", "collide-shape"],
|
||||
[96, "s5", "collide-shape-moving"]
|
||||
[89, "s5", "collide-shape-moving"]
|
||||
],
|
||||
"(anon-function 74 target-flut)": [
|
||||
[[0, 56], "gp", "target"],
|
||||
@@ -6380,13 +6383,13 @@
|
||||
"(method 13 was-squad-control)": [
|
||||
[42, "v1", "process-focusable"],
|
||||
[47, "v1", "process-focusable"],
|
||||
[121, "s3", "process-focusable"],
|
||||
[127, "s3", "process-focusable"],
|
||||
[133, "s3", "process-focusable"],
|
||||
[138, "s3", "process-focusable"],
|
||||
[142, "s3", "process-focusable"],
|
||||
[69, "v1", "process-focusable"],
|
||||
[265, "a1", "process-focusable"],
|
||||
[233, "v1", "process-focusable"]
|
||||
[132, "s3", "process-focusable"],
|
||||
[136, "s3", "process-focusable"],
|
||||
[63, "v1", "process-focusable"],
|
||||
[259, "a1", "process-focusable"],
|
||||
[227, "v1", "process-focusable"]
|
||||
],
|
||||
"(method 35 was-squad-control)": [
|
||||
[37, "s4", "process-focusable"],
|
||||
@@ -6427,9 +6430,9 @@
|
||||
[477, "v1", "float"]
|
||||
],
|
||||
"(method 77 wvehicle)": [
|
||||
[179, "s4", "process-focusable"],
|
||||
[186, "s4", "process-focusable"],
|
||||
[194, "s4", "process-focusable"]
|
||||
[167, "s4", "process-focusable"],
|
||||
[174, "s4", "process-focusable"],
|
||||
[182, "s4", "process-focusable"]
|
||||
],
|
||||
"(method 165 wvehicle)": [
|
||||
[102, "s2", "process-focusable"],
|
||||
@@ -6511,18 +6514,18 @@
|
||||
[45, "a0", "process-focusable"]
|
||||
],
|
||||
"(code target-pilot-impact)": [
|
||||
[102, "v1", "art-joint-anim"],
|
||||
[157, "v1", "art-joint-anim"],
|
||||
[220, "v1", "art-joint-anim"],
|
||||
[275, "v1", "art-joint-anim"],
|
||||
[329, "v1", "art-joint-anim"],
|
||||
[389, "v1", "art-joint-anim"],
|
||||
[447, "v1", "art-joint-anim"],
|
||||
[517, "v1", "art-joint-anim"],
|
||||
[572, "v1", "art-joint-anim"],
|
||||
[626, "v1", "art-joint-anim"],
|
||||
[686, "v1", "art-joint-anim"],
|
||||
[744, "v1", "art-joint-anim"]
|
||||
[96, "v1", "art-joint-anim"],
|
||||
[151, "v1", "art-joint-anim"],
|
||||
[214, "v1", "art-joint-anim"],
|
||||
[269, "v1", "art-joint-anim"],
|
||||
[323, "v1", "art-joint-anim"],
|
||||
[383, "v1", "art-joint-anim"],
|
||||
[441, "v1", "art-joint-anim"],
|
||||
[511, "v1", "art-joint-anim"],
|
||||
[566, "v1", "art-joint-anim"],
|
||||
[620, "v1", "art-joint-anim"],
|
||||
[680, "v1", "art-joint-anim"],
|
||||
[738, "v1", "art-joint-anim"]
|
||||
],
|
||||
"(code target-pilot-daxter-perch)": [
|
||||
[16, "v1", "art-joint-anim"],
|
||||
@@ -6734,8 +6737,8 @@
|
||||
[26, "s2", "process-focusable"],
|
||||
[33, "s2", "process-focusable"],
|
||||
[39, "s2", "process-focusable"],
|
||||
[78, "s2", "process-focusable"],
|
||||
[108, "s2", "process-focusable"],
|
||||
[71, "s2", "process-focusable"],
|
||||
[101, "s2", "process-focusable"],
|
||||
[111, "s2", "process-focusable"]
|
||||
],
|
||||
"(code on-vehicle egg-spider)": [
|
||||
@@ -6780,9 +6783,9 @@
|
||||
[172, "gp", "wvehicle"]
|
||||
],
|
||||
"(trans idle spider-manager)": [
|
||||
[252, "gp", "process-focusable"],
|
||||
[255, "gp", "process-focusable"],
|
||||
[265, "gp", "process-focusable"]
|
||||
[245, "gp", "process-focusable"],
|
||||
[248, "gp", "process-focusable"],
|
||||
[258, "gp", "process-focusable"]
|
||||
],
|
||||
"(method 23 spider-manager)": [
|
||||
[18, "v1", "egg-spider"],
|
||||
@@ -7846,7 +7849,7 @@
|
||||
"(trans hostile mantis)": [
|
||||
[27, "gp", "process-focusable"],
|
||||
[41, "gp", "process-focusable"],
|
||||
[100, "gp", "process-focusable"]
|
||||
[93, "gp", "process-focusable"]
|
||||
],
|
||||
"(code ambush-crawling mantis)": [[23, "v1", "art-joint-anim"]],
|
||||
"(code active mantis)": [
|
||||
@@ -7858,7 +7861,7 @@
|
||||
"(code hop-away mantis)": [
|
||||
[24, "gp", "process-focusable"],
|
||||
[59, "gp", "process-focusable"],
|
||||
[133, "v1", "art-joint-anim"]
|
||||
[126, "v1", "art-joint-anim"]
|
||||
],
|
||||
"(method 75 mantis)": [
|
||||
[20, "a0", "process-focusable"],
|
||||
@@ -8031,7 +8034,7 @@
|
||||
[21, "v1", "art-joint-anim"],
|
||||
[88, "v1", "art-joint-anim"]
|
||||
],
|
||||
"(code ambush marauder)": [[101, "v1", "art-joint-anim"]],
|
||||
"(code ambush marauder)": [[87, "v1", "art-joint-anim"]],
|
||||
"(code victory marauder)": [
|
||||
[26, "v1", "art-joint-anim"],
|
||||
[81, "v1", "art-joint-anim"]
|
||||
@@ -8288,10 +8291,10 @@
|
||||
[257, "s2", "process-drawable"],
|
||||
[273, "s2", "process-drawable"],
|
||||
[274, "v1", "collide-shape"],
|
||||
[357, "a0", "collide-shape-prim-group"],
|
||||
[385, "a0", "collide-shape-prim-group"],
|
||||
[403, "a1", "collide-shape-prim-group"],
|
||||
[429, "a0", "collide-shape-prim-group"],
|
||||
[350, "a0", "collide-shape-prim-group"],
|
||||
[378, "a0", "collide-shape-prim-group"],
|
||||
[396, "a1", "collide-shape-prim-group"],
|
||||
[422, "a0", "collide-shape-prim-group"],
|
||||
[10, "v0", "(array collide-shape)"],
|
||||
[309, "a1", "skeet"]
|
||||
],
|
||||
@@ -8316,17 +8319,17 @@
|
||||
],
|
||||
"(method 33 hvehicle)": [[39, "s5", "rigid-body-vehicle-constants"]],
|
||||
"(method 94 hvehicle)": [[42, "f0", "float"]],
|
||||
"(method 18 vehicle-controller)": [[[231, 316], "v1", "hvehicle"]],
|
||||
"(method 18 vehicle-controller)": [[[224, 304], "v1", "hvehicle"]],
|
||||
"(method 31 hvehicle)": [
|
||||
[69, "v1", "float"],
|
||||
[164, "v1", "float"],
|
||||
[67, "a0", "int"],
|
||||
[162, "a0", "int"]
|
||||
],
|
||||
"(method 97 hvehicle)": [[159, "a0", "vector"]],
|
||||
"(method 97 hvehicle)": [[152, "a0", "vector"]],
|
||||
"(post idle glider-ring)": [
|
||||
[203, "v1", "art-joint-anim"],
|
||||
[[413, 424], "v1", "glider-prim"]
|
||||
[189, "v1", "art-joint-anim"],
|
||||
[[402, 410], "v1", "glider-prim"]
|
||||
],
|
||||
"(method 25 glider-ring)": [[15, "v1", "glider-prim"]],
|
||||
"glider-ring-standard-event-handler": [
|
||||
@@ -8340,7 +8343,7 @@
|
||||
[21, "a1", "vector"],
|
||||
[25, "a1", "vector"]
|
||||
],
|
||||
"(method 97 h-glider)": [[159, "a0", "vector"]],
|
||||
"(method 97 h-glider)": [[152, "a0", "vector"]],
|
||||
"glider-thermal-updraft-velocity": [
|
||||
[20, "v1", "task-manager-desert-glide"],
|
||||
[23, "v1", "task-manager-desert-glide"]
|
||||
@@ -8468,9 +8471,9 @@
|
||||
],
|
||||
"(event idle terraformer-leg)": [
|
||||
[57, "s5", "process-drawable"],
|
||||
[99, "gp", "vehicle"],
|
||||
[202, "a0", "nav-mesh"],
|
||||
[205, "a0", "nav-mesh"]
|
||||
[93, "gp", "vehicle"],
|
||||
[196, "a0", "nav-mesh"],
|
||||
[199, "a0", "nav-mesh"]
|
||||
],
|
||||
"(post attack terraformer-drone)": [
|
||||
[14, "a0", "process-focusable"],
|
||||
@@ -8813,8 +8816,8 @@
|
||||
"(trans die mh-centipede)": [[16, "v0", "vehicle"]],
|
||||
"mh-centipede-active-handler": [
|
||||
[[5, 119], "s4", "touching-shapes-entry"],
|
||||
[91, "gp", "vehicle"],
|
||||
[[208, 227], "v1", "attack-info"]
|
||||
[85, "gp", "vehicle"],
|
||||
[[203, 221], "v1", "attack-info"]
|
||||
],
|
||||
"(enter impact mh-centipede-shot)": [[71, "a0", "process"]],
|
||||
"(event hidden rod-spawner)": [
|
||||
@@ -9174,14 +9177,14 @@
|
||||
[148, "v1", "process-drawable"],
|
||||
[155, "v1", "process-drawable"],
|
||||
[158, "a0", "process-drawable"],
|
||||
[165, "v1", "process-drawable"],
|
||||
[172, "v1", "process-drawable"],
|
||||
[179, "v1", "process-drawable"],
|
||||
[182, "a0", "process-drawable"],
|
||||
[195, "v1", "process-drawable"],
|
||||
[198, "a0", "process-drawable"],
|
||||
[267, "v1", "process-drawable"],
|
||||
[275, "gp", "collide-shape"],
|
||||
[284, "gp", "collide-shape"],
|
||||
[175, "a0", "process-drawable"],
|
||||
[181, "v1", "process-drawable"],
|
||||
[184, "a0", "process-drawable"],
|
||||
[246, "v1", "process-drawable"],
|
||||
[254, "gp", "collide-shape"],
|
||||
[263, "gp", "collide-shape"],
|
||||
[[203, 207], "a2", "float"]
|
||||
],
|
||||
"(method 62 h-sled)": [[[4, 41], "s5", "collide-shape-prim-group"]],
|
||||
@@ -9213,7 +9216,7 @@
|
||||
[354, "v0", "vehicle"]
|
||||
],
|
||||
"(method 54 h-warf)": [[[15, 21], "a0", "process-focusable"]],
|
||||
"(method 97 h-warf)": [[159, "a0", "vector"]],
|
||||
"(method 97 h-warf)": [[152, "a0", "vector"]],
|
||||
"(method 156 fac-gunturret)": [[[11, 19], "a0", "process-focusable"]],
|
||||
"(method 155 fac-gunturret)": [[[15, 23], "a0", "process-focusable"]],
|
||||
"(code fire fac-robotank-turret)": [
|
||||
@@ -9248,7 +9251,9 @@
|
||||
"(event idle fac-gun-tower-base)": [[[18, 86], "s4", "projectile"]],
|
||||
"(code idle fac-gun-tower-base)": [[10, "v1", "art-joint-anim"]],
|
||||
"(method 36 fac-gun-tower)": [[46, "s2", "process-focusable"]],
|
||||
"(method 35 fac-gun-tower)": [[79, "v0", "vehicle"]],
|
||||
"(method 35 fac-gun-tower)": [
|
||||
[[72,76], "a0", "vehicle"]
|
||||
],
|
||||
"fac-robotank-init-by-other": [
|
||||
[182, "gp", "factory-manager"],
|
||||
[208, "gp", "factory-manager"],
|
||||
@@ -9271,7 +9276,7 @@
|
||||
"fac-target-standard-event-handler": [[[48, 54], "v1", "attack-info"]],
|
||||
"(enter idle fac-target)": [[63, "v1", "art-joint-anim"]],
|
||||
"(enter retracted fac-target)": [[33, "v1", "art-joint-anim"]],
|
||||
"(method 60 factory-fighter)": [[52, "v0", "vehicle"]],
|
||||
"(method 60 factory-fighter)": [[38, "v0", "vehicle"]],
|
||||
"(code die factory-fighter)": [[11, "v1", "art-joint-anim"]],
|
||||
"(method 32 task-manager-factory-sky-battle)": [["_stack_", 16, "res-tag"]],
|
||||
"update-railx-lights": [[[33, 88], "s3", "railx-states"]],
|
||||
@@ -9841,7 +9846,7 @@
|
||||
],
|
||||
"(code knocked-recover crimson-guard)": [[23, "a1", "art-joint-anim"]],
|
||||
"(method 289 crimson-guard)": [[21, "v1", "float"]],
|
||||
"(method 258 crimson-guard)": [[152, "v1", "collide-shape-prim"]],
|
||||
"(method 258 crimson-guard)": [[138, "v1", "collide-shape-prim"]],
|
||||
"(method 212 crimson-guard)": [[[246, 249], "v1", "vehicle"]],
|
||||
"(method 265 crimson-guard)": [
|
||||
[22, "s4", "process-focusable"],
|
||||
@@ -10171,13 +10176,13 @@
|
||||
[149, "v1", "process-drawable"],
|
||||
[156, "v1", "process-drawable"],
|
||||
[159, "a0", "process-drawable"],
|
||||
[166, "v1", "process-drawable"],
|
||||
[173, "v1", "process-drawable"],
|
||||
[180, "v1", "process-drawable"],
|
||||
[183, "a0", "process-drawable"],
|
||||
[196, "v1", "process-drawable"],
|
||||
[199, "a0", "process-drawable"],
|
||||
[281, "v1", "process-drawable"],
|
||||
[291, "a0", "collide-shape"],
|
||||
[176, "a0", "process-drawable"],
|
||||
[182, "v1", "process-drawable"],
|
||||
[185, "a0", "process-drawable"],
|
||||
[260, "v1", "process-drawable"],
|
||||
[270, "a0", "collide-shape"],
|
||||
[[204, 208], "a2", "float"]
|
||||
],
|
||||
"(method 33 task-manager-bbush-board)": [[55, "v1", "hud"]],
|
||||
@@ -10333,7 +10338,7 @@
|
||||
"(enter explode bombbot-bomb)": [[59, "a0", "process"]],
|
||||
"(method 26 task-manager-port-fight)": [[[315, 343], "s2", "bombbot"]],
|
||||
"(code hostile bombbot-player)": [[38, "v1", "art-joint-anim"]],
|
||||
"(method 196 bombbot-player)": [[[214, 218], "a0", "process-focusable"]],
|
||||
"(method 196 bombbot-player)": [[[207, 211], "a0", "process-focusable"]],
|
||||
"(trans hostile bomb-bot)": [[[34, 61], "gp", "process-focusable"]],
|
||||
"(method 196 bomb-bot)": [
|
||||
[[1, 119], "gp", "process-focusable"],
|
||||
@@ -10349,7 +10354,7 @@
|
||||
"(code blow-wall bombbot)": [[10, "v1", "art-joint-anim"]],
|
||||
"(code drop-bombs bombbot)": [[10, "v1", "art-joint-anim"]],
|
||||
"(code hostile bombbot)": [[10, "v1", "art-joint-anim"]],
|
||||
"(trans hostile bombbot)": [[[45, 94], "v1", "process-focusable"]],
|
||||
"(trans hostile bombbot)": [[[45, 87], "v1", "process-focusable"]],
|
||||
"(enter hostile bombbot)": [[15, "v1", "collide-shape-prim-group"]],
|
||||
"(method 200 bombbot)": [[4, "v1", "collide-shape-prim-group"]],
|
||||
"(method 194 bombbot)": [
|
||||
@@ -10505,7 +10510,7 @@
|
||||
"(trans move-to-vehicle jinx)": [[[11, 46], "s0", "vehicle"]],
|
||||
"(method 26 task-manager-city-destroy-grid)": [
|
||||
[[17, 666], "s5", "jinx"],
|
||||
[[193, 210], "v1", "vehicle"],
|
||||
[[189, 203], "v1", "vehicle"],
|
||||
[[253, 287], "a2", "vehicle"],
|
||||
[[494, 664], "s4", "vehicle"]
|
||||
],
|
||||
@@ -10948,7 +10953,7 @@
|
||||
"(enter fail task-manager-protect-hq)": [
|
||||
[26, "v0", "(state resetter-params task-manager-protect-hq)"]
|
||||
],
|
||||
"(trans hostile assault-bombbot)": [[[76, 125], "v1", "process-focusable"]],
|
||||
"(trans hostile assault-bombbot)": [[[76, 119], "v1", "process-focusable"]],
|
||||
"(method 209 assault-bombbot)": [[48, "v1", "process-focusable"]],
|
||||
"(code wait-for-enemies assault-crimson-guard)": [
|
||||
[22, "v1", "art-joint-anim"]
|
||||
|
||||
@@ -1611,6 +1611,7 @@ void types2_for_expr(types2::Type& type_out,
|
||||
case SimpleExpression::Kind::VECTOR_3_DOT:
|
||||
case SimpleExpression::Kind::VECTOR_4_DOT:
|
||||
case SimpleExpression::Kind::VECTOR_LENGTH:
|
||||
case SimpleExpression::Kind::VECTOR_LENGTH_SQUARED:
|
||||
types2_for_vectors_in_float_out(type_out, expr, input_types, dts, extras);
|
||||
break;
|
||||
case SimpleExpression::Kind::VECTOR_CROSS:
|
||||
@@ -1623,6 +1624,7 @@ void types2_for_expr(types2::Type& type_out,
|
||||
types2_for_vector_float_product(type_out, expr, input_types, dts, extras);
|
||||
break;
|
||||
case SimpleExpression::Kind::VECTOR_PLUS_FLOAT_TIMES:
|
||||
case SimpleExpression::Kind::VECTOR_PLUS_TIMES:
|
||||
types2_for_vector_plus_float_times(type_out, expr, input_types, dts, extras);
|
||||
break;
|
||||
case SimpleExpression::Kind::PCPYLD:
|
||||
|
||||
@@ -83,7 +83,7 @@ and neg-state is greater than or equal to neg.
|
||||
exit
|
||||
)
|
||||
(:methods
|
||||
(talker-method-17 (_type_) none)
|
||||
(draw-text (_type_) none)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod talker-method-17 ((this talker))
|
||||
(defmethod draw-text ((this talker))
|
||||
(let ((gp-0
|
||||
(new 'stack 'font-context *font-default-matrix* 36 310 0.0 (font-color default) (font-flags shadow kerning))
|
||||
)
|
||||
@@ -516,7 +516,7 @@
|
||||
(seek! (-> self interp) 1.0 (* 0.5 (seconds-per-frame)))
|
||||
(seek! (-> self interp) 1.0 (* 4.0 (seconds-per-frame)))
|
||||
)
|
||||
(talker-method-17 self)
|
||||
(draw-text self)
|
||||
)
|
||||
(suspend)
|
||||
)
|
||||
@@ -528,7 +528,7 @@
|
||||
(seek! (-> self interp) 0.0 (* 4.0 (seconds-per-frame)))
|
||||
)
|
||||
(if (and (= (get-status *gui-control* (-> self message-id)) (gui-status active)) (not (paused?)))
|
||||
(talker-method-17 self)
|
||||
(draw-text self)
|
||||
)
|
||||
(suspend)
|
||||
)
|
||||
|
||||
@@ -38,6 +38,21 @@
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype align-control (basic)
|
||||
"Align-control is a utility for moving a process-drawable based on its animation.
|
||||
The animation format has two special parent-like joints: prejoint and align.
|
||||
The prejoint is the parent for all joints, so it causes all bones to move.
|
||||
The align joint has no children, but the convention is that moving align will
|
||||
cause the entire process-drawable's root to move, effectively moving the entire character.
|
||||
Most of the time, this is the preferable way to move a character as part of an animation -
|
||||
it will update their velocity and when the animation ends or is canceled,
|
||||
the offset in position from playing the animation will stay. For example, if Jak punches,
|
||||
his velocity will increase due to the animated align in the punch animation.
|
||||
To implement this, the align-control computes the relative transform between align frames.
|
||||
To apply the position offset, typically the velocity is updated, then the normal per-frame
|
||||
physics update will end up moving the position. For orientation, there is no concept of
|
||||
angular velocity, so instead align-control directly modifies the quaternion.
|
||||
Unlike normal animation evaluation, the alignment's blend is computed in a different way
|
||||
that doesn't blend and instead just picks the most recently pushed animation."
|
||||
((flags align-flags)
|
||||
(process process-drawable)
|
||||
(frame-group art-joint-anim)
|
||||
@@ -50,9 +65,9 @@
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type process) _type_)
|
||||
(compute-alignment! (_type_) transformq)
|
||||
(compute-delta-align! (_type_) transformq)
|
||||
(align! (_type_ align-opts float float float) trsqv)
|
||||
(align-vel-and-quat-only! (_type_ align-opts vector int float float) trsqv)
|
||||
(adjust-root-no-gravity! (_type_ align-opts vector int float float) trsqv)
|
||||
(first-transform (_type_) transform)
|
||||
(second-transform (_type_) transform)
|
||||
)
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)]
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [jr ra]
|
||||
(defmethod compute-alignment! ((this align-control))
|
||||
(defmethod compute-delta-align! ((this align-control))
|
||||
"Compute the change in align since the last time this was called."
|
||||
(local-vars (disable? symbol) (s7-0 none) (ra-0 int))
|
||||
(update-anim-data (-> this process skel))
|
||||
(let ((num-chans (-> this process skel active-channels)))
|
||||
@@ -110,14 +111,17 @@
|
||||
|
||||
;; WARN: Return type mismatch (inline-array transform) vs transform.
|
||||
(defmethod first-transform ((this align-control))
|
||||
"Get the more recent align transform"
|
||||
(the-as transform (-> this transform))
|
||||
)
|
||||
|
||||
(defmethod second-transform ((this align-control))
|
||||
"Get the second most recent align trasnform"
|
||||
(-> this transform 1)
|
||||
)
|
||||
|
||||
(defmethod align! ((this align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float))
|
||||
"Apply the alignment to the process-drawable."
|
||||
(when (not (logtest? (-> this flags) (align-flags disabled)))
|
||||
(let* ((a0-1 (-> this process))
|
||||
(t9-0 (method-of-object a0-1 apply-alignment))
|
||||
@@ -156,7 +160,9 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod align-vel-and-quat-only! ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float))
|
||||
(defmethod adjust-root-no-gravity! ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float))
|
||||
"Adjust the quat and transv of the process drawable to take into account the
|
||||
most recent change in align."
|
||||
(with-pp
|
||||
(when (not (logtest? (-> this flags) (align-flags disabled)))
|
||||
(let ((s5-0 (-> this delta)))
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
|
||||
|
||||
(deftype joint-exploder-list (structure)
|
||||
"Linked list of joint-exploder-joint."
|
||||
((head int32)
|
||||
(pre-moved? symbol)
|
||||
(bbox-valid? symbol)
|
||||
@@ -93,6 +94,8 @@
|
||||
(set! (-> joint-exploder-list-array heap-base) (the-as uint 48))
|
||||
|
||||
(deftype joint-exploder (process-drawable)
|
||||
"The joint-exploder animates an object exploding into pieces.
|
||||
For example, geyser rock dummies, or the jak 1 zoomer."
|
||||
((parent (pointer process-drawable) :override)
|
||||
(die-if-below-y float)
|
||||
(die-if-beyond-xz-dist-sqrd float)
|
||||
@@ -137,6 +140,7 @@
|
||||
)
|
||||
|
||||
(defun joint-exploder-joint-callback ((arg0 draw-control) (arg1 cspace-array) (arg2 joint-control))
|
||||
"Postbind callback to set bones to the result of the joint-exploder."
|
||||
(let ((s4-0 (the-as joint-exploder (-> arg0 process))))
|
||||
(let ((s3-0 (-> s4-0 joints)))
|
||||
(countdown (s2-0 (-> s3-0 num-joints))
|
||||
@@ -168,6 +172,7 @@
|
||||
)
|
||||
|
||||
(defmethod remove-from-list-and-reset ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int))
|
||||
"Remove a joint from the list and clear its transform"
|
||||
(let ((v0-0 (remove-joint-from-list this arg0 arg1)))
|
||||
(let* ((v1-1 (-> this joints))
|
||||
(v1-2 (-> v1-1 joint arg1))
|
||||
@@ -182,6 +187,7 @@
|
||||
)
|
||||
|
||||
(defmethod remove-joint-from-list ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int))
|
||||
"Remove a joint from the linked list and invalidate the bbox."
|
||||
(let* ((v1-0 (-> this joints))
|
||||
(a2-1 (-> v1-0 joint arg1))
|
||||
(a0-4 (-> a2-1 prev))
|
||||
@@ -213,6 +219,7 @@
|
||||
)
|
||||
|
||||
(defmethod add-joint-to-list ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int))
|
||||
"Add a joint to the given linked list of joints."
|
||||
(let* ((v1-0 (-> this joints))
|
||||
(a3-0 (-> v1-0 joint arg1))
|
||||
(a0-4 (-> arg0 head))
|
||||
@@ -228,6 +235,7 @@
|
||||
)
|
||||
|
||||
(defmethod update-bbox-for-joint ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint))
|
||||
"Update the bounding box to include the joint"
|
||||
(let ((a1-1 (-> arg1 mat trans)))
|
||||
(cond
|
||||
((-> arg0 bbox-valid?)
|
||||
@@ -448,62 +456,47 @@
|
||||
)
|
||||
|
||||
(defmethod integrate-and-kill ((this joint-exploder) (arg0 joint-exploder-list))
|
||||
(local-vars (v1-8 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(set! (-> arg0 bbox-valid?) #f)
|
||||
(set! (-> arg0 pre-moved?) #t)
|
||||
(let ((s4-0 (-> this joints))
|
||||
(f30-0 (* (-> this tuning gravity) (seconds-per-frame)))
|
||||
(s3-0 (-> arg0 head))
|
||||
)
|
||||
(while (>= s3-0 0)
|
||||
(let* ((s2-0 (-> s4-0 joint s3-0))
|
||||
(s1-0 (-> s2-0 mat trans))
|
||||
)
|
||||
(vector-copy! (-> s2-0 prev-pos) s1-0)
|
||||
(+! (-> s2-0 transv y) f30-0)
|
||||
(when (< 0.0 (-> this tuning friction))
|
||||
(.lvf vf1 (&-> (-> s2-0 transv) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-8 vf1)
|
||||
(let* ((f0-4 v1-8)
|
||||
(f1-5 (* 0.00001 (seconds-per-frame) (-> this tuning friction) f0-4))
|
||||
(f0-6 (- (sqrtf f0-4) f1-5))
|
||||
)
|
||||
(if (< f0-6 0.0)
|
||||
(set! f0-6 0.0)
|
||||
)
|
||||
(vector-normalize! (-> s2-0 transv) f0-6)
|
||||
)
|
||||
)
|
||||
(vector-v+! s1-0 s1-0 (-> s2-0 transv))
|
||||
(matrix*! (-> s2-0 rmat) (-> s2-0 rmat) (-> s2-0 update-rmat))
|
||||
(cond
|
||||
((or (< (-> s1-0 y) (-> this die-if-below-y))
|
||||
(< (-> this die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> this root trans)))
|
||||
)
|
||||
(set! s3-0 (remove-from-list-and-reset this arg0 s3-0))
|
||||
(set! (-> arg0 bbox-valid?) #f)
|
||||
(set! (-> arg0 pre-moved?) #t)
|
||||
(let ((s4-0 (-> this joints))
|
||||
(f30-0 (* (-> this tuning gravity) (seconds-per-frame)))
|
||||
(s3-0 (-> arg0 head))
|
||||
)
|
||||
(while (>= s3-0 0)
|
||||
(let* ((s2-0 (-> s4-0 joint s3-0))
|
||||
(s1-0 (-> s2-0 mat trans))
|
||||
)
|
||||
(else
|
||||
(update-bbox-for-joint this arg0 s2-0)
|
||||
(set! s3-0 (-> s2-0 next))
|
||||
)
|
||||
(vector-copy! (-> s2-0 prev-pos) s1-0)
|
||||
(+! (-> s2-0 transv y) f30-0)
|
||||
(when (< 0.0 (-> this tuning friction))
|
||||
(let* ((f0-4 (vector-length-squared (-> s2-0 transv)))
|
||||
(f1-5 (* 0.00001 (seconds-per-frame) (-> this tuning friction) f0-4))
|
||||
(f0-6 (- (sqrtf f0-4) f1-5))
|
||||
)
|
||||
(if (< f0-6 0.0)
|
||||
(set! f0-6 0.0)
|
||||
)
|
||||
(vector-normalize! (-> s2-0 transv) f0-6)
|
||||
)
|
||||
)
|
||||
(vector-v+! s1-0 s1-0 (-> s2-0 transv))
|
||||
(matrix*! (-> s2-0 rmat) (-> s2-0 rmat) (-> s2-0 update-rmat))
|
||||
(cond
|
||||
((or (< (-> s1-0 y) (-> this die-if-below-y))
|
||||
(< (-> this die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> this root trans)))
|
||||
)
|
||||
(set! s3-0 (remove-from-list-and-reset this arg0 s3-0))
|
||||
)
|
||||
(else
|
||||
(update-bbox-for-joint this arg0 s2-0)
|
||||
(set! s3-0 (-> s2-0 next))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod do-collision-response ((this joint-exploder) (arg0 joint-exploder-list))
|
||||
|
||||
@@ -31,12 +31,10 @@
|
||||
(sv-768 matrix)
|
||||
(sv-784 vector)
|
||||
)
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((gp-0 (the-as joint-mod-ik (-> arg0 param1))))
|
||||
@@ -82,21 +80,7 @@
|
||||
0.0
|
||||
(vector-copy! s2-0 (-> s5-0 trans))
|
||||
(vector-copy! sv-784 (-> s4-1 trans))
|
||||
(let ((a1-5 s0-0))
|
||||
(let ((v1-27 sv-784))
|
||||
(let ((a0-13 (-> s4-1 uvec)))
|
||||
(let ((a2-2 (-> gp-0 hand-dist)))
|
||||
(.mov vf7 a2-2)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-13 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-27 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-5 quad) vf6)
|
||||
)
|
||||
(vector+*! s0-0 sv-784 (-> s4-1 uvec) (-> gp-0 hand-dist))
|
||||
(if (-> gp-0 callback)
|
||||
((-> gp-0 callback) gp-0 s5-0 s4-1 s0-0)
|
||||
)
|
||||
@@ -226,19 +210,19 @@
|
||||
)
|
||||
(quaternion-pseudo-slerp! sv-368 *unity-quaternion* sv-368 (-> gp-0 blend))
|
||||
(quaternion-pseudo-slerp! sv-372 *unity-quaternion* sv-372 (-> gp-0 blend))
|
||||
(let ((a2-20 (quaternion->matrix (new 'stack-no-clear 'matrix) sv-368))
|
||||
(let ((a2-19 (quaternion->matrix (new 'stack-no-clear 'matrix) sv-368))
|
||||
(gp-1 (new 'stack-no-clear 'matrix))
|
||||
)
|
||||
(set! (-> gp-1 rvec quad) (-> s4-1 trans quad))
|
||||
(matrix*! s4-1 s4-1 a2-20)
|
||||
(matrix*! s4-1 s4-1 a2-19)
|
||||
(vector-copy! (-> s4-1 trans) (-> gp-1 rvec))
|
||||
)
|
||||
(let ((s3-2 (quaternion->matrix (new 'stack-no-clear 'matrix) sv-372))
|
||||
(a2-21 (matrix-4x4-inverse! (new 'stack-no-clear 'matrix) s5-0))
|
||||
(a2-20 (matrix-4x4-inverse! (new 'stack-no-clear 'matrix) s5-0))
|
||||
(gp-2 (new 'stack-no-clear 'matrix))
|
||||
)
|
||||
(set! (-> gp-2 rvec quad) (-> s5-0 trans quad))
|
||||
(matrix*! s4-1 s4-1 a2-21)
|
||||
(matrix*! s4-1 s4-1 a2-20)
|
||||
(matrix*! s5-0 s5-0 s3-2)
|
||||
(vector-copy! (-> s5-0 trans) (-> gp-2 rvec))
|
||||
)
|
||||
|
||||
@@ -582,13 +582,7 @@
|
||||
(defstate cam-master-active (camera-master)
|
||||
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
||||
(local-vars (v0-0 object) (v1-125 uint))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(rlet ((vf0 :class vf))
|
||||
(init-vf0-vector)
|
||||
(case message
|
||||
(('dist-from-interp-src)
|
||||
@@ -905,23 +899,16 @@
|
||||
)
|
||||
)
|
||||
(('point-of-interest)
|
||||
(let ((v1-232 (the-as object (-> block param 0))))
|
||||
(let ((a0-103 *math-camera*))
|
||||
(set! v0-0 (-> a0-103 trans))
|
||||
(let ((a0-104 (-> a0-103 inv-camera-rot fvec)))
|
||||
(let ((a1-36 (- (-> self interest-dist))))
|
||||
(.mov vf7 a1-36)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-104 quad))
|
||||
(let ((v1-232 (-> block param 0))
|
||||
(a0-103 *math-camera*)
|
||||
)
|
||||
(vector+*!
|
||||
(-> a0-103 trans)
|
||||
(the-as vector v1-232)
|
||||
(-> a0-103 inv-camera-rot fvec)
|
||||
(- (-> self interest-dist))
|
||||
)
|
||||
(.lvf vf4 (&-> (the-as vector v1-232) quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> (the-as vector v0-0) quad) vf6)
|
||||
v0-0
|
||||
)
|
||||
(('part-water-drip)
|
||||
(set-time! (-> self water-drip-time))
|
||||
|
||||
@@ -94,96 +94,59 @@
|
||||
(define *CAM_FREE-bank* (new 'static 'cam-free-bank :speed 1600.0 :rot-speed (degrees 0.6)))
|
||||
|
||||
(defun cam-mouse-input ((arg0 matrix) (arg1 vector) (arg2 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let ((v1-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-! v1-0 (-> *mouse* pos 0) (-> *mouse* pos 1))
|
||||
(if (< (-> *camera* interest-dist) 409.6)
|
||||
(set! (-> *camera* interest-dist) 409.6)
|
||||
)
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector))
|
||||
(s2-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((a0-9 (new 'stack-no-clear 'vector)))
|
||||
0.0
|
||||
(vector+*! a0-9 (-> *math-camera* trans) (-> arg0 fvec) (-> *camera* interest-dist))
|
||||
(vector-! s3-0 (-> *math-camera* trans) a0-9)
|
||||
)
|
||||
(vector-length s3-0)
|
||||
(cond
|
||||
((mouse-hold? left)
|
||||
(let ((f30-0 (* 72.81778 (-> *mouse* speedy)))
|
||||
(f28-0 (* -72.81778 (-> *mouse* speedx)))
|
||||
)
|
||||
(let ((a2-8 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (-> arg0 rvec) f30-0)))
|
||||
(vector-orient-by-quat! s2-0 s3-0 a2-8)
|
||||
)
|
||||
(let ((a2-10 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *y-vector* f28-0)))
|
||||
(vector-orient-by-quat! s2-0 s2-0 a2-10)
|
||||
)
|
||||
(vector-! s2-0 s2-0 s3-0)
|
||||
(vector-matrix*! s2-0 s2-0 (matrix-4x4-inverse! (new 'stack-no-clear 'matrix) arg0))
|
||||
(+! (-> arg2 x) (-> s2-0 x))
|
||||
(+! (-> arg2 y) (-> s2-0 y))
|
||||
(+! (-> arg2 z) (-> s2-0 z))
|
||||
(+! (-> arg1 x) f30-0)
|
||||
(set! (-> arg1 y) (+ (-> arg1 y) f28-0))
|
||||
)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((v1-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-! v1-0 (-> *mouse* pos 0) (-> *mouse* pos 1))
|
||||
(if (< (-> *camera* interest-dist) 409.6)
|
||||
(set! (-> *camera* interest-dist) 409.6)
|
||||
)
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector))
|
||||
(s2-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((a0-9 (new 'stack-no-clear 'vector)))
|
||||
0.0
|
||||
(let ((a1-3 a0-9))
|
||||
(let ((a2-4 (-> *math-camera* trans)))
|
||||
(let ((a3-0 (-> arg0 fvec)))
|
||||
(let ((t0-1 (-> *camera* interest-dist)))
|
||||
(.mov vf7 t0-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a3-0 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a2-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-3 quad) vf6)
|
||||
)
|
||||
(vector-! s3-0 (-> *math-camera* trans) a0-9)
|
||||
)
|
||||
(vector-length s3-0)
|
||||
(cond
|
||||
((mouse-hold? left)
|
||||
(let ((f30-0 (* 72.81778 (-> *mouse* speedy)))
|
||||
(f28-0 (* -72.81778 (-> *mouse* speedx)))
|
||||
)
|
||||
(let ((a2-8 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (-> arg0 rvec) f30-0)))
|
||||
(vector-orient-by-quat! s2-0 s3-0 a2-8)
|
||||
)
|
||||
(let ((a2-10 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *y-vector* f28-0)))
|
||||
(vector-orient-by-quat! s2-0 s2-0 a2-10)
|
||||
)
|
||||
(vector-! s2-0 s2-0 s3-0)
|
||||
(vector-matrix*! s2-0 s2-0 (matrix-4x4-inverse! (new 'stack-no-clear 'matrix) arg0))
|
||||
(+! (-> arg2 x) (-> s2-0 x))
|
||||
(+! (-> arg2 y) (-> s2-0 y))
|
||||
(+! (-> arg2 z) (-> s2-0 z))
|
||||
(+! (-> arg1 x) f30-0)
|
||||
(set! (-> arg1 y) (+ (-> arg1 y) f28-0))
|
||||
((mouse-hold? right)
|
||||
(+! (-> arg2 z) (* (-> v1-0 x) (-> *CAM_FREE-bank* speed)))
|
||||
(set! (-> *camera* interest-dist) (- (-> *camera* interest-dist) (* (-> *CAM_FREE-bank* speed) (-> v1-0 x))))
|
||||
(if (< (-> *camera* interest-dist) 409.6)
|
||||
(set! (-> *camera* interest-dist) 409.6)
|
||||
)
|
||||
(when (< -8192.0 (vector-dot (-> arg0 fvec) s3-0))
|
||||
(let ((t0-1 (new 'static 'vector :w 1.0)))
|
||||
(vector+*! t0-1 (-> *setting-control* cam-current mouse-tumble-point) (-> arg0 fvec) 8192.0)
|
||||
(set-setting! 'mouse-tumble-point 'abs t0-1 0)
|
||||
)
|
||||
)
|
||||
((mouse-hold? right)
|
||||
(+! (-> arg2 z) (* (-> v1-0 x) (-> *CAM_FREE-bank* speed)))
|
||||
(set! (-> *camera* interest-dist) (- (-> *camera* interest-dist) (* (-> *CAM_FREE-bank* speed) (-> v1-0 x))))
|
||||
(if (< (-> *camera* interest-dist) 409.6)
|
||||
(set! (-> *camera* interest-dist) 409.6)
|
||||
)
|
||||
(when (< -8192.0 (vector-dot (-> arg0 fvec) s3-0))
|
||||
(let ((t0-2 (new 'static 'vector :w 1.0)))
|
||||
(let ((v1-18 t0-2))
|
||||
(let ((a0-33 (-> *setting-control* cam-current mouse-tumble-point)))
|
||||
(let ((a1-12 (-> arg0 fvec)))
|
||||
(let ((a2-13 8192.0))
|
||||
(.mov vf7 a2-13)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-12 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-33 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-18 quad) vf6)
|
||||
)
|
||||
(set-setting! 'mouse-tumble-point 'abs t0-2 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
((mouse-hold? middle)
|
||||
(+! (-> arg2 x) (* (-> v1-0 x) (-> *CAM_FREE-bank* speed)))
|
||||
(+! (-> arg2 y) (* (-> v1-0 y) (-> *CAM_FREE-bank* speed)))
|
||||
(new 'static 'vector :w 1.0)
|
||||
#f
|
||||
)
|
||||
)
|
||||
)
|
||||
((mouse-hold? middle)
|
||||
(+! (-> arg2 x) (* (-> v1-0 x) (-> *CAM_FREE-bank* speed)))
|
||||
(+! (-> arg2 y) (* (-> v1-0 y) (-> *CAM_FREE-bank* speed)))
|
||||
(new 'static 'vector :w 1.0)
|
||||
#f
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -629,130 +629,115 @@
|
||||
(defmethod-mips2c "(method 10 collide-shape-prim-group)" 10 collide-shape-prim-group)
|
||||
|
||||
(defmethod fill-from-fg-line-sphere ((this collide-cache) (arg0 collide-query))
|
||||
(local-vars (v1-9 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s4-0 (-> arg0 collide-with)))
|
||||
(set! *actor-list-length* 0)
|
||||
(if (logtest? s4-0 (collide-spec hit-by-others-list))
|
||||
(set! *actor-list-length* (fill-actor-list-for-sphere
|
||||
*actor-hash*
|
||||
(-> arg0 start-pos)
|
||||
(-> arg0 move-dist)
|
||||
(-> arg0 radius)
|
||||
*actor-list*
|
||||
256
|
||||
-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((f30-0 0.0)
|
||||
(s3-0 (new 'stack-no-clear 'matrix))
|
||||
)
|
||||
(.lvf vf1 (&-> (-> arg0 move-dist) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-9 vf1)
|
||||
(let ((f0-1 v1-9))
|
||||
(if (< 0.0 f0-1)
|
||||
(set! f30-0 (/ 1.0 f0-1))
|
||||
(let ((s4-0 (-> arg0 collide-with)))
|
||||
(set! *actor-list-length* 0)
|
||||
(if (logtest? s4-0 (collide-spec hit-by-others-list))
|
||||
(set! *actor-list-length* (fill-actor-list-for-sphere
|
||||
*actor-hash*
|
||||
(-> arg0 start-pos)
|
||||
(-> arg0 move-dist)
|
||||
(-> arg0 radius)
|
||||
*actor-list*
|
||||
256
|
||||
-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((f30-0 0.0)
|
||||
(s3-0 (new 'stack-no-clear 'matrix))
|
||||
)
|
||||
(when (logtest? s4-0 (collide-spec player-list))
|
||||
(let ((v1-17 (-> *collide-player-list* alive-list next0)))
|
||||
*collide-player-list*
|
||||
(let ((s2-0 (-> v1-17 next0)))
|
||||
(while (!= v1-17 (-> *collide-player-list* alive-list-end))
|
||||
(let* ((s1-0 (-> (the-as connection v1-17) param1))
|
||||
(v1-18 (-> (the-as collide-shape s1-0) root-prim))
|
||||
)
|
||||
(when (logtest? s4-0 (-> v1-18 prim-core collide-as))
|
||||
(let ((s0-0 (-> v1-18 prim-core)))
|
||||
(vector-! (-> s3-0 uvec) (-> s0-0 world-sphere) (-> arg0 start-pos))
|
||||
(let* ((f1-2 (* (vector-dot (-> arg0 move-dist) (-> s3-0 uvec)) f30-0))
|
||||
(f0-6 (fmax 0.0 (fmin 1.0 f1-2)))
|
||||
)
|
||||
(vector+float*! (-> s3-0 rvec) (-> arg0 start-pos) (-> arg0 move-dist) f0-6)
|
||||
)
|
||||
(let ((f0-7 (vector-vector-distance-squared (-> s3-0 rvec) (-> s0-0 world-sphere)))
|
||||
(f1-5 (+ (-> arg0 radius) (-> s0-0 world-sphere w)))
|
||||
)
|
||||
(when (< f0-7 (* f1-5 f1-5))
|
||||
(when (< *actor-list-length* 256)
|
||||
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape s1-0))
|
||||
(set! *actor-list-length* (+ *actor-list-length* 1))
|
||||
)
|
||||
(let ((f0-1 (vector-length-squared (-> arg0 move-dist))))
|
||||
(if (< 0.0 f0-1)
|
||||
(set! f30-0 (/ 1.0 f0-1))
|
||||
)
|
||||
)
|
||||
(when (logtest? s4-0 (collide-spec player-list))
|
||||
(let ((v1-17 (-> *collide-player-list* alive-list next0)))
|
||||
*collide-player-list*
|
||||
(let ((s2-0 (-> v1-17 next0)))
|
||||
(while (!= v1-17 (-> *collide-player-list* alive-list-end))
|
||||
(let* ((s1-0 (-> (the-as connection v1-17) param1))
|
||||
(v1-18 (-> (the-as collide-shape s1-0) root-prim))
|
||||
)
|
||||
(when (logtest? s4-0 (-> v1-18 prim-core collide-as))
|
||||
(let ((s0-0 (-> v1-18 prim-core)))
|
||||
(vector-! (-> s3-0 uvec) (-> s0-0 world-sphere) (-> arg0 start-pos))
|
||||
(let* ((f1-2 (* (vector-dot (-> arg0 move-dist) (-> s3-0 uvec)) f30-0))
|
||||
(f0-6 (fmax 0.0 (fmin 1.0 f1-2)))
|
||||
)
|
||||
(vector+float*! (-> s3-0 rvec) (-> arg0 start-pos) (-> arg0 move-dist) f0-6)
|
||||
)
|
||||
(let ((f0-7 (vector-vector-distance-squared (-> s3-0 rvec) (-> s0-0 world-sphere)))
|
||||
(f1-5 (+ (-> arg0 radius) (-> s0-0 world-sphere w)))
|
||||
)
|
||||
(when (< f0-7 (* f1-5 f1-5))
|
||||
(when (< *actor-list-length* 256)
|
||||
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape s1-0))
|
||||
(set! *actor-list-length* (+ *actor-list-length* 1))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! v1-17 s2-0)
|
||||
*collide-player-list*
|
||||
(set! s2-0 (-> s2-0 next0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (logtest? s4-0 (collide-spec hit-by-player-list))
|
||||
(let ((v1-38 (-> *collide-hit-by-player-list* alive-list next0)))
|
||||
*collide-hit-by-player-list*
|
||||
(let ((s2-1 (-> v1-38 next0)))
|
||||
(while (!= v1-38 (-> *collide-hit-by-player-list* alive-list-end))
|
||||
(let* ((s1-1 (-> (the-as connection v1-38) param1))
|
||||
(v1-39 (-> (the-as collide-shape s1-1) root-prim))
|
||||
)
|
||||
(when (logtest? s4-0 (-> v1-39 prim-core collide-as))
|
||||
(let ((s0-1 (-> v1-39 prim-core)))
|
||||
(vector-! (-> s3-0 uvec) (-> s0-1 world-sphere) (-> arg0 start-pos))
|
||||
(let* ((f1-8 (* (vector-dot (-> arg0 move-dist) (-> s3-0 uvec)) f30-0))
|
||||
(f0-11 (fmax 0.0 (fmin 1.0 f1-8)))
|
||||
)
|
||||
(vector+float*! (-> s3-0 rvec) (-> arg0 start-pos) (-> arg0 move-dist) f0-11)
|
||||
)
|
||||
(let ((f0-12 (vector-vector-distance-squared (-> s3-0 rvec) (-> s0-1 world-sphere)))
|
||||
(f1-11 (+ (-> arg0 radius) (-> s0-1 world-sphere w)))
|
||||
)
|
||||
(when (< f0-12 (* f1-11 f1-11))
|
||||
(when (< *actor-list-length* 256)
|
||||
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape s1-1))
|
||||
(set! *actor-list-length* (+ *actor-list-length* 1))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! v1-38 s2-1)
|
||||
*collide-hit-by-player-list*
|
||||
(set! s2-1 (-> s2-1 next0))
|
||||
)
|
||||
(set! v1-17 s2-0)
|
||||
*collide-player-list*
|
||||
(set! s2-0 (-> s2-0 next0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(dotimes (s3-1 *actor-list-length*)
|
||||
(let ((v1-58 (-> *actor-list* s3-1)))
|
||||
(when (logtest? s4-0 (-> v1-58 root-prim prim-core collide-as))
|
||||
(let ((a0-37 (-> v1-58 process)))
|
||||
(if (not (or (= a0-37 (-> this ignore-processes 0)) (= a0-37 (-> this ignore-processes 1))))
|
||||
(add-fg-prim-using-line-sphere (-> v1-58 root-prim) this arg0)
|
||||
(when (logtest? s4-0 (collide-spec hit-by-player-list))
|
||||
(let ((v1-38 (-> *collide-hit-by-player-list* alive-list next0)))
|
||||
*collide-hit-by-player-list*
|
||||
(let ((s2-1 (-> v1-38 next0)))
|
||||
(while (!= v1-38 (-> *collide-hit-by-player-list* alive-list-end))
|
||||
(let* ((s1-1 (-> (the-as connection v1-38) param1))
|
||||
(v1-39 (-> (the-as collide-shape s1-1) root-prim))
|
||||
)
|
||||
(when (logtest? s4-0 (-> v1-39 prim-core collide-as))
|
||||
(let ((s0-1 (-> v1-39 prim-core)))
|
||||
(vector-! (-> s3-0 uvec) (-> s0-1 world-sphere) (-> arg0 start-pos))
|
||||
(let* ((f1-8 (* (vector-dot (-> arg0 move-dist) (-> s3-0 uvec)) f30-0))
|
||||
(f0-11 (fmax 0.0 (fmin 1.0 f1-8)))
|
||||
)
|
||||
(vector+float*! (-> s3-0 rvec) (-> arg0 start-pos) (-> arg0 move-dist) f0-11)
|
||||
)
|
||||
(let ((f0-12 (vector-vector-distance-squared (-> s3-0 rvec) (-> s0-1 world-sphere)))
|
||||
(f1-11 (+ (-> arg0 radius) (-> s0-1 world-sphere w)))
|
||||
)
|
||||
(when (< f0-12 (* f1-11 f1-11))
|
||||
(when (< *actor-list-length* 256)
|
||||
(set! (-> *actor-list* *actor-list-length*) (the-as collide-shape s1-1))
|
||||
(set! *actor-list-length* (+ *actor-list-length* 1))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! v1-38 s2-1)
|
||||
*collide-hit-by-player-list*
|
||||
(set! s2-1 (-> s2-1 next0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
(dotimes (s3-1 *actor-list-length*)
|
||||
(let ((v1-58 (-> *actor-list* s3-1)))
|
||||
(when (logtest? s4-0 (-> v1-58 root-prim prim-core collide-as))
|
||||
(let ((a0-37 (-> v1-58 process)))
|
||||
(if (not (or (= a0-37 (-> this ignore-processes 0)) (= a0-37 (-> this ignore-processes 1))))
|
||||
(add-fg-prim-using-line-sphere (-> v1-58 root-prim) this arg0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
|
||||
@@ -146,21 +146,7 @@
|
||||
(s4-0 (-> s1-0 prim-index))
|
||||
)
|
||||
(let ((s0-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((a1-1 s0-0))
|
||||
(let ((v1-1 (-> arg0 center-pt)))
|
||||
(let ((a0-1 (-> s2-0 edge-vec-norm)))
|
||||
(let ((a2-2 1105.92))
|
||||
(.mov vf7 a2-2)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-1 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-1 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-1 quad) vf6)
|
||||
)
|
||||
(vector+*! s0-0 (-> arg0 center-pt) (-> s2-0 edge-vec-norm) 1105.92)
|
||||
(let ((f0-1 (get-best-hand-point this (-> arg1 right-hand-hold) s0-0 (the-as int s4-0))))
|
||||
(if (< 491.52 f0-1)
|
||||
(return (the-as symbol #f))
|
||||
@@ -212,8 +198,8 @@
|
||||
(-> this spec local-player-spheres)
|
||||
12
|
||||
)
|
||||
(let ((a1-12 (new 'stack-no-clear 'collide-query)))
|
||||
(let ((v1-28 a1-12))
|
||||
(let ((a1-13 (new 'stack-no-clear 'collide-query)))
|
||||
(let ((v1-28 a1-13))
|
||||
(set! (-> v1-28 best-dist) (the-as float (-> this world-player-spheres)))
|
||||
(set! (-> v1-28 best-other-prim) (the-as collide-shape-prim 12))
|
||||
(set! (-> v1-28 collide-with) (-> this cshape root-prim prim-core collide-with))
|
||||
@@ -225,7 +211,7 @@
|
||||
(set! (-> v1-28 best-my-prim) (the-as collide-shape-prim #t))
|
||||
(set! (-> v1-28 action-mask) (collide-action solid))
|
||||
)
|
||||
(if (probe-using-spheres (-> this ccache) a1-12)
|
||||
(if (probe-using-spheres (-> this ccache) a1-13)
|
||||
(return (the-as symbol #f))
|
||||
)
|
||||
)
|
||||
@@ -240,12 +226,12 @@
|
||||
(a0-44
|
||||
(set! (-> arg1 actor-cshape-prim-offset) (- (the-as int v1-41) (the-as uint (the-as int (-> a0-44 process)))))
|
||||
(set! (-> arg1 actor-handle) (process->handle (-> a0-44 process)))
|
||||
(let ((a1-19
|
||||
(let ((a1-20
|
||||
(-> a0-44 process node-list data (-> (the-as collide-shape-prim v1-41) transform-index) bone transform)
|
||||
)
|
||||
(s5-1 (new 'stack-no-clear 'matrix))
|
||||
)
|
||||
(matrix-4x4-inverse! s5-1 a1-19)
|
||||
(matrix-4x4-inverse! s5-1 a1-20)
|
||||
(dotimes (s4-1 8)
|
||||
(vector-matrix*! (-> arg1 local-vertex s4-1) (-> arg1 world-vertex s4-1) s5-1)
|
||||
)
|
||||
|
||||
@@ -316,17 +316,8 @@
|
||||
)
|
||||
)
|
||||
(v1-11 (vector-cross! (new 'stack-no-clear 'vector) s3-0 a0-8))
|
||||
(a0-9 (-> arg1 best-other-tri vertex 2))
|
||||
)
|
||||
(let ((a1-7 4096.0))
|
||||
(.mov vf7 a1-7)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-11 quad))
|
||||
(.lvf vf4 (&-> s4-1 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-9 quad) vf6)
|
||||
(vector+*! (-> arg1 best-other-tri vertex 2) s4-1 v1-11 4096.0)
|
||||
)
|
||||
)
|
||||
(b! #t cfg-9 :delay (nop!))
|
||||
@@ -352,7 +343,7 @@
|
||||
(vector+! s3-2 s3-2 (-> this prim-core world-sphere))
|
||||
(set! (-> arg1 best-other-tri vertex 0 quad) (-> s3-2 quad))
|
||||
(point-in-plane-<-point+normal! (-> arg1 best-other-tri vertex 1) s3-2 s4-2)
|
||||
(let* ((a0-23 (vector-normalize!
|
||||
(let* ((a0-24 (vector-normalize!
|
||||
(vector-!
|
||||
(new 'stack-no-clear 'vector)
|
||||
(-> arg1 best-other-tri vertex 1)
|
||||
@@ -361,18 +352,9 @@
|
||||
1.0
|
||||
)
|
||||
)
|
||||
(v1-23 (vector-cross! (new 'stack-no-clear 'vector) s4-2 a0-23))
|
||||
(a0-24 (-> arg1 best-other-tri vertex 2))
|
||||
(v1-23 (vector-cross! (new 'stack-no-clear 'vector) s4-2 a0-24))
|
||||
)
|
||||
(let ((a1-18 4096.0))
|
||||
(.mov vf7 a1-18)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-23 quad))
|
||||
(.lvf vf4 (&-> s3-2 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-24 quad) vf6)
|
||||
(vector+*! (-> arg1 best-other-tri vertex 2) s3-2 v1-23 4096.0)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -153,126 +153,103 @@
|
||||
(sv-80 (function sound-name sound-id int int int sound-group object sound-id :behavior process-drawable))
|
||||
(name sound-name)
|
||||
)
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let* ((debris-box (-> this boxes idx))
|
||||
(box-num (-> debris-box num))
|
||||
(box-start (-> debris-box start))
|
||||
(bbox (-> debris-box bbox))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((debris-box (-> this boxes idx))
|
||||
(box-num (-> debris-box num))
|
||||
(box-start (-> debris-box start))
|
||||
(bbox (-> debris-box bbox))
|
||||
)
|
||||
(when (> box-num 0)
|
||||
(let ((cquery (new 'static 'collide-query)))
|
||||
(let ((debris-start (-> this debris box-start)))
|
||||
(let ((a3-0 (-> cquery bbox))
|
||||
(a1-2 (-> bbox min))
|
||||
(a2-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> a2-0 x) 4096.0)
|
||||
(set! (-> a2-0 y) 4096.0)
|
||||
(set! (-> a2-0 z) 4096.0)
|
||||
(set! (-> a2-0 w) 1.0)
|
||||
(vector-! (-> a3-0 min) a1-2 a2-0)
|
||||
)
|
||||
(let ((a1-3 (-> cquery bbox max))
|
||||
(a0-2 (-> bbox max))
|
||||
(a2-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> a2-1 x) 4096.0)
|
||||
(set! (-> a2-1 y) 4096.0)
|
||||
(set! (-> a2-1 z) 4096.0)
|
||||
(set! (-> a2-1 w) 1.0)
|
||||
(vector+! a1-3 a0-2 a2-1)
|
||||
)
|
||||
(set! (-> cquery collide-with) (-> debris-start params collide-spec))
|
||||
)
|
||||
(set! (-> cquery ignore-process0) #f)
|
||||
(set! (-> cquery ignore-process1) #f)
|
||||
(set! (-> cquery ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
(when (> box-num 0)
|
||||
(let ((cquery (new 'static 'collide-query)))
|
||||
(let ((debris-start (-> this debris box-start)))
|
||||
(let ((a3-0 (-> cquery bbox))
|
||||
(a1-2 (-> bbox min))
|
||||
(a2-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> cquery action-mask) (collide-action solid))
|
||||
(fill-using-bounding-box *collide-cache* cquery)
|
||||
(dotimes (s2-0 (the-as int box-num))
|
||||
(let ((s1-0 (-> this debris (+ s2-0 box-start))))
|
||||
(when (not (logtest? (-> this debris (+ s2-0 box-start) draw status) (draw-control-status no-draw)))
|
||||
(let ((f0-9 (* (-> s1-0 gravity) (seconds-per-frame)))
|
||||
(s0-0 (new 'stack-no-clear 'quaternion))
|
||||
)
|
||||
(vector-copy! (-> s1-0 prev-pos) (-> s1-0 root trans))
|
||||
(+! (-> s1-0 transv y) f0-9)
|
||||
(vector-v+! (-> s1-0 root trans) (-> s1-0 root trans) (-> s1-0 transv))
|
||||
(quaternion-vector-angle! s0-0 (-> s1-0 rot-axis) (* (-> s1-0 rot-angle) (seconds-per-frame)))
|
||||
(quaternion*! (-> s1-0 root quat) (-> s1-0 root quat) s0-0)
|
||||
)
|
||||
(quaternion-normalize! (-> s1-0 root quat))
|
||||
(set! (-> s1-0 rot-angle) (- (-> s1-0 rot-angle) (* (seconds-per-frame) (-> s1-0 rot-angle))))
|
||||
(when (nonzero? (-> s1-0 params collide-spec))
|
||||
(let ((s0-1 (new 'stack-no-clear 'vector)))
|
||||
(vector-! (-> cquery move-dist) (-> s1-0 root trans) (-> s1-0 prev-pos))
|
||||
(vector-copy! (-> cquery start-pos) (-> s1-0 prev-pos))
|
||||
(let ((v1-34 cquery))
|
||||
(set! (-> v1-34 radius) 2048.0)
|
||||
(set! (-> v1-34 collide-with) (-> s1-0 params collide-spec))
|
||||
(set! (-> v1-34 ignore-process0) #f)
|
||||
(set! (-> v1-34 ignore-process1) #f)
|
||||
(set! (-> v1-34 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-34 action-mask) (collide-action solid))
|
||||
)
|
||||
(let ((f0-16 (probe-using-line-sphere *collide-cache* cquery)))
|
||||
(when (>= f0-16 0.0)
|
||||
(let ((a1-12 s0-1))
|
||||
(let ((v1-37 (-> cquery start-pos)))
|
||||
(let ((a0-21 (-> cquery move-dist)))
|
||||
(let ((a2-5 f0-16))
|
||||
(.mov vf7 a2-5)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-21 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-37 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-12 quad) vf6)
|
||||
(set! (-> a2-0 x) 4096.0)
|
||||
(set! (-> a2-0 y) 4096.0)
|
||||
(set! (-> a2-0 z) 4096.0)
|
||||
(set! (-> a2-0 w) 1.0)
|
||||
(vector-! (-> a3-0 min) a1-2 a2-0)
|
||||
)
|
||||
(let ((a1-3 (-> cquery bbox max))
|
||||
(a0-2 (-> bbox max))
|
||||
(a2-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> a2-1 x) 4096.0)
|
||||
(set! (-> a2-1 y) 4096.0)
|
||||
(set! (-> a2-1 z) 4096.0)
|
||||
(set! (-> a2-1 w) 1.0)
|
||||
(vector+! a1-3 a0-2 a2-1)
|
||||
)
|
||||
(set! (-> cquery collide-with) (-> debris-start params collide-spec))
|
||||
)
|
||||
(set! (-> cquery ignore-process0) #f)
|
||||
(set! (-> cquery ignore-process1) #f)
|
||||
(set! (-> cquery ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> cquery action-mask) (collide-action solid))
|
||||
(fill-using-bounding-box *collide-cache* cquery)
|
||||
(dotimes (s2-0 (the-as int box-num))
|
||||
(let ((s1-0 (-> this debris (+ s2-0 box-start))))
|
||||
(when (not (logtest? (-> this debris (+ s2-0 box-start) draw status) (draw-control-status no-draw)))
|
||||
(let ((f0-9 (* (-> s1-0 gravity) (seconds-per-frame)))
|
||||
(s0-0 (new 'stack-no-clear 'quaternion))
|
||||
)
|
||||
(vector-copy! (-> s1-0 prev-pos) (-> s1-0 root trans))
|
||||
(+! (-> s1-0 transv y) f0-9)
|
||||
(vector-v+! (-> s1-0 root trans) (-> s1-0 root trans) (-> s1-0 transv))
|
||||
(quaternion-vector-angle! s0-0 (-> s1-0 rot-axis) (* (-> s1-0 rot-angle) (seconds-per-frame)))
|
||||
(quaternion*! (-> s1-0 root quat) (-> s1-0 root quat) s0-0)
|
||||
)
|
||||
(quaternion-normalize! (-> s1-0 root quat))
|
||||
(set! (-> s1-0 rot-angle) (- (-> s1-0 rot-angle) (* (seconds-per-frame) (-> s1-0 rot-angle))))
|
||||
(when (nonzero? (-> s1-0 params collide-spec))
|
||||
(let ((s0-1 (new 'stack-no-clear 'vector)))
|
||||
(vector-! (-> cquery move-dist) (-> s1-0 root trans) (-> s1-0 prev-pos))
|
||||
(vector-copy! (-> cquery start-pos) (-> s1-0 prev-pos))
|
||||
(let ((v1-34 cquery))
|
||||
(set! (-> v1-34 radius) 2048.0)
|
||||
(set! (-> v1-34 collide-with) (-> s1-0 params collide-spec))
|
||||
(set! (-> v1-34 ignore-process0) #f)
|
||||
(set! (-> v1-34 ignore-process1) #f)
|
||||
(set! (-> v1-34 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(let* ((v1-38 (-> s1-0 transv))
|
||||
(f30-0 (sqrtf (+ (* (-> v1-38 x) (-> v1-38 x)) (* (-> v1-38 z) (-> v1-38 z)))))
|
||||
)
|
||||
(let ((f28-0 (vector-length (-> s1-0 transv))))
|
||||
(when (< (-> s1-0 transv y) -61440.0)
|
||||
(set! sv-80 sound-play-by-name)
|
||||
(set! name (-> s1-0 params sound-hit))
|
||||
(let ((id (new-sound-id))
|
||||
(a2-6 1024)
|
||||
(a3-6 0)
|
||||
(t0-4 0)
|
||||
(t1-0 0)
|
||||
(t2-0 (-> s1-0 root))
|
||||
)
|
||||
(sv-80 name id a2-6 a3-6 t0-4 (the-as sound-group t1-0) t2-0)
|
||||
)
|
||||
(set! (-> v1-34 action-mask) (collide-action solid))
|
||||
)
|
||||
(let ((f0-16 (probe-using-line-sphere *collide-cache* cquery)))
|
||||
(when (>= f0-16 0.0)
|
||||
(vector+*! s0-1 (-> cquery start-pos) (-> cquery move-dist) f0-16)
|
||||
(let* ((v1-38 (-> s1-0 transv))
|
||||
(f30-0 (sqrtf (+ (* (-> v1-38 x) (-> v1-38 x)) (* (-> v1-38 z) (-> v1-38 z)))))
|
||||
)
|
||||
(let ((f28-0 (vector-length (-> s1-0 transv))))
|
||||
(when (< (-> s1-0 transv y) -61440.0)
|
||||
(set! sv-80 sound-play-by-name)
|
||||
(set! name (-> s1-0 params sound-hit))
|
||||
(let ((a1-14 (new-sound-id))
|
||||
(a2-5 1024)
|
||||
(a3-6 0)
|
||||
(t0-4 0)
|
||||
(t1-0 0)
|
||||
(t2-0 (-> s1-0 root))
|
||||
)
|
||||
(sv-80 name a1-14 a2-5 a3-6 t0-4 (the-as sound-group t1-0) t2-0)
|
||||
)
|
||||
(vector-reflect! (-> s1-0 transv) (-> s1-0 transv) (-> cquery best-other-tri normal))
|
||||
(vector-reflect! (-> s1-0 rot-axis) (-> s1-0 rot-axis) (-> cquery best-other-tri normal))
|
||||
(set! (-> s1-0 rot-angle) f28-0)
|
||||
)
|
||||
(let ((f28-1 (-> s1-0 transv y)))
|
||||
(vector-xz-normalize! (-> s1-0 transv) (* f30-0 (-> s1-0 hit-xz-reaction)))
|
||||
(set! (-> s1-0 transv y) (* f28-1 (-> s1-0 hit-y-reaction)))
|
||||
)
|
||||
(vector-reflect! (-> s1-0 transv) (-> s1-0 transv) (-> cquery best-other-tri normal))
|
||||
(vector-reflect! (-> s1-0 rot-axis) (-> s1-0 rot-axis) (-> cquery best-other-tri normal))
|
||||
(set! (-> s1-0 rot-angle) f28-0)
|
||||
)
|
||||
(let ((f28-1 (-> s1-0 transv y)))
|
||||
(vector-xz-normalize! (-> s1-0 transv) (* f30-0 (-> s1-0 hit-xz-reaction)))
|
||||
(set! (-> s1-0 transv y) (* f28-1 (-> s1-0 hit-y-reaction)))
|
||||
)
|
||||
(+! (-> s0-1 y) (* 40.96 (-> cquery best-other-tri normal y)))
|
||||
(set! (-> s0-1 w) 1.0)
|
||||
(set! (-> s1-0 root trans quad) (-> s0-1 quad))
|
||||
)
|
||||
(+! (-> s0-1 y) (* 40.96 (-> cquery best-other-tri normal y)))
|
||||
(set! (-> s0-1 w) 1.0)
|
||||
(set! (-> s1-0 root trans quad) (-> s0-1 quad))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -282,9 +259,9 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defstate idle (debris-group)
|
||||
|
||||
@@ -335,59 +335,37 @@
|
||||
)
|
||||
|
||||
(defmethod projectile-method-25 ((this guard-shot))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let* ((gp-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0))
|
||||
(f30-0 (vector-length s5-1))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((gp-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0))
|
||||
(f30-0 (vector-length s5-1))
|
||||
)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-4 a1-0))
|
||||
(let ((a0-2 s5-1))
|
||||
(let ((a2-1 0.8))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-2 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s4-0 quad) vf6)
|
||||
(let ((f28-0 (-> *part-id-table* 850 init-specs 4 initial-valuef)))
|
||||
(set! (-> *part-id-table* 850 init-specs 4 initial-valuef) (vector-length s5-1))
|
||||
(draw-beam (-> *part-id-table* 850) a1-0 s5-1 #f)
|
||||
(set! (-> *part-id-table* 850 init-specs 4 initial-valuef) f28-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 851) s4-0)
|
||||
(launch-particles (-> *part-id-table* 852) s4-0)
|
||||
)
|
||||
(let ((s4-1 (new 'stack-no-clear 'matrix))
|
||||
(f26-0 (/ f30-0 (meters 9)))
|
||||
(f30-1 (-> *part-id-table* 853 init-specs 3 initial-valuef))
|
||||
(f28-1 (-> *part-id-table* 853 init-specs 4 initial-valuef))
|
||||
)
|
||||
(forward-up->inv-matrix s4-1 s5-1 *up-vector*)
|
||||
(vector-copy! (-> s4-1 trans) gp-0)
|
||||
(set! (-> *part-id-table* 853 init-specs 3 initial-valuef) (* f26-0 f30-1))
|
||||
(set! (-> *part-id-table* 853 init-specs 4 initial-valuef) (* f26-0 f28-1))
|
||||
(launch-particles (-> *part-id-table* 853) s4-1 :origin-is-matrix #t)
|
||||
(set! (-> *part-id-table* 853 init-specs 3 initial-valuef) f30-1)
|
||||
(set! (-> *part-id-table* 853 init-specs 4 initial-valuef) f28-1)
|
||||
(let ((s4-1 (vector+*! (new 'stack-no-clear 'vector) a1-0 s5-1 0.8)))
|
||||
(let ((f28-0 (-> *part-id-table* 850 init-specs 4 initial-valuef)))
|
||||
(set! (-> *part-id-table* 850 init-specs 4 initial-valuef) (vector-length s5-1))
|
||||
(draw-beam (-> *part-id-table* 850) a1-0 s5-1 #f)
|
||||
(set! (-> *part-id-table* 850 init-specs 4 initial-valuef) f28-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 851) s4-1)
|
||||
(launch-particles (-> *part-id-table* 852) s4-1)
|
||||
)
|
||||
(let ((s4-2 (new 'stack-no-clear 'matrix))
|
||||
(f26-0 (/ f30-0 (meters 9)))
|
||||
(f30-1 (-> *part-id-table* 853 init-specs 3 initial-valuef))
|
||||
(f28-1 (-> *part-id-table* 853 init-specs 4 initial-valuef))
|
||||
)
|
||||
(forward-up->inv-matrix s4-2 s5-1 *up-vector*)
|
||||
(vector-copy! (-> s4-2 trans) gp-0)
|
||||
(set! (-> *part-id-table* 853 init-specs 3 initial-valuef) (* f26-0 f30-1))
|
||||
(set! (-> *part-id-table* 853 init-specs 4 initial-valuef) (* f26-0 f28-1))
|
||||
(launch-particles (-> *part-id-table* 853) s4-2 :origin-is-matrix #t)
|
||||
(set! (-> *part-id-table* 853 init-specs 3 initial-valuef) f30-1)
|
||||
(set! (-> *part-id-table* 853 init-specs 4 initial-valuef) f28-1)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod projectile-method-26 ((this guard-shot))
|
||||
|
||||
@@ -331,58 +331,36 @@
|
||||
)
|
||||
|
||||
(defmethod projectile-method-25 ((this metalhead-shot))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let* ((gp-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0))
|
||||
(f30-0 (vector-length s5-1))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((gp-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0))
|
||||
(f30-0 (vector-length s5-1))
|
||||
)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-4 a1-0))
|
||||
(let ((a0-2 s5-1))
|
||||
(let ((a2-1 0.8))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-2 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s4-0 quad) vf6)
|
||||
(let ((f28-0 (-> *part-id-table* 863 init-specs 4 initial-valuef)))
|
||||
(set! (-> *part-id-table* 863 init-specs 4 initial-valuef) (fmin f28-0 (vector-length s5-1)))
|
||||
(draw-beam (-> *part-id-table* 863) a1-0 s5-1 #f)
|
||||
(set! (-> *part-id-table* 863 init-specs 4 initial-valuef) f28-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 864) s4-0)
|
||||
)
|
||||
(let ((s4-1 (new 'stack-no-clear 'matrix))
|
||||
(f26-0 (/ f30-0 (meters 12)))
|
||||
(f30-1 (-> *part-id-table* 865 init-specs 3 initial-valuef))
|
||||
(f28-1 (-> *part-id-table* 865 init-specs 5 initial-valuef))
|
||||
)
|
||||
(forward-up->inv-matrix s4-1 s5-1 *up-vector*)
|
||||
(vector-copy! (-> s4-1 trans) gp-0)
|
||||
(set! (-> *part-id-table* 865 init-specs 3 initial-valuef) (* f26-0 f30-1))
|
||||
(set! (-> *part-id-table* 865 init-specs 5 initial-valuef) (* f26-0 f28-1))
|
||||
(launch-particles (-> *part-id-table* 865) s4-1 :origin-is-matrix #t)
|
||||
(set! (-> *part-id-table* 865 init-specs 3 initial-valuef) f30-1)
|
||||
(set! (-> *part-id-table* 865 init-specs 5 initial-valuef) f28-1)
|
||||
(let ((s4-1 (vector+*! (new 'stack-no-clear 'vector) a1-0 s5-1 0.8)))
|
||||
(let ((f28-0 (-> *part-id-table* 863 init-specs 4 initial-valuef)))
|
||||
(set! (-> *part-id-table* 863 init-specs 4 initial-valuef) (fmin f28-0 (vector-length s5-1)))
|
||||
(draw-beam (-> *part-id-table* 863) a1-0 s5-1 #f)
|
||||
(set! (-> *part-id-table* 863 init-specs 4 initial-valuef) f28-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 864) s4-1)
|
||||
)
|
||||
(let ((s4-2 (new 'stack-no-clear 'matrix))
|
||||
(f26-0 (/ f30-0 (meters 12)))
|
||||
(f30-1 (-> *part-id-table* 865 init-specs 3 initial-valuef))
|
||||
(f28-1 (-> *part-id-table* 865 init-specs 5 initial-valuef))
|
||||
)
|
||||
(forward-up->inv-matrix s4-2 s5-1 *up-vector*)
|
||||
(vector-copy! (-> s4-2 trans) gp-0)
|
||||
(set! (-> *part-id-table* 865 init-specs 3 initial-valuef) (* f26-0 f30-1))
|
||||
(set! (-> *part-id-table* 865 init-specs 5 initial-valuef) (* f26-0 f28-1))
|
||||
(launch-particles (-> *part-id-table* 865) s4-2 :origin-is-matrix #t)
|
||||
(set! (-> *part-id-table* 865 init-specs 3 initial-valuef) f30-1)
|
||||
(set! (-> *part-id-table* 865 init-specs 5 initial-valuef) f28-1)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod projectile-method-26 ((this metalhead-shot))
|
||||
|
||||
@@ -99,52 +99,32 @@
|
||||
|
||||
(defmethod post-common ((this remote))
|
||||
(with-pp
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(ja-post)
|
||||
(if (type? (-> this root) collide-shape)
|
||||
(update-transforms (the-as collide-shape (-> this root)))
|
||||
)
|
||||
(when (and (nonzero? (-> this part)) (and (or (and (-> this next-state) (= (-> this next-state name) 'idle))
|
||||
(and (-> this next-state) (= (-> this next-state name) 'enter))
|
||||
)
|
||||
(-> this speak-effect?)
|
||||
)
|
||||
)
|
||||
(let ((v1-15
|
||||
(vector-float*! (new 'stack-no-clear 'vector) (-> this parent 0 velocity) (-> pp clock frames-per-second))
|
||||
)
|
||||
(a0-8 *particle-vel*)
|
||||
)
|
||||
(let ((a1-4 (-> this node-list data 3 bone transform fvec)))
|
||||
(let ((a2-1 20480.0))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-4 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-15 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-8 quad) vf6)
|
||||
)
|
||||
(let ((v1-16 *particle-vel*)
|
||||
(a0-9 *particle-vel*)
|
||||
(f0-2 300.0)
|
||||
)
|
||||
(vector-float*! v1-16 a0-9 (/ 1.0 f0-2))
|
||||
)
|
||||
(spawn-from-cspace (-> this part) (-> this node-list data 3))
|
||||
(ja-post)
|
||||
(if (type? (-> this root) collide-shape)
|
||||
(update-transforms (the-as collide-shape (-> this root)))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
(when (and (nonzero? (-> this part)) (and (or (and (-> this next-state) (= (-> this next-state name) 'idle))
|
||||
(and (-> this next-state) (= (-> this next-state name) 'enter))
|
||||
)
|
||||
(-> this speak-effect?)
|
||||
)
|
||||
)
|
||||
(let ((v1-15
|
||||
(vector-float*! (new 'stack-no-clear 'vector) (-> this parent 0 velocity) (-> pp clock frames-per-second))
|
||||
)
|
||||
)
|
||||
(vector+*! *particle-vel* v1-15 (-> this node-list data 3 bone transform fvec) 20480.0)
|
||||
)
|
||||
(let ((v1-16 *particle-vel*)
|
||||
(a0-10 *particle-vel*)
|
||||
(f0-2 300.0)
|
||||
)
|
||||
(vector-float*! v1-16 a0-10 (/ 1.0 f0-2))
|
||||
)
|
||||
(spawn-from-cspace (-> this part) (-> this node-list data 3))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -76,225 +76,155 @@
|
||||
|
||||
(defmethod flow-control-method-13 ((this flow-control) (arg0 water-info) (arg1 vector))
|
||||
(local-vars (v0-7 symbol) (sv-192 vector) (sv-208 vector) (sv-224 flow-section))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-0 arg1)
|
||||
(set! (-> s5-0 w) 1.0)
|
||||
(when (>= (vector4-dot s5-0 (the-as vector (-> this leading))) 0.0)
|
||||
(let* ((s1-0 (-> this sections))
|
||||
(s2-0 (-> s1-0 length))
|
||||
(a3-0 (the-as object (-> this leading)))
|
||||
)
|
||||
(dotimes (s4-0 s2-0)
|
||||
(let ((s3-0 (-> s1-0 data s4-0)))
|
||||
(when (< (vector4-dot s5-0 (the-as vector (-> s3-0 trailing))) 0.0)
|
||||
(let ((v1-10 (new 'stack-no-clear 'vector)))
|
||||
(vector-! v1-10 s5-0 (-> s3-0 start))
|
||||
(when (>= (-> this belt-radius) (fabs (vector-dot v1-10 (-> s3-0 radial-dir))))
|
||||
(let* ((f0-7 (vector-dot v1-10 (-> s3-0 pull-dir)))
|
||||
(f0-9 (- (-> v1-10 y) (* (-> s3-0 pull-dir y) f0-7)))
|
||||
)
|
||||
(when (and (>= f0-9 -41984.0) (>= 41779.2 f0-9))
|
||||
(let ((a0-11 (new 'stack-no-clear 'vector)))
|
||||
(set! sv-192 (new 'stack-no-clear 'vector))
|
||||
(let* ((f30-0 (ray-plane-equation-intersect a0-11 s5-0 (-> s3-0 pull-dir) (the-as vector a3-0)))
|
||||
(t9-1 ray-plane-equation-intersect)
|
||||
(a1-5 s5-0)
|
||||
(a2-4 (-> s3-0 pull-dir))
|
||||
(a3-1 (-> s3-0 trailing))
|
||||
(f0-10 (t9-1 sv-192 a1-5 a2-4 a3-1))
|
||||
)
|
||||
(let ((a1-6 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-16 (-> s3-0 start)))
|
||||
(let ((a0-13 (-> s3-0 pull-dir)))
|
||||
(let ((a2-6 12288.0))
|
||||
(.mov vf7 a2-6)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-13 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-16 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-6 quad) vf6)
|
||||
)
|
||||
0
|
||||
(let ((f0-12 (/ f30-0 (- f30-0 f0-10))))
|
||||
(set! sv-208 (new 'stack-no-clear 'vector))
|
||||
(displacement-between-two-points-normalized! (-> this path) sv-208 (+ (the float (if (= s4-0 (+ s2-0 -1))
|
||||
(+ s4-0 -1)
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
f0-12
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-0 arg1)
|
||||
(set! (-> s5-0 w) 1.0)
|
||||
(when (>= (vector4-dot s5-0 (the-as vector (-> this leading))) 0.0)
|
||||
(let* ((s1-0 (-> this sections))
|
||||
(s2-0 (-> s1-0 length))
|
||||
(a3-0 (the-as object (-> this leading)))
|
||||
)
|
||||
(dotimes (s4-0 s2-0)
|
||||
(let ((s3-0 (-> s1-0 data s4-0)))
|
||||
(when (< (vector4-dot s5-0 (the-as vector (-> s3-0 trailing))) 0.0)
|
||||
(let ((v1-10 (new 'stack-no-clear 'vector)))
|
||||
(vector-! v1-10 s5-0 (-> s3-0 start))
|
||||
(when (>= (-> this belt-radius) (fabs (vector-dot v1-10 (-> s3-0 radial-dir))))
|
||||
(let* ((f0-7 (vector-dot v1-10 (-> s3-0 pull-dir)))
|
||||
(f0-9 (- (-> v1-10 y) (* (-> s3-0 pull-dir y) f0-7)))
|
||||
)
|
||||
(when (and (>= f0-9 -41984.0) (>= 41779.2 f0-9))
|
||||
(let ((a0-11 (new 'stack-no-clear 'vector)))
|
||||
(set! sv-192 (new 'stack-no-clear 'vector))
|
||||
(let* ((f30-0 (ray-plane-equation-intersect a0-11 s5-0 (-> s3-0 pull-dir) (the-as vector a3-0)))
|
||||
(t9-1 ray-plane-equation-intersect)
|
||||
(a1-5 s5-0)
|
||||
(a2-4 (-> s3-0 pull-dir))
|
||||
(a3-1 (-> s3-0 trailing))
|
||||
(f0-10 (t9-1 sv-192 a1-5 a2-4 a3-1))
|
||||
)
|
||||
(vector+*! (new 'stack-no-clear 'vector) (-> s3-0 start) (-> s3-0 pull-dir) 12288.0)
|
||||
0
|
||||
(let ((f0-12 (/ f30-0 (- f30-0 f0-10))))
|
||||
(set! sv-208 (new 'stack-no-clear 'vector))
|
||||
(displacement-between-two-points-normalized! (-> this path) sv-208 (+ (the float (if (= s4-0 (+ s2-0 -1))
|
||||
(+ s4-0 -1)
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
f0-12
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-22 (new 'stack-no-clear 'vector)))
|
||||
(let ((a0-15 v1-22)
|
||||
(f0-15 (* (-> s3-0 speed) (seconds-per-frame)))
|
||||
)
|
||||
(vector-float*! a0-15 sv-208 f0-15)
|
||||
)
|
||||
(let ((a1-10 (new 'stack-no-clear 'vector)))
|
||||
(let ((a0-17 s5-0))
|
||||
(let ((a2-9 2048.0))
|
||||
(.mov vf7 a2-9)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-22 quad))
|
||||
(.lvf vf4 (&-> a0-17 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-10 quad) vf6)
|
||||
)
|
||||
)
|
||||
0
|
||||
(let ((s0-1 (-> s3-0 start)))
|
||||
(set! sv-224 (-> s1-0 data (if (= s4-0 (+ s2-0 -1))
|
||||
(+ s4-0 -1)
|
||||
(+ s4-0 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s4-1 (new 'stack-no-clear 'vector)))
|
||||
(let ((s2-1 (new 'stack-no-clear 'vector))
|
||||
(s1-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-copy! s2-1 (-> s3-0 pull-dir))
|
||||
(vector-normalize! s2-1 1.0)
|
||||
(vector-cross! s1-1 s2-1 *y-vector*)
|
||||
(vector-normalize! s1-1 1.0)
|
||||
(vector-cross! (-> arg0 normal) s2-1 s1-1)
|
||||
)
|
||||
(let ((t9-5 vector-segment-distance-point!)
|
||||
(a3-2 s4-1)
|
||||
)
|
||||
(t9-5 s5-0 s0-1 (-> sv-224 start) a3-2)
|
||||
)
|
||||
(set! (-> arg0 trans y) (-> s4-1 y))
|
||||
)
|
||||
)
|
||||
(if (< (-> arg0 normal y) 0.0)
|
||||
(vector-negate! (-> arg0 normal) (-> arg0 normal))
|
||||
)
|
||||
0
|
||||
(return #t)
|
||||
)
|
||||
(let ((v1-22 (new 'stack-no-clear 'vector)))
|
||||
(let ((a0-15 v1-22)
|
||||
(f0-15 (* (-> s3-0 speed) (seconds-per-frame)))
|
||||
)
|
||||
(vector-float*! a0-15 sv-208 f0-15)
|
||||
)
|
||||
(vector+*! (new 'stack-no-clear 'vector) s5-0 v1-22 2048.0)
|
||||
)
|
||||
0
|
||||
(let ((s0-1 (-> s3-0 start)))
|
||||
(set! sv-224 (-> s1-0 data (if (= s4-0 (+ s2-0 -1))
|
||||
(+ s4-0 -1)
|
||||
(+ s4-0 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s4-1 (new 'stack-no-clear 'vector)))
|
||||
(let ((s2-1 (new 'stack-no-clear 'vector))
|
||||
(s1-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-copy! s2-1 (-> s3-0 pull-dir))
|
||||
(vector-normalize! s2-1 1.0)
|
||||
(vector-cross! s1-1 s2-1 *y-vector*)
|
||||
(vector-normalize! s1-1 1.0)
|
||||
(vector-cross! (-> arg0 normal) s2-1 s1-1)
|
||||
)
|
||||
(let ((t9-5 vector-segment-distance-point!)
|
||||
(a3-2 s4-1)
|
||||
)
|
||||
(t9-5 s5-0 s0-1 (-> sv-224 start) a3-2)
|
||||
)
|
||||
(set! (-> arg0 trans y) (-> s4-1 y))
|
||||
)
|
||||
)
|
||||
(if (< (-> arg0 normal y) 0.0)
|
||||
(vector-negate! (-> arg0 normal) (-> arg0 normal))
|
||||
)
|
||||
0
|
||||
(return #t)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! a3-0 (+ (the-as uint (-> s1-0 data 0 trailing)) (* 80 s4-0)))
|
||||
)
|
||||
(set! a3-0 (+ (the-as uint (-> s1-0 data 0 trailing)) (* 80 s4-0)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(return #f)
|
||||
v0-7
|
||||
)
|
||||
(return #f)
|
||||
v0-7
|
||||
)
|
||||
|
||||
;; WARN: Function (method 11 flow-control) has a return type of none, but the expression builder found a return statement.
|
||||
(defmethod push-process ((this flow-control) (arg0 process-focusable))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-0 (get-trans arg0 0))
|
||||
(set! (-> s5-0 w) 1.0)
|
||||
(when (>= (vector4-dot s5-0 (the-as vector (-> this leading))) 0.0)
|
||||
(let* ((v1-7 (-> this sections))
|
||||
(a0-3 (-> v1-7 length))
|
||||
(a3-0 (the-as object (-> this leading)))
|
||||
)
|
||||
(dotimes (s3-1 a0-3)
|
||||
(let ((s2-0 (-> v1-7 data s3-1)))
|
||||
(when (< (vector4-dot s5-0 (the-as vector (-> s2-0 trailing))) 0.0)
|
||||
(let ((v1-8 (new 'stack-no-clear 'vector)))
|
||||
(vector-! v1-8 s5-0 (-> s2-0 start))
|
||||
(when (>= (-> this belt-radius) (fabs (vector-dot v1-8 (-> s2-0 radial-dir))))
|
||||
(let* ((f0-7 (vector-dot v1-8 (-> s2-0 pull-dir)))
|
||||
(f0-9 (- (-> v1-8 y) (* (-> s2-0 pull-dir y) f0-7)))
|
||||
)
|
||||
(when (and (>= f0-9 -41984.0) (>= 41779.2 f0-9))
|
||||
(let* ((a0-11 (new 'stack-no-clear 'vector))
|
||||
(s1-0 (new 'stack-no-clear 'vector))
|
||||
(f30-0 (ray-plane-equation-intersect a0-11 s5-0 (-> s2-0 pull-dir) (the-as vector a3-0)))
|
||||
(f0-10 (ray-plane-equation-intersect s1-0 s5-0 (-> s2-0 pull-dir) (-> s2-0 trailing)))
|
||||
)
|
||||
(let ((a1-13 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-13 (-> s2-0 start)))
|
||||
(let ((a0-13 (-> s2-0 pull-dir)))
|
||||
(let ((a2-6 12288.0))
|
||||
(.mov vf7 a2-6)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-13 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-13 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-13 quad) vf6)
|
||||
)
|
||||
0
|
||||
(let ((f0-12 (/ f30-0 (- f30-0 f0-10)))
|
||||
(s1-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(displacement-between-two-points-normalized! (-> this path) s1-1 (+ (the float s3-1) f0-12))
|
||||
(let ((v1-17 (new 'stack-no-clear 'vector)))
|
||||
(vector-float*! v1-17 s1-1 (* (-> s2-0 speed) (seconds-per-frame)))
|
||||
(let ((a1-16 (new 'stack-no-clear 'vector)))
|
||||
(let ((a0-17 v1-17))
|
||||
(let ((a2-9 2048.0))
|
||||
(.mov vf7 a2-9)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-17 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> s5-0 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-16 quad) vf6)
|
||||
)
|
||||
0
|
||||
(send-event arg0 'push-trans v1-17 (seconds 10))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-0 (get-trans arg0 0))
|
||||
(set! (-> s5-0 w) 1.0)
|
||||
(when (>= (vector4-dot s5-0 (the-as vector (-> this leading))) 0.0)
|
||||
(let* ((v1-7 (-> this sections))
|
||||
(a0-3 (-> v1-7 length))
|
||||
(a3-0 (the-as object (-> this leading)))
|
||||
)
|
||||
(dotimes (s3-1 a0-3)
|
||||
(let ((s2-0 (-> v1-7 data s3-1)))
|
||||
(when (< (vector4-dot s5-0 (the-as vector (-> s2-0 trailing))) 0.0)
|
||||
(let ((v1-8 (new 'stack-no-clear 'vector)))
|
||||
(vector-! v1-8 s5-0 (-> s2-0 start))
|
||||
(when (>= (-> this belt-radius) (fabs (vector-dot v1-8 (-> s2-0 radial-dir))))
|
||||
(let* ((f0-7 (vector-dot v1-8 (-> s2-0 pull-dir)))
|
||||
(f0-9 (- (-> v1-8 y) (* (-> s2-0 pull-dir y) f0-7)))
|
||||
)
|
||||
(when (and (>= f0-9 -41984.0) (>= 41779.2 f0-9))
|
||||
(let* ((a0-11 (new 'stack-no-clear 'vector))
|
||||
(s1-0 (new 'stack-no-clear 'vector))
|
||||
(f30-0 (ray-plane-equation-intersect a0-11 s5-0 (-> s2-0 pull-dir) (the-as vector a3-0)))
|
||||
(f0-10 (ray-plane-equation-intersect s1-0 s5-0 (-> s2-0 pull-dir) (-> s2-0 trailing)))
|
||||
)
|
||||
(vector+*! (new 'stack-no-clear 'vector) (-> s2-0 start) (-> s2-0 pull-dir) 12288.0)
|
||||
0
|
||||
(let ((f0-12 (/ f30-0 (- f30-0 f0-10)))
|
||||
(s1-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(displacement-between-two-points-normalized! (-> this path) s1-1 (+ (the float s3-1) f0-12))
|
||||
(let ((v1-17 (new 'stack-no-clear 'vector)))
|
||||
(vector-float*! v1-17 s1-1 (* (-> s2-0 speed) (seconds-per-frame)))
|
||||
(vector+*! (new 'stack-no-clear 'vector) s5-0 v1-17 2048.0)
|
||||
0
|
||||
(send-event arg0 'push-trans v1-17 (seconds 10))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(return #f)
|
||||
)
|
||||
(return #f)
|
||||
)
|
||||
(set! a3-0 (+ (the-as uint (-> v1-7 data 0 trailing)) (* 80 s3-1)))
|
||||
)
|
||||
(set! a3-0 (+ (the-as uint (-> v1-7 data 0 trailing)) (* 80 s3-1)))
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod find-and-push-things ((this flow-control))
|
||||
|
||||
@@ -1350,56 +1350,35 @@
|
||||
)
|
||||
|
||||
(defun-debug add-debug-light ((arg0 symbol) (arg1 bucket-id) (arg2 light) (arg3 vector) (arg4 string))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(if (not (or arg0 *display-capture-mode*))
|
||||
(return #f)
|
||||
)
|
||||
(when (!= (-> arg2 extra x) 0.0)
|
||||
(add-debug-vector
|
||||
arg0
|
||||
arg1
|
||||
arg3
|
||||
(-> arg2 direction)
|
||||
(meters 3)
|
||||
(new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
|
||||
)
|
||||
(let ((s2-0 (new-stack-vector0)))
|
||||
(let ((v1-4 (-> arg2 direction)))
|
||||
(let ((a0-3 (* 12288.0 (-> arg2 extra x))))
|
||||
(.mov vf7 a0-3)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-4 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> arg3 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s2-0 quad) vf6)
|
||||
(let ((s1-1 (logior (logior (logior (shr (shl (the int (* 128.0 (-> arg2 color w))) 56) 32)
|
||||
(shr (shl (the int (* 128.0 (-> arg2 color z))) 56) 40)
|
||||
)
|
||||
(shr (shl (the int (* 128.0 (-> arg2 color y))) 56) 48)
|
||||
)
|
||||
(shr (shl (the int (* 128.0 (-> arg2 color x))) 56) 56)
|
||||
)
|
||||
)
|
||||
)
|
||||
(format (clear *temp-string*) "~S ~,,2f" arg4 (-> arg2 extra x))
|
||||
(let ((t0-2 *temp-string*))
|
||||
(add-debug-text-sphere arg0 arg1 s2-0 (* 2048.0 (-> arg2 extra x)) t0-2 (the-as rgba s1-1))
|
||||
)
|
||||
(if (not (or arg0 *display-capture-mode*))
|
||||
(return #f)
|
||||
)
|
||||
(when (!= (-> arg2 extra x) 0.0)
|
||||
(add-debug-vector
|
||||
arg0
|
||||
arg1
|
||||
arg3
|
||||
(-> arg2 direction)
|
||||
(meters 3)
|
||||
(new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
|
||||
)
|
||||
(let ((s2-1 (vector+*! (new-stack-vector0) arg3 (-> arg2 direction) (* 12288.0 (-> arg2 extra x))))
|
||||
(s1-1 (logior (logior (logior (shr (shl (the int (* 128.0 (-> arg2 color w))) 56) 32)
|
||||
(shr (shl (the int (* 128.0 (-> arg2 color z))) 56) 40)
|
||||
)
|
||||
(shr (shl (the int (* 128.0 (-> arg2 color y))) 56) 48)
|
||||
)
|
||||
(shr (shl (the int (* 128.0 (-> arg2 color x))) 56) 56)
|
||||
)
|
||||
)
|
||||
)
|
||||
(format (clear *temp-string*) "~S ~,,2f" arg4 (-> arg2 extra x))
|
||||
(let ((t0-2 *temp-string*))
|
||||
(add-debug-text-sphere arg0 arg1 s2-1 (* 2048.0 (-> arg2 extra x)) t0-2 (the-as rgba s1-1))
|
||||
)
|
||||
)
|
||||
#f
|
||||
)
|
||||
#f
|
||||
)
|
||||
|
||||
(defun-debug add-debug-lights ((arg0 symbol) (arg1 bucket-id) (arg2 (inline-array light)) (arg3 vector))
|
||||
|
||||
@@ -92,30 +92,17 @@
|
||||
)
|
||||
(vector-cross! s1-0 s1-0 arg1)
|
||||
(vector-normalize! s1-0 1.0)
|
||||
(let ((s0-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-10 arg0))
|
||||
(let ((a0-8 arg1))
|
||||
(let ((a1-10 arg2))
|
||||
(.mov vf7 a1-10)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-8 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-10 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s0-0 quad) vf6)
|
||||
(let ((s0-1 (vector+*! (new 'stack-no-clear 'vector) arg0 arg1 arg2)))
|
||||
(set! sv-160 0)
|
||||
(while (< sv-160 8)
|
||||
(set! sv-176 add-debug-flat-triangle)
|
||||
(set! sv-192 #t)
|
||||
(set! sv-208 584)
|
||||
(set! sv-224 (new 'stack-no-clear 'vector))
|
||||
(let ((v1-16 s0-0))
|
||||
(let ((v1-16 s0-1))
|
||||
(let ((a0-9 arg1))
|
||||
(let ((a1-11 arg3))
|
||||
(.mov vf7 a1-11)
|
||||
(let ((a1-10 arg3))
|
||||
(.mov vf7 a1-10)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-9 quad))
|
||||
)
|
||||
@@ -126,7 +113,7 @@
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> sv-224 quad) vf6)
|
||||
(set! sv-256 (new 'stack-no-clear 'vector))
|
||||
(set! sv-240 s0-0)
|
||||
(set! sv-240 s0-1)
|
||||
(let* ((a2-3
|
||||
(quaternion-vector-angle! (new 'stack-no-clear 'quaternion) arg1 (* 182.04445 (the float (* 45 sv-160))))
|
||||
)
|
||||
@@ -143,7 +130,7 @@
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> sv-256 quad) vf6)
|
||||
(set! sv-288 (new 'stack-no-clear 'vector))
|
||||
(set! sv-272 s0-0)
|
||||
(set! sv-272 s0-1)
|
||||
(let* ((a2-7 (quaternion-vector-angle!
|
||||
(new 'stack-no-clear 'quaternion)
|
||||
arg1
|
||||
@@ -184,277 +171,161 @@
|
||||
|
||||
(defmethod manipulator-method-11 ((this manipulator))
|
||||
(local-vars (sv-240 rgba) (sv-256 vector) (sv-272 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(format *stdcon* "~M ~M ~M~%" (-> this position x) (-> this position y) (-> this position z))
|
||||
(let ((s5-0 (-> this position)))
|
||||
0.0
|
||||
(let* ((v0-1
|
||||
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> *math-camera* trans) (-> this position)) 1.0)
|
||||
)
|
||||
(s4-0 (< (fabs (vector-dot v0-1 (-> this mat rvec))) 0.9))
|
||||
(s3-0 (< (fabs (vector-dot v0-1 (-> this mat uvec))) 0.9))
|
||||
(s2-0 (< (fabs (vector-dot v0-1 (-> this mat fvec))) 0.9))
|
||||
(f30-1 (* 0.15 (vector-vector-distance (-> *math-camera* trans) s5-0)))
|
||||
(format *stdcon* "~M ~M ~M~%" (-> this position x) (-> this position y) (-> this position z))
|
||||
(let ((s5-0 (-> this position)))
|
||||
0.0
|
||||
(let* ((v0-1
|
||||
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> *math-camera* trans) (-> this position)) 1.0)
|
||||
)
|
||||
(if s4-0
|
||||
(draw-axis s5-0 (-> this mat rvec) f30-1 (/ f30-1 4) (if (= (-> this action) (manipulator-action ma1))
|
||||
*color-yellow*
|
||||
*color-red*
|
||||
)
|
||||
)
|
||||
(s4-0 (< (fabs (vector-dot v0-1 (-> this mat rvec))) 0.9))
|
||||
(s3-0 (< (fabs (vector-dot v0-1 (-> this mat uvec))) 0.9))
|
||||
(s2-0 (< (fabs (vector-dot v0-1 (-> this mat fvec))) 0.9))
|
||||
(f30-1 (* 0.15 (vector-vector-distance (-> *math-camera* trans) s5-0)))
|
||||
)
|
||||
(if s4-0
|
||||
(draw-axis s5-0 (-> this mat rvec) f30-1 (/ f30-1 4) (if (= (-> this action) (manipulator-action ma1))
|
||||
*color-yellow*
|
||||
*color-red*
|
||||
)
|
||||
)
|
||||
)
|
||||
(if s3-0
|
||||
(draw-axis s5-0 (-> this mat uvec) f30-1 (/ f30-1 4) (if (= (-> this action) (manipulator-action ma2))
|
||||
*color-yellow*
|
||||
*color-green*
|
||||
)
|
||||
)
|
||||
)
|
||||
(if s2-0
|
||||
(draw-axis s5-0 (-> this mat fvec) f30-1 (/ f30-1 4) (if (= (-> this action) (manipulator-action ma3))
|
||||
*color-yellow*
|
||||
*color-blue*
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s1-0 (new 'stack-no-clear 'vector))
|
||||
(s0-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(if s3-0
|
||||
(draw-axis s5-0 (-> this mat uvec) f30-1 (/ f30-1 4) (if (= (-> this action) (manipulator-action ma2))
|
||||
*color-yellow*
|
||||
*color-green*
|
||||
)
|
||||
)
|
||||
)
|
||||
(if s2-0
|
||||
(draw-axis s5-0 (-> this mat fvec) f30-1 (/ f30-1 4) (if (= (-> this action) (manipulator-action ma3))
|
||||
*color-yellow*
|
||||
*color-blue*
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s1-0 (new 'stack-no-clear 'vector))
|
||||
(s0-0 (new 'stack-no-clear 'vector))
|
||||
(let ((f28-0 0.1))
|
||||
(if (= (-> this action) (manipulator-action ma7))
|
||||
(set! sv-240 *color-yellow*)
|
||||
(set! sv-240 *color-light-blue*)
|
||||
)
|
||||
(let ((f28-0 0.1))
|
||||
(if (= (-> this action) (manipulator-action ma7))
|
||||
(set! sv-240 *color-yellow*)
|
||||
(set! sv-240 *color-light-blue*)
|
||||
)
|
||||
(let ((a1-7 s1-0))
|
||||
(let ((v1-26 s5-0))
|
||||
(let ((a0-13 (vector+!
|
||||
(new 'stack-no-clear 'vector)
|
||||
(-> *math-camera* inv-camera-rot rvec)
|
||||
(-> *math-camera* inv-camera-rot uvec)
|
||||
)
|
||||
(vector+*!
|
||||
s1-0
|
||||
s5-0
|
||||
(vector+!
|
||||
(new 'stack-no-clear 'vector)
|
||||
(-> *math-camera* inv-camera-rot rvec)
|
||||
(-> *math-camera* inv-camera-rot uvec)
|
||||
)
|
||||
(* f30-1 f28-0)
|
||||
)
|
||||
(vector+*! s0-0 s1-0 (-> *math-camera* inv-camera-rot uvec) (* -2.0 f30-1 f28-0))
|
||||
(add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1))
|
||||
(vector-copy! s1-0 s0-0)
|
||||
(vector+*! s0-0 s0-0 (-> *math-camera* inv-camera-rot rvec) (* -2.0 f30-1 f28-0))
|
||||
(add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1))
|
||||
(vector-copy! s1-0 s0-0)
|
||||
(vector+*! s0-0 s0-0 (-> *math-camera* inv-camera-rot uvec) (* 2.0 f30-1 f28-0))
|
||||
(add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1))
|
||||
(vector-copy! s1-0 s0-0)
|
||||
(vector+*! s0-0 s0-0 (-> *math-camera* inv-camera-rot rvec) (* 2.0 f30-1 f28-0))
|
||||
)
|
||||
(let ((t9-9 add-debug-line)
|
||||
(a0-31 #t)
|
||||
(a1-20 577)
|
||||
(t1-3 #f)
|
||||
(t2-3 -1)
|
||||
)
|
||||
(t9-9 a0-31 (the-as bucket-id a1-20) s1-0 s0-0 sv-240 t1-3 (the-as rgba t2-3))
|
||||
)
|
||||
)
|
||||
(let ((s1-1 (new 'stack-no-clear 'vector)))
|
||||
(when (and s3-0 s2-0)
|
||||
(vector+*! s1-1 s5-0 (vector+! (new 'stack-no-clear 'vector) (-> this mat fvec) (-> this mat uvec)) f30-1)
|
||||
(let ((s0-1 draw-axis))
|
||||
(set! sv-256 s1-1)
|
||||
(let ((a1-24 (vector-negate! (new 'stack-no-clear 'vector) (-> this mat uvec)))
|
||||
(a2-15 (* 0.15 f30-1))
|
||||
(a3-11 (* 0.15 f30-1))
|
||||
(t0-11 (if (= (-> this action) (manipulator-action ma6))
|
||||
*color-yellow*
|
||||
*color-green*
|
||||
)
|
||||
)
|
||||
(let ((a2-6 (* f30-1 f28-0)))
|
||||
(.mov vf7 a2-6)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-13 quad))
|
||||
)
|
||||
)
|
||||
(.lvf vf4 (&-> v1-26 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-7 quad) vf6)
|
||||
)
|
||||
(let ((a0-14 s0-0))
|
||||
(let ((v1-27 s1-0))
|
||||
(let ((a1-9 (-> *math-camera* inv-camera-rot uvec)))
|
||||
(let ((a2-8 (* -2.0 f30-1 f28-0)))
|
||||
(.mov vf7 a2-8)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-9 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-27 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-14 quad) vf6)
|
||||
)
|
||||
(add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1))
|
||||
(vector-copy! s1-0 s0-0)
|
||||
(let ((a0-18 s0-0))
|
||||
(let ((v1-29 s0-0))
|
||||
(let ((a1-12 (-> *math-camera* inv-camera-rot)))
|
||||
(let ((a2-11 (* -2.0 f30-1 f28-0)))
|
||||
(.mov vf7 a2-11)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-12 rvec quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-29 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-18 quad) vf6)
|
||||
)
|
||||
(add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1))
|
||||
(vector-copy! s1-0 s0-0)
|
||||
(let ((a0-22 s0-0))
|
||||
(let ((v1-31 s0-0))
|
||||
(let ((a1-15 (-> *math-camera* inv-camera-rot uvec)))
|
||||
(let ((a2-14 (* 2.0 f30-1 f28-0)))
|
||||
(.mov vf7 a2-14)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-15 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-31 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-22 quad) vf6)
|
||||
)
|
||||
(add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1))
|
||||
(vector-copy! s1-0 s0-0)
|
||||
(let ((a0-26 s0-0))
|
||||
(let ((v1-33 s0-0))
|
||||
(let ((a1-18 (-> *math-camera* inv-camera-rot)))
|
||||
(let ((a2-17 (* 2.0 f30-1 f28-0)))
|
||||
(.mov vf7 a2-17)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-18 rvec quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-33 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-26 quad) vf6)
|
||||
(s0-1 sv-256 a1-24 a2-15 a3-11 t0-11)
|
||||
)
|
||||
)
|
||||
(let ((t9-9 add-debug-line)
|
||||
(a0-27 #t)
|
||||
(a1-19 577)
|
||||
(t1-3 #f)
|
||||
(t2-3 -1)
|
||||
)
|
||||
(t9-9 a0-27 (the-as bucket-id a1-19) s1-0 s0-0 sv-240 t1-3 (the-as rgba t2-3))
|
||||
(let ((s0-2 draw-axis))
|
||||
(set! sv-272 s1-1)
|
||||
(let ((a1-26 (vector-negate! (new 'stack-no-clear 'vector) (-> this mat fvec)))
|
||||
(a2-16 (* 0.15 f30-1))
|
||||
(a3-12 (* 0.15 f30-1))
|
||||
(t0-12 (if (= (-> this action) (manipulator-action ma6))
|
||||
*color-yellow*
|
||||
*color-blue*
|
||||
)
|
||||
)
|
||||
)
|
||||
(s0-2 sv-272 a1-26 a2-16 a3-12 t0-12)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s1-1 (new 'stack-no-clear 'vector)))
|
||||
(when (and s3-0 s2-0)
|
||||
(let ((a1-20 s1-1))
|
||||
(let ((v1-36 s5-0))
|
||||
(let ((a0-29 (vector+! (new 'stack-no-clear 'vector) (-> this mat fvec) (-> this mat uvec))))
|
||||
(let ((a2-20 f30-1))
|
||||
(.mov vf7 a2-20)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-29 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-36 quad))
|
||||
(set! s2-0 (and s4-0 s2-0))
|
||||
(when s2-0
|
||||
(vector+*! s1-1 s5-0 (vector+! (new 'stack-no-clear 'vector) (-> this mat rvec) (-> this mat fvec)) f30-1)
|
||||
(draw-axis
|
||||
s1-1
|
||||
(vector-negate! (new 'stack-no-clear 'vector) (-> this mat rvec))
|
||||
(* 0.15 f30-1)
|
||||
(* 0.15 f30-1)
|
||||
(if (= (-> this action) (manipulator-action ma5))
|
||||
*color-yellow*
|
||||
*color-red*
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-20 quad) vf6)
|
||||
)
|
||||
(let ((s0-1 draw-axis))
|
||||
(set! sv-256 s1-1)
|
||||
(let ((a1-22 (vector-negate! (new 'stack-no-clear 'vector) (-> this mat uvec)))
|
||||
(a2-21 (* 0.15 f30-1))
|
||||
(a3-11 (* 0.15 f30-1))
|
||||
(t0-11 (if (= (-> this action) (manipulator-action ma6))
|
||||
*color-yellow*
|
||||
*color-green*
|
||||
)
|
||||
)
|
||||
)
|
||||
(s0-1 sv-256 a1-22 a2-21 a3-11 t0-11)
|
||||
)
|
||||
)
|
||||
(let ((s0-2 draw-axis))
|
||||
(set! sv-272 s1-1)
|
||||
(let ((a1-24 (vector-negate! (new 'stack-no-clear 'vector) (-> this mat fvec)))
|
||||
(a2-22 (* 0.15 f30-1))
|
||||
(a3-12 (* 0.15 f30-1))
|
||||
(t0-12 (if (= (-> this action) (manipulator-action ma6))
|
||||
*color-yellow*
|
||||
*color-blue*
|
||||
)
|
||||
)
|
||||
)
|
||||
(s0-2 sv-272 a1-24 a2-22 a3-12 t0-12)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! s2-0 (and s4-0 s2-0))
|
||||
(when s2-0
|
||||
(let ((a1-25 s1-1))
|
||||
(let ((v1-44 s5-0))
|
||||
(let ((a0-37 (vector+! (new 'stack-no-clear 'vector) (-> this mat rvec) (-> this mat fvec))))
|
||||
(let ((a2-24 f30-1))
|
||||
(.mov vf7 a2-24)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-37 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-44 quad))
|
||||
(draw-axis
|
||||
s1-1
|
||||
(vector-negate! (new 'stack-no-clear 'vector) (-> this mat fvec))
|
||||
(* 0.15 f30-1)
|
||||
(* 0.15 f30-1)
|
||||
(if (= (-> this action) (manipulator-action ma5))
|
||||
*color-yellow*
|
||||
*color-blue*
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-25 quad) vf6)
|
||||
)
|
||||
(draw-axis
|
||||
s1-1
|
||||
(vector-negate! (new 'stack-no-clear 'vector) (-> this mat rvec))
|
||||
(* 0.15 f30-1)
|
||||
(* 0.15 f30-1)
|
||||
(if (= (-> this action) (manipulator-action ma5))
|
||||
*color-yellow*
|
||||
*color-red*
|
||||
)
|
||||
)
|
||||
(draw-axis
|
||||
s1-1
|
||||
(vector-negate! (new 'stack-no-clear 'vector) (-> this mat fvec))
|
||||
(* 0.15 f30-1)
|
||||
(* 0.15 f30-1)
|
||||
(if (= (-> this action) (manipulator-action ma5))
|
||||
*color-yellow*
|
||||
*color-blue*
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! s3-0 (and s4-0 s3-0))
|
||||
(when s3-0
|
||||
(let ((a0-44 s1-1))
|
||||
(let ((v1-52 (vector+! (new 'stack-no-clear 'vector) (-> this mat rvec) (-> this mat uvec))))
|
||||
(let ((a1-31 f30-1))
|
||||
(.mov vf7 a1-31)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-52 quad))
|
||||
)
|
||||
(set! s3-0 (and s4-0 s3-0))
|
||||
(when s3-0
|
||||
(vector+*! s1-1 s5-0 (vector+! (new 'stack-no-clear 'vector) (-> this mat rvec) (-> this mat uvec)) f30-1)
|
||||
(draw-axis
|
||||
s1-1
|
||||
(vector-negate! (new 'stack-no-clear 'vector) (-> this mat rvec))
|
||||
(* 0.15 f30-1)
|
||||
(* 0.15 f30-1)
|
||||
(if (= (-> this action) (manipulator-action ma4))
|
||||
*color-yellow*
|
||||
*color-red*
|
||||
)
|
||||
)
|
||||
(draw-axis
|
||||
s1-1
|
||||
(vector-negate! (new 'stack-no-clear 'vector) (-> this mat uvec))
|
||||
(* 0.15 f30-1)
|
||||
(* 0.15 f30-1)
|
||||
(if (= (-> this action) (manipulator-action ma4))
|
||||
*color-yellow*
|
||||
*color-green*
|
||||
)
|
||||
(.lvf vf4 (&-> s5-0 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-44 quad) vf6)
|
||||
)
|
||||
(draw-axis
|
||||
s1-1
|
||||
(vector-negate! (new 'stack-no-clear 'vector) (-> this mat rvec))
|
||||
(* 0.15 f30-1)
|
||||
(* 0.15 f30-1)
|
||||
(if (= (-> this action) (manipulator-action ma4))
|
||||
*color-yellow*
|
||||
*color-red*
|
||||
)
|
||||
)
|
||||
(draw-axis
|
||||
s1-1
|
||||
(vector-negate! (new 'stack-no-clear 'vector) (-> this mat uvec))
|
||||
(* 0.15 f30-1)
|
||||
(* 0.15 f30-1)
|
||||
(if (= (-> this action) (manipulator-action ma4))
|
||||
*color-yellow*
|
||||
*color-green*
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod manipulator-method-12 ((this manipulator) (arg0 vector))
|
||||
@@ -468,200 +339,137 @@
|
||||
)
|
||||
|
||||
(defmethod manipulator-method-13 ((this manipulator) (arg0 vector) (arg1 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(cond
|
||||
((= (-> this mode) (manipulator-mode mm0))
|
||||
(vector-copy! (-> this speed) (-> this position))
|
||||
(let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))
|
||||
(s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this mouse-ref-position) arg0))
|
||||
)
|
||||
0.0
|
||||
0.0
|
||||
(let ((s2-0 (new 'stack-no-clear 'vector))
|
||||
(s1-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(cond
|
||||
((or (= (-> this action) (manipulator-action ma1))
|
||||
(= (-> this action) (manipulator-action ma2))
|
||||
(= (-> this action) (manipulator-action ma3))
|
||||
)
|
||||
(cond
|
||||
((= (-> this action) (manipulator-action ma1))
|
||||
(cond
|
||||
((< (fabs (vector-dot s5-1 (-> this mat uvec))) (fabs (vector-dot s5-1 (-> this mat fvec))))
|
||||
(vector-copy! s2-0 (-> this mat fvec))
|
||||
(vector-copy! s1-0 (-> this mat uvec))
|
||||
)
|
||||
(else
|
||||
(vector-copy! s2-0 (-> this mat uvec))
|
||||
(vector-copy! s1-0 (-> this mat fvec))
|
||||
)
|
||||
)
|
||||
)
|
||||
((= (-> this action) (manipulator-action ma2))
|
||||
(cond
|
||||
((< (fabs (vector-dot s5-1 (-> this mat rvec))) (fabs (vector-dot s5-1 (-> this mat fvec))))
|
||||
(vector-copy! s2-0 (-> this mat fvec))
|
||||
(vector-copy! s1-0 (-> this mat rvec))
|
||||
)
|
||||
(else
|
||||
(vector-copy! s2-0 (-> this mat rvec))
|
||||
(vector-copy! s1-0 (-> this mat fvec))
|
||||
)
|
||||
)
|
||||
)
|
||||
((= (-> this action) (manipulator-action ma3))
|
||||
(cond
|
||||
((< (fabs (vector-dot s5-1 (-> this mat uvec))) (fabs (vector-dot s5-1 (-> this mat rvec))))
|
||||
(vector-copy! s2-0 (-> this mat rvec))
|
||||
(vector-copy! s1-0 (-> this mat uvec))
|
||||
)
|
||||
(else
|
||||
(vector-copy! s2-0 (-> this mat uvec))
|
||||
(vector-copy! s1-0 (-> this mat rvec))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((f30-0 (intersect-ray-plane arg0 s5-1 (-> this position) s2-0))
|
||||
(f0-11 (intersect-ray-plane arg0 s4-1 (-> this position) s2-0))
|
||||
)
|
||||
(let ((a1-3 s5-1))
|
||||
(let ((v1-41 arg0))
|
||||
(let ((a0-43 s5-1))
|
||||
(let ((a2-3 f30-0))
|
||||
(.mov vf7 a2-3)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-43 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-41 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-3 quad) vf6)
|
||||
)
|
||||
(let ((a0-44 s4-1))
|
||||
(let ((v1-42 s4-1))
|
||||
(let ((a1-4 f0-11))
|
||||
(.mov vf7 a1-4)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-42 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> arg0 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-44 quad) vf6)
|
||||
)
|
||||
)
|
||||
(vector-flatten! s5-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> this position)) s1-0)
|
||||
(vector-flatten! s4-1 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> this position)) s1-0)
|
||||
(let ((v1-46 (vector-! (new 'stack-no-clear 'vector) s5-1 s4-1)))
|
||||
(vector+! (-> this position) (-> this drag-ref-position) v1-46)
|
||||
(format *stdcon* "delta ~M ~M ~M~%" (-> v1-46 x) (-> v1-46 y) (-> v1-46 z))
|
||||
)
|
||||
)
|
||||
((or (= (-> this action) (manipulator-action ma4))
|
||||
(= (-> this action) (manipulator-action ma5))
|
||||
(= (-> this action) (manipulator-action ma6))
|
||||
(= (-> this action) (manipulator-action ma7))
|
||||
)
|
||||
(cond
|
||||
((= (-> this action) (manipulator-action ma4))
|
||||
(vector-copy! s2-0 *z-vector*)
|
||||
)
|
||||
((= (-> this action) (manipulator-action ma5))
|
||||
(vector-copy! s2-0 *y-vector*)
|
||||
)
|
||||
((= (-> this action) (manipulator-action ma6))
|
||||
(vector-copy! s2-0 *x-vector*)
|
||||
)
|
||||
((= (-> this action) (manipulator-action ma7))
|
||||
(vector-copy! s2-0 (-> *math-camera* inv-camera-rot fvec))
|
||||
)
|
||||
)
|
||||
(vector-normalize! s2-0 1.0)
|
||||
(let ((f30-1 (intersect-ray-plane arg0 s5-1 (-> this position) s2-0))
|
||||
(f0-15 (intersect-ray-plane arg0 s4-1 (-> this position) s2-0))
|
||||
)
|
||||
(let ((a1-14 s5-1))
|
||||
(let ((v1-69 arg0))
|
||||
(let ((a0-69 s5-1))
|
||||
(let ((a2-13 f30-1))
|
||||
(.mov vf7 a2-13)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-69 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-69 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-14 quad) vf6)
|
||||
)
|
||||
(let ((v1-70 s4-1))
|
||||
(let ((a0-70 arg0))
|
||||
(let ((a1-15 s4-1))
|
||||
(let ((a2-14 f0-15))
|
||||
(.mov vf7 a2-14)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-15 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-70 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-70 quad) vf6)
|
||||
)
|
||||
)
|
||||
(vector+! (-> this position) (-> this drag-ref-position) (vector-! (new 'stack-no-clear 'vector) s5-1 s4-1))
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((= (-> this mode) (manipulator-mode mm0))
|
||||
(vector-copy! (-> this speed) (-> this position))
|
||||
(let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))
|
||||
(s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this mouse-ref-position) arg0))
|
||||
)
|
||||
)
|
||||
(vector-! (-> this speed) (-> this position) (-> this speed))
|
||||
)
|
||||
((= (-> this mode) (manipulator-mode mm1))
|
||||
(let ((s4-2 (- (-> this rotate-ref) (the int (-> *mouse* posx))))
|
||||
(s5-2 (new 'stack-no-clear 'matrix))
|
||||
0.0
|
||||
0.0
|
||||
(let ((s2-0 (new 'stack-no-clear 'vector))
|
||||
(s1-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(new 'stack 'euler-angles)
|
||||
(matrix-identity! s5-2)
|
||||
(cond
|
||||
((= (-> this action) (manipulator-action ma1))
|
||||
(matrix-axis-angle! s5-2 (-> this mat rvec) (* 182.04445 (the float s4-2)))
|
||||
((or (= (-> this action) (manipulator-action ma1))
|
||||
(= (-> this action) (manipulator-action ma2))
|
||||
(= (-> this action) (manipulator-action ma3))
|
||||
)
|
||||
(cond
|
||||
((= (-> this action) (manipulator-action ma1))
|
||||
(cond
|
||||
((< (fabs (vector-dot s5-1 (-> this mat uvec))) (fabs (vector-dot s5-1 (-> this mat fvec))))
|
||||
(vector-copy! s2-0 (-> this mat fvec))
|
||||
(vector-copy! s1-0 (-> this mat uvec))
|
||||
)
|
||||
(else
|
||||
(vector-copy! s2-0 (-> this mat uvec))
|
||||
(vector-copy! s1-0 (-> this mat fvec))
|
||||
)
|
||||
)
|
||||
)
|
||||
((= (-> this action) (manipulator-action ma2))
|
||||
(cond
|
||||
((< (fabs (vector-dot s5-1 (-> this mat rvec))) (fabs (vector-dot s5-1 (-> this mat fvec))))
|
||||
(vector-copy! s2-0 (-> this mat fvec))
|
||||
(vector-copy! s1-0 (-> this mat rvec))
|
||||
)
|
||||
(else
|
||||
(vector-copy! s2-0 (-> this mat rvec))
|
||||
(vector-copy! s1-0 (-> this mat fvec))
|
||||
)
|
||||
)
|
||||
)
|
||||
((= (-> this action) (manipulator-action ma3))
|
||||
(cond
|
||||
((< (fabs (vector-dot s5-1 (-> this mat uvec))) (fabs (vector-dot s5-1 (-> this mat rvec))))
|
||||
(vector-copy! s2-0 (-> this mat rvec))
|
||||
(vector-copy! s1-0 (-> this mat uvec))
|
||||
)
|
||||
(else
|
||||
(vector-copy! s2-0 (-> this mat uvec))
|
||||
(vector-copy! s1-0 (-> this mat rvec))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((f30-0 (intersect-ray-plane arg0 s5-1 (-> this position) s2-0))
|
||||
(f0-11 (intersect-ray-plane arg0 s4-1 (-> this position) s2-0))
|
||||
)
|
||||
(vector+*! s5-1 arg0 s5-1 f30-0)
|
||||
(vector+*! s4-1 arg0 s4-1 f0-11)
|
||||
)
|
||||
(vector-flatten! s5-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> this position)) s1-0)
|
||||
(vector-flatten! s4-1 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> this position)) s1-0)
|
||||
(let ((v1-46 (vector-! (new 'stack-no-clear 'vector) s5-1 s4-1)))
|
||||
(vector+! (-> this position) (-> this drag-ref-position) v1-46)
|
||||
(format *stdcon* "delta ~M ~M ~M~%" (-> v1-46 x) (-> v1-46 y) (-> v1-46 z))
|
||||
)
|
||||
)
|
||||
((= (-> this action) (manipulator-action ma2))
|
||||
(matrix-axis-angle! s5-2 (-> this mat uvec) (* 182.04445 (the float s4-2)))
|
||||
)
|
||||
((= (-> this action) (manipulator-action ma3))
|
||||
(matrix-axis-angle! s5-2 (-> this mat fvec) (* 182.04445 (the float s4-2)))
|
||||
((or (= (-> this action) (manipulator-action ma4))
|
||||
(= (-> this action) (manipulator-action ma5))
|
||||
(= (-> this action) (manipulator-action ma6))
|
||||
(= (-> this action) (manipulator-action ma7))
|
||||
)
|
||||
(cond
|
||||
((= (-> this action) (manipulator-action ma4))
|
||||
(vector-copy! s2-0 *z-vector*)
|
||||
)
|
||||
((= (-> this action) (manipulator-action ma5))
|
||||
(vector-copy! s2-0 *y-vector*)
|
||||
)
|
||||
((= (-> this action) (manipulator-action ma6))
|
||||
(vector-copy! s2-0 *x-vector*)
|
||||
)
|
||||
((= (-> this action) (manipulator-action ma7))
|
||||
(vector-copy! s2-0 (-> *math-camera* inv-camera-rot fvec))
|
||||
)
|
||||
)
|
||||
(vector-normalize! s2-0 1.0)
|
||||
(let ((f30-1 (intersect-ray-plane arg0 s5-1 (-> this position) s2-0))
|
||||
(f0-15 (intersect-ray-plane arg0 s4-1 (-> this position) s2-0))
|
||||
)
|
||||
(vector+*! s5-1 arg0 s5-1 f30-1)
|
||||
(vector+*! s4-1 arg0 s4-1 f0-15)
|
||||
)
|
||||
(vector+! (-> this position) (-> this drag-ref-position) (vector-! (new 'stack-no-clear 'vector) s5-1 s4-1))
|
||||
)
|
||||
)
|
||||
(matrix*! (-> this mat) (-> this mat) s5-2)
|
||||
)
|
||||
(vector-normalize! (-> this mat rvec) 1.0)
|
||||
(vector-normalize! (-> this mat uvec) 1.0)
|
||||
(vector-normalize! (-> this mat fvec) 1.0)
|
||||
(matrix->eul (-> this angles) (-> this mat) 21)
|
||||
(format *stdcon* "X = ~R~%Y = ~R~%Z = ~R~%" (-> this angles x) (-> this angles y) (-> this angles z))
|
||||
(set! (-> this rotate-ref) (the int (-> *mouse* posx)))
|
||||
)
|
||||
(else
|
||||
)
|
||||
(vector-! (-> this speed) (-> this position) (-> this speed))
|
||||
)
|
||||
((= (-> this mode) (manipulator-mode mm1))
|
||||
(let ((s4-2 (- (-> this rotate-ref) (the int (-> *mouse* posx))))
|
||||
(s5-2 (new 'stack-no-clear 'matrix))
|
||||
)
|
||||
(new 'stack 'euler-angles)
|
||||
(matrix-identity! s5-2)
|
||||
(cond
|
||||
((= (-> this action) (manipulator-action ma1))
|
||||
(matrix-axis-angle! s5-2 (-> this mat rvec) (* 182.04445 (the float s4-2)))
|
||||
)
|
||||
((= (-> this action) (manipulator-action ma2))
|
||||
(matrix-axis-angle! s5-2 (-> this mat uvec) (* 182.04445 (the float s4-2)))
|
||||
)
|
||||
((= (-> this action) (manipulator-action ma3))
|
||||
(matrix-axis-angle! s5-2 (-> this mat fvec) (* 182.04445 (the float s4-2)))
|
||||
)
|
||||
)
|
||||
(matrix*! (-> this mat) (-> this mat) s5-2)
|
||||
)
|
||||
(vector-normalize! (-> this mat rvec) 1.0)
|
||||
(vector-normalize! (-> this mat uvec) 1.0)
|
||||
(vector-normalize! (-> this mat fvec) 1.0)
|
||||
(matrix->eul (-> this angles) (-> this mat) 21)
|
||||
(format *stdcon* "X = ~R~%Y = ~R~%Z = ~R~%" (-> this angles x) (-> this angles y) (-> this angles z))
|
||||
(set! (-> this rotate-ref) (the int (-> *mouse* posx)))
|
||||
)
|
||||
(else
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod manipulator-method-14 ((this manipulator))
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
:frame-num 0.0
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align!
|
||||
(-> self align)
|
||||
(align-opts adjust-x-vel adjust-y-vel adjust-xz-vel keep-other-velocities adjust-quat)
|
||||
|
||||
@@ -978,26 +978,26 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defun vector-rotate-around-axis! ((arg0 vector) (arg1 quaternion) (arg2 float) (arg3 vector))
|
||||
(defun vector-rotate-around-axis! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 vector))
|
||||
"Rotate along y so z-axis points to match another. Use arg3 as the max rotation amount."
|
||||
(let ((a2-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) arg3 arg2)))
|
||||
(vector-orient-by-quat! arg0 (-> arg1 vec) a2-1)
|
||||
(vector-orient-by-quat! arg0 arg1 a2-1)
|
||||
)
|
||||
)
|
||||
|
||||
(defun vector-rotate-x! ((arg0 vector) (arg1 vector) (arg2 float))
|
||||
"Rotate vector along x axis."
|
||||
(vector-rotate-around-axis! arg0 (the-as quaternion arg1) arg2 *x-vector*)
|
||||
(vector-rotate-around-axis! arg0 arg1 arg2 *x-vector*)
|
||||
)
|
||||
|
||||
(defun vector-rotate-y! ((arg0 vector) (arg1 vector) (arg2 float))
|
||||
"Rotate vector along y axis."
|
||||
(vector-rotate-around-axis! arg0 (the-as quaternion arg1) arg2 *y-vector*)
|
||||
(vector-rotate-around-axis! arg0 arg1 arg2 *y-vector*)
|
||||
)
|
||||
|
||||
(defun vector-rotate-z! ((arg0 vector) (arg1 vector) (arg2 float))
|
||||
"Rotate vector along z axis."
|
||||
(vector-rotate-around-axis! arg0 (the-as quaternion arg1) arg2 *z-vector*)
|
||||
(vector-rotate-around-axis! arg0 arg1 arg2 *z-vector*)
|
||||
)
|
||||
|
||||
(defun vector-y-angle ((arg0 vector))
|
||||
|
||||
@@ -1640,33 +1640,19 @@
|
||||
)
|
||||
|
||||
(defun rand-vu-sphere-point-uniform! ((arg0 vector) (arg1 float))
|
||||
(local-vars (v1-3 float) (f0-5 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
666.6
|
||||
(until (>= 1.0 f0-5)
|
||||
(set-vector!
|
||||
arg0
|
||||
(rand-vu-float-range -1.0 1.0)
|
||||
(rand-vu-float-range -1.0 1.0)
|
||||
(rand-vu-float-range -1.0 1.0)
|
||||
1.0
|
||||
)
|
||||
(.lvf vf1 (&-> arg0 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-3 vf1)
|
||||
(set! f0-5 v1-3)
|
||||
(local-vars (f0-5 float))
|
||||
666.6
|
||||
(until (>= 1.0 f0-5)
|
||||
(set-vector!
|
||||
arg0
|
||||
(rand-vu-float-range -1.0 1.0)
|
||||
(rand-vu-float-range -1.0 1.0)
|
||||
(rand-vu-float-range -1.0 1.0)
|
||||
1.0
|
||||
)
|
||||
(vector-float*! arg0 arg0 arg1)
|
||||
(set! f0-5 (vector-length-squared arg0))
|
||||
)
|
||||
(vector-float*! arg0 arg0 arg1)
|
||||
)
|
||||
|
||||
(defmethod print ((this vector2))
|
||||
|
||||
@@ -500,10 +500,6 @@
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
(vf3 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((t1-0 (new 'stack-no-clear 'vector))
|
||||
@@ -550,33 +546,8 @@
|
||||
(a0-9 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-float*! a0-9 t0-0 f1-3)
|
||||
(let ((t0-1 arg2))
|
||||
(let ((a1-3 a0-9))
|
||||
(let ((a2-1 v1-0))
|
||||
(let ((t1-1 f0-7))
|
||||
(.mov vf7 t1-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a2-1 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a1-3 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> t0-1 quad) vf6)
|
||||
)
|
||||
(let ((v0-0 arg3))
|
||||
(let ((a1-4 (- f0-7)))
|
||||
(.mov vf7 a1-4)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-0 quad))
|
||||
(.lvf vf4 (&-> a0-9 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v0-0 quad) vf6)
|
||||
v0-0
|
||||
)
|
||||
(vector+*! arg2 a0-9 v1-0 f0-7)
|
||||
(vector+*! arg3 a0-9 v1-0 (- f0-7))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -2155,192 +2126,172 @@
|
||||
)
|
||||
|
||||
(defmethod navigate-using-route-portals ((this nav-state))
|
||||
(local-vars
|
||||
(v1-117 float)
|
||||
(sv-112 vector)
|
||||
(sv-116 nav-route-portal)
|
||||
(sv-120 (inline-array vector))
|
||||
(sv-124 symbol)
|
||||
(local-vars (sv-112 vector) (sv-116 nav-route-portal) (sv-120 (inline-array vector)) (sv-124 symbol))
|
||||
(set! (-> this virtual-current-poly) (-> this current-poly))
|
||||
(set! sv-112 (new 'stack-no-clear 'vector))
|
||||
(set! sv-116 (new 'stack-no-clear 'nav-route-portal))
|
||||
(set! sv-120 (new 'stack-no-clear 'inline-array 'vector 2))
|
||||
(set! sv-124 (the-as symbol #f))
|
||||
(vector-! (-> this current-pos-local) (-> this current-pos) (the-as vector (-> this mesh bounds)))
|
||||
(vector-copy! (-> this virtual-current-pos-local) (-> this current-pos-local))
|
||||
(set! (-> sv-116 next-poly) #f)
|
||||
(when (not (logtest? (-> this flags) (nav-state-flag directional-mode)))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((s4-0 (new 'stack-no-clear 'nav-poly)))
|
||||
(vector-! s5-0 (-> this target-pos) (the-as vector (-> this mesh bounds)))
|
||||
(when (or (logtest? (-> this flags) (nav-state-flag target-poly-dirty)) (not (-> this target-poly)))
|
||||
(set! (-> s4-0 vertex 0 quad) (-> s5-0 quad))
|
||||
(set! (-> s4-0 vertex1 x) (-> this nav nearest-y-threshold))
|
||||
(set! (-> s4-0 data 20) (the-as uint 3))
|
||||
(nav-mesh-method-46 (-> this mesh) s4-0)
|
||||
(set! (-> this target-poly) (the-as nav-poly (-> s4-0 vertex1 z)))
|
||||
(if (not (-> this target-poly))
|
||||
(set! (-> this target-poly) (-> this current-poly))
|
||||
)
|
||||
(logclear! (-> this flags) (nav-state-flag target-poly-dirty))
|
||||
)
|
||||
)
|
||||
(project-point-into-poly-2d (-> this mesh) (-> this target-poly) sv-112 s5-0)
|
||||
)
|
||||
(set! (-> sv-112 y) (-> this current-pos-local y))
|
||||
(vector-! (-> this travel) sv-112 (-> this current-pos-local))
|
||||
(set! (-> this travel y) 0.0)
|
||||
(let* ((v1-32 (-> this travel))
|
||||
(f0-6 (+ (* (-> v1-32 x) (-> v1-32 x)) (* (-> v1-32 z) (-> v1-32 z))))
|
||||
(f1-3 4096.0)
|
||||
)
|
||||
(if (< f0-6 (* f1-3 f1-3))
|
||||
(logior! (-> this flags) (nav-state-flag at-target))
|
||||
)
|
||||
)
|
||||
(get-route-portal (-> this mesh) (-> this current-poly) (-> this target-poly) sv-116)
|
||||
)
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(set! (-> this virtual-current-poly) (-> this current-poly))
|
||||
(set! sv-112 (new 'stack-no-clear 'vector))
|
||||
(set! sv-116 (new 'stack-no-clear 'nav-route-portal))
|
||||
(set! sv-120 (new 'stack-no-clear 'inline-array 'vector 2))
|
||||
(set! sv-124 (the-as symbol #f))
|
||||
(vector-! (-> this current-pos-local) (-> this current-pos) (the-as vector (-> this mesh bounds)))
|
||||
(vector-copy! (-> this virtual-current-pos-local) (-> this current-pos-local))
|
||||
(set! (-> sv-116 next-poly) #f)
|
||||
(when (not (logtest? (-> this flags) (nav-state-flag directional-mode)))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((s4-0 (new 'stack-no-clear 'nav-poly)))
|
||||
(vector-! s5-0 (-> this target-pos) (the-as vector (-> this mesh bounds)))
|
||||
(when (or (logtest? (-> this flags) (nav-state-flag target-poly-dirty)) (not (-> this target-poly)))
|
||||
(set! (-> s4-0 vertex 0 quad) (-> s5-0 quad))
|
||||
(set! (-> s4-0 vertex1 x) (-> this nav nearest-y-threshold))
|
||||
(set! (-> s4-0 data 20) (the-as uint 3))
|
||||
(nav-mesh-method-46 (-> this mesh) s4-0)
|
||||
(set! (-> this target-poly) (the-as nav-poly (-> s4-0 vertex1 z)))
|
||||
(if (not (-> this target-poly))
|
||||
(set! (-> this target-poly) (-> this current-poly))
|
||||
)
|
||||
(logclear! (-> this flags) (nav-state-flag target-poly-dirty))
|
||||
(cond
|
||||
((not (-> sv-116 next-poly))
|
||||
(set! (-> this next-poly) #f)
|
||||
)
|
||||
(else
|
||||
(set! (-> this next-poly) (-> sv-116 next-poly))
|
||||
(vector-copy! (-> sv-120 0) (-> sv-116 vertex 0))
|
||||
(vector-copy! (-> sv-120 1) (-> sv-116 vertex 1))
|
||||
(set! sv-124 #t)
|
||||
(while (and sv-124 (-> sv-116 next-poly) (test-xz-point-on-line-segment?
|
||||
(-> this current-pos-local)
|
||||
(the-as vector (-> sv-116 vertex))
|
||||
(-> sv-116 vertex 1)
|
||||
409.59998
|
||||
)
|
||||
)
|
||||
(when #t
|
||||
#t
|
||||
(vector-segment-distance-point!
|
||||
(-> this current-pos-local)
|
||||
(the-as vector (-> sv-116 vertex))
|
||||
(-> sv-116 vertex 1)
|
||||
(-> this virtual-current-pos-local)
|
||||
)
|
||||
(vector-! (-> this travel) sv-112 (-> this virtual-current-pos-local))
|
||||
(set! (-> this travel y) 0.0)
|
||||
0
|
||||
)
|
||||
(project-point-into-poly-2d (-> this mesh) (-> this target-poly) sv-112 s5-0)
|
||||
)
|
||||
(set! (-> sv-112 y) (-> this current-pos-local y))
|
||||
(vector-! (-> this travel) sv-112 (-> this current-pos-local))
|
||||
(set! (-> this travel y) 0.0)
|
||||
(let* ((v1-32 (-> this travel))
|
||||
(f0-6 (+ (* (-> v1-32 x) (-> v1-32 x)) (* (-> v1-32 z) (-> v1-32 z))))
|
||||
(f1-3 4096.0)
|
||||
)
|
||||
(if (< f0-6 (* f1-3 f1-3))
|
||||
(logior! (-> this flags) (nav-state-flag at-target))
|
||||
)
|
||||
)
|
||||
(get-route-portal (-> this mesh) (-> this current-poly) (-> this target-poly) sv-116)
|
||||
)
|
||||
(cond
|
||||
((not (-> sv-116 next-poly))
|
||||
(set! (-> this next-poly) #f)
|
||||
)
|
||||
(else
|
||||
(set! (-> this next-poly) (-> sv-116 next-poly))
|
||||
(vector-copy! (-> sv-120 0) (-> sv-116 vertex 0))
|
||||
(vector-copy! (-> sv-120 1) (-> sv-116 vertex 1))
|
||||
(set! sv-124 #t)
|
||||
(while (and sv-124 (-> sv-116 next-poly) (test-xz-point-on-line-segment?
|
||||
(-> this current-pos-local)
|
||||
(the-as vector (-> sv-116 vertex))
|
||||
(-> sv-116 vertex 1)
|
||||
409.59998
|
||||
)
|
||||
)
|
||||
(when #t
|
||||
#t
|
||||
(vector-segment-distance-point!
|
||||
(-> this current-pos-local)
|
||||
(the-as vector (-> sv-116 vertex))
|
||||
(-> sv-116 vertex 1)
|
||||
(-> this virtual-current-pos-local)
|
||||
)
|
||||
(vector-! (-> this travel) sv-112 (-> this virtual-current-pos-local))
|
||||
(set! (-> this travel y) 0.0)
|
||||
0
|
||||
)
|
||||
(set! (-> this virtual-current-poly) (-> sv-116 next-poly))
|
||||
(cond
|
||||
((get-route-portal (-> this mesh) (-> sv-116 next-poly) (-> this target-poly) sv-116)
|
||||
(set! (-> this next-poly) (-> sv-116 next-poly))
|
||||
(vector-copy! (-> sv-120 0) (-> sv-116 vertex 0))
|
||||
(vector-copy! (-> sv-120 1) (-> sv-116 vertex 1))
|
||||
0
|
||||
)
|
||||
(else
|
||||
(set! (-> this next-poly) #f)
|
||||
(set! sv-124 (the-as symbol #f))
|
||||
)
|
||||
(set! (-> this virtual-current-poly) (-> sv-116 next-poly))
|
||||
(cond
|
||||
((get-route-portal (-> this mesh) (-> sv-116 next-poly) (-> this target-poly) sv-116)
|
||||
(set! (-> this next-poly) (-> sv-116 next-poly))
|
||||
(vector-copy! (-> sv-120 0) (-> sv-116 vertex 0))
|
||||
(vector-copy! (-> sv-120 1) (-> sv-116 vertex 1))
|
||||
0
|
||||
)
|
||||
(else
|
||||
(set! (-> this next-poly) #f)
|
||||
(set! sv-124 (the-as symbol #f))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when sv-124
|
||||
(let ((s5-1 (new 'stack-no-clear 'matrix)))
|
||||
(vector-! (-> s5-1 rvec) (-> sv-120 1) (-> sv-120 0))
|
||||
(vector-normalize! (-> s5-1 rvec) 409.6)
|
||||
(vector+! (-> sv-120 0) (-> sv-120 0) (-> s5-1 rvec))
|
||||
(vector-! (-> sv-120 1) (-> sv-120 1) (-> s5-1 rvec))
|
||||
)
|
||||
(when (not (ray-ccw-line-segment-intersection?
|
||||
(-> this virtual-current-pos-local)
|
||||
(-> this travel)
|
||||
(-> sv-120 0)
|
||||
(-> sv-120 1)
|
||||
)
|
||||
)
|
||||
(when sv-124
|
||||
(let ((s5-1 (new 'stack-no-clear 'matrix)))
|
||||
(vector-! (-> s5-1 rvec) (-> sv-120 1) (-> sv-120 0))
|
||||
(vector-normalize! (-> s5-1 rvec) 409.6)
|
||||
(vector+! (-> sv-120 0) (-> sv-120 0) (-> s5-1 rvec))
|
||||
(vector-! (-> sv-120 1) (-> sv-120 1) (-> s5-1 rvec))
|
||||
)
|
||||
(when (not (ray-ccw-line-segment-intersection?
|
||||
(-> this virtual-current-pos-local)
|
||||
(-> this travel)
|
||||
(-> sv-120 0)
|
||||
(-> sv-120 1)
|
||||
)
|
||||
(let ((s5-2 -1))
|
||||
(let* ((f0-8 (cos 8192.0))
|
||||
(f0-10 (* f0-8 f0-8))
|
||||
(v1-93 (new 'stack-no-clear 'vector))
|
||||
(a0-39 (-> this travel))
|
||||
(f1-9 (+ (* (-> a0-39 x) (-> a0-39 x)) (* (-> a0-39 z) (-> a0-39 z))))
|
||||
)
|
||||
(countdown (a0-41 2)
|
||||
(vector-! v1-93 (-> sv-120 a0-41) (-> this virtual-current-pos-local))
|
||||
(let ((f2-5 (vector-dot (-> this travel) v1-93)))
|
||||
(when (< 0.0 f2-5)
|
||||
(let* ((f2-7 (* f2-5 f2-5))
|
||||
(a1-26 v1-93)
|
||||
(f2-8 (/ f2-7 (* f1-9 (+ (* (-> a1-26 x) (-> a1-26 x)) (* (-> a1-26 z) (-> a1-26 z))))))
|
||||
)
|
||||
(when (< f0-10 f2-8)
|
||||
(set! f0-10 f2-8)
|
||||
(set! s5-2 a0-41)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (= s5-2 -1)
|
||||
(let ((f30-0 (the-as float #x7f800000))
|
||||
(s3-0 (new 'stack-no-clear 'nav-route-portal))
|
||||
(s4-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(get-route-portal (-> this mesh) (-> sv-116 next-poly) (-> this target-poly) s3-0)
|
||||
(cond
|
||||
((-> s3-0 next-poly)
|
||||
(vector+! s4-1 (the-as vector (-> s3-0 vertex)) (the-as vector (-> s3-0 vertex 1)))
|
||||
(vector-float*! s4-1 s4-1 0.5)
|
||||
)
|
||||
(else
|
||||
(vector-copy! s4-1 sv-112)
|
||||
)
|
||||
)
|
||||
(countdown (s3-1 2)
|
||||
(let* ((s2-0 (-> sv-120 s3-1))
|
||||
(f0-13 (+ (vector-vector-xz-distance-squared (-> this virtual-current-pos-local) s2-0)
|
||||
(vector-vector-xz-distance-squared s4-1 s2-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s5-2 -1))
|
||||
(let* ((f0-8 (cos 8192.0))
|
||||
(f0-10 (* f0-8 f0-8))
|
||||
(v1-93 (new 'stack-no-clear 'vector))
|
||||
(a0-39 (-> this travel))
|
||||
(f1-9 (+ (* (-> a0-39 x) (-> a0-39 x)) (* (-> a0-39 z) (-> a0-39 z))))
|
||||
)
|
||||
(countdown (a0-41 2)
|
||||
(vector-! v1-93 (-> sv-120 a0-41) (-> this virtual-current-pos-local))
|
||||
(let ((f2-5 (vector-dot (-> this travel) v1-93)))
|
||||
(when (< 0.0 f2-5)
|
||||
(let* ((f2-7 (* f2-5 f2-5))
|
||||
(a1-26 v1-93)
|
||||
(f2-8 (/ f2-7 (* f1-9 (+ (* (-> a1-26 x) (-> a1-26 x)) (* (-> a1-26 z) (-> a1-26 z))))))
|
||||
)
|
||||
(when (< f0-13 f30-0)
|
||||
(set! f30-0 f0-13)
|
||||
(set! s5-2 s3-1)
|
||||
(when (< f0-10 f2-8)
|
||||
(set! f0-10 f2-8)
|
||||
(set! s5-2 a0-41)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(vector-! (-> this travel) (-> sv-120 s5-2) (-> this virtual-current-pos-local))
|
||||
)
|
||||
(set! (-> this travel y) 0.0)
|
||||
(when (= s5-2 -1)
|
||||
(let ((f30-0 (the-as float #x7f800000))
|
||||
(s3-0 (new 'stack-no-clear 'nav-route-portal))
|
||||
(s4-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(get-route-portal (-> this mesh) (-> sv-116 next-poly) (-> this target-poly) s3-0)
|
||||
(cond
|
||||
((-> s3-0 next-poly)
|
||||
(vector+! s4-1 (the-as vector (-> s3-0 vertex)) (the-as vector (-> s3-0 vertex 1)))
|
||||
(vector-float*! s4-1 s4-1 0.5)
|
||||
)
|
||||
(else
|
||||
(vector-copy! s4-1 sv-112)
|
||||
)
|
||||
)
|
||||
(countdown (s3-1 2)
|
||||
(let* ((s2-0 (-> sv-120 s3-1))
|
||||
(f0-13 (+ (vector-vector-xz-distance-squared (-> this virtual-current-pos-local) s2-0)
|
||||
(vector-vector-xz-distance-squared s4-1 s2-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (< f0-13 f30-0)
|
||||
(set! f30-0 f0-13)
|
||||
(set! s5-2 s3-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(vector-! (-> this travel) (-> sv-120 s5-2) (-> this virtual-current-pos-local))
|
||||
)
|
||||
(set! (-> this travel y) 0.0)
|
||||
)
|
||||
(.lvf vf1 (&-> (-> this travel) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-117 vf1)
|
||||
(let ((f0-15 v1-117)
|
||||
(f1-10 (-> this nav nav-cull-radius))
|
||||
)
|
||||
(if (< (* f1-10 f1-10) f0-15)
|
||||
(vector-float*! (-> this travel) (-> this travel) (/ (-> this nav nav-cull-radius) (sqrtf f0-15)))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
(let ((f0-15 (vector-length-squared (-> this travel)))
|
||||
(f1-10 (-> this nav nav-cull-radius))
|
||||
)
|
||||
(if (< (* f1-10 f1-10) f0-15)
|
||||
(vector-float*! (-> this travel) (-> this travel) (/ (-> this nav nav-cull-radius) (sqrtf f0-15)))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod navigate-using-best-dir-use-existing-avoid-spheres ((this nav-state) (arg0 nav-avoid-spheres-params))
|
||||
@@ -3300,65 +3251,43 @@
|
||||
)
|
||||
|
||||
(defmethod update-travel-dir-from-spheres ((this nav-state))
|
||||
(local-vars (v1-11 float) (v1-25 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work)))
|
||||
(vector-reset! (-> s5-0 in-dir))
|
||||
(set! (-> s5-0 best-dir 0 quad) (-> this travel quad))
|
||||
(set! (-> s5-0 best-dir 0 y) 0.0)
|
||||
(vector-normalize! (-> s5-0 best-dir 0) (-> this nav target-speed))
|
||||
(vector-! (-> s5-0 right-dir) (-> s5-0 best-dir 0) (-> this velocity))
|
||||
(vector-float*! (-> s5-0 right-dir) (-> s5-0 right-dir) 4.0)
|
||||
(vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir))
|
||||
(dotimes (s4-0 (-> this nav sphere-count))
|
||||
(let ((s3-0 (-> this nav sphere-array s4-0)))
|
||||
(vector-! (-> s5-0 right-dir) (-> this current-pos-local) (the-as vector s3-0))
|
||||
(.lvf vf1 (&-> (-> s5-0 right-dir) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-11 vf1)
|
||||
(let ((f30-0 v1-11))
|
||||
(vector-normalize! (-> s5-0 right-dir) 2.0)
|
||||
(let* ((f0-4 (+ (-> this nav root-nav-sphere w) (-> s3-0 r)))
|
||||
(f1-1 (* f0-4 f0-4))
|
||||
(f0-7 (fmax 0.0 (/ (- f1-1 f30-0) f1-1)))
|
||||
)
|
||||
(vector-float*! (-> s5-0 right-dir) (-> s5-0 right-dir) (* 81920.0 f0-7))
|
||||
)
|
||||
(let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work)))
|
||||
(vector-reset! (-> s5-0 in-dir))
|
||||
(set! (-> s5-0 best-dir 0 quad) (-> this travel quad))
|
||||
(set! (-> s5-0 best-dir 0 y) 0.0)
|
||||
(vector-normalize! (-> s5-0 best-dir 0) (-> this nav target-speed))
|
||||
(vector-! (-> s5-0 right-dir) (-> s5-0 best-dir 0) (-> this velocity))
|
||||
(vector-float*! (-> s5-0 right-dir) (-> s5-0 right-dir) 4.0)
|
||||
(vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir))
|
||||
(dotimes (s4-0 (-> this nav sphere-count))
|
||||
(let ((s3-0 (-> this nav sphere-array s4-0)))
|
||||
(vector-! (-> s5-0 right-dir) (-> this current-pos-local) (the-as vector s3-0))
|
||||
(let ((f30-0 (vector-length-squared (-> s5-0 right-dir))))
|
||||
(vector-normalize! (-> s5-0 right-dir) 2.0)
|
||||
(let* ((f0-4 (+ (-> this nav root-nav-sphere w) (-> s3-0 r)))
|
||||
(f1-1 (* f0-4 f0-4))
|
||||
(f0-7 (fmax 0.0 (/ (- f1-1 f30-0) f1-1)))
|
||||
)
|
||||
(vector-float*! (-> s5-0 right-dir) (-> s5-0 right-dir) (* 81920.0 f0-7))
|
||||
)
|
||||
)
|
||||
(vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir))
|
||||
)
|
||||
(vector+! (-> this target-dir) (-> this target-dir) (-> s5-0 in-dir))
|
||||
(vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir))
|
||||
)
|
||||
(set! (-> this target-dir y) 0.0)
|
||||
(vector+float*! (-> this velocity) (-> this velocity) (-> this target-dir) (-> this nav sec-per-frame))
|
||||
(.lvf vf1 (&-> (-> this velocity) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-25 vf1)
|
||||
(let ((f0-11 v1-25)
|
||||
(f1-4 (-> this nav target-speed))
|
||||
)
|
||||
(if (< (* f1-4 f1-4) f0-11)
|
||||
(vector-float*! (-> this velocity) (-> this velocity) (/ (-> this nav target-speed) (sqrtf f0-11)))
|
||||
)
|
||||
)
|
||||
(vector-float*! (-> this travel) (-> this velocity) (-> this nav sec-per-frame))
|
||||
0
|
||||
(none)
|
||||
(vector+! (-> this target-dir) (-> this target-dir) (-> s5-0 in-dir))
|
||||
)
|
||||
(set! (-> this target-dir y) 0.0)
|
||||
(vector+float*! (-> this velocity) (-> this velocity) (-> this target-dir) (-> this nav sec-per-frame))
|
||||
(let ((f0-11 (vector-length-squared (-> this velocity)))
|
||||
(f1-4 (-> this nav target-speed))
|
||||
)
|
||||
(if (< (* f1-4 f1-4) f0-11)
|
||||
(vector-float*! (-> this velocity) (-> this velocity) (/ (-> this nav target-speed) (sqrtf f0-11)))
|
||||
)
|
||||
)
|
||||
(vector-float*! (-> this travel) (-> this velocity) (-> this nav sec-per-frame))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod compute-speed-simple ((this nav-state))
|
||||
|
||||
@@ -640,223 +640,172 @@
|
||||
;; WARN: Return type mismatch int vs object.
|
||||
(defmethod setup-enemy! ((this nav-enemy) (arg0 nav-enemy-info))
|
||||
(local-vars (sv-16 res-tag))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(when (coin-flip? this)
|
||||
(let ((a0-2 (-> this node-list data 2)))
|
||||
(set! (-> a0-2 param0) (the-as (function cspace transformq none) cspace<-parented-matrix-joint-flip-z!))
|
||||
(set! (-> a0-2 param1) #f)
|
||||
(set! (-> a0-2 param2) #f)
|
||||
)
|
||||
(logior! (-> this enemy-flags) (enemy-flag drawn-mirrored))
|
||||
(when (coin-flip? this)
|
||||
(let ((a0-2 (-> this node-list data 2)))
|
||||
(set! (-> a0-2 param0) (the-as (function cspace transformq none) cspace<-parented-matrix-joint-flip-z!))
|
||||
(set! (-> a0-2 param1) #f)
|
||||
(set! (-> a0-2 param2) #f)
|
||||
)
|
||||
(logior! (-> this mask) (process-mask enemy))
|
||||
(logior! (-> this mask) (process-mask actor-pause))
|
||||
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
|
||||
(set! (-> this nav-radius-backup) (-> this root nav-radius))
|
||||
(set-enemy-info! this arg0)
|
||||
(set! (-> this enemy-info callback-info) *default-nav-callback-info*)
|
||||
(set! (-> this ragdoll-proc) (the-as handle #f))
|
||||
(let ((a1-2 (-> this enemy-info idle-anim-script)))
|
||||
(if a1-2
|
||||
(init! (-> this idle-anim-player) a1-2)
|
||||
)
|
||||
)
|
||||
(if (-> this draw shadow)
|
||||
(set! (-> this draw shadow-ctrl) (new
|
||||
'process
|
||||
'shadow-control
|
||||
(-> this enemy-info shadow-min-y)
|
||||
(-> this enemy-info shadow-max-y)
|
||||
(-> this enemy-info shadow-locus-dist)
|
||||
(the-as vector #f)
|
||||
(shadow-flags shdf00 shdf04)
|
||||
245760.0
|
||||
)
|
||||
)
|
||||
(set! (-> this draw shadow-ctrl) *nav-enemy-dummy-shadow-control*)
|
||||
)
|
||||
(get-nav-control this (-> arg0 nav-mesh))
|
||||
(set! (-> this water-max-height) (-> this nav state mesh water-max-height))
|
||||
(let ((v1-32 this))
|
||||
(set! (-> v1-32 enemy-flags) (the-as enemy-flag (logclear (-> v1-32 enemy-flags) (enemy-flag ef37))))
|
||||
(set! (-> v1-32 nav callback-info) *null-nav-callback-info*)
|
||||
)
|
||||
0
|
||||
(let ((v1-35 this))
|
||||
(set! (-> v1-35 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-35 enemy-flags))))
|
||||
)
|
||||
0
|
||||
(logior! (-> this nav flags) (nav-control-flag display-marks limit-rotation-rate))
|
||||
(logior! (-> this nav flags) (nav-control-flag update-heading-from-facing))
|
||||
(set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag ef44) (-> this enemy-flags))))
|
||||
(let ((v1-46 (-> this nav)))
|
||||
(set! (-> v1-46 target-speed) 0.0)
|
||||
)
|
||||
0
|
||||
(let ((v1-48 (-> this nav)))
|
||||
(set! (-> v1-48 acceleration) (-> this enemy-info walk-acceleration))
|
||||
)
|
||||
0
|
||||
(let ((v1-50 (-> this nav)))
|
||||
(set! (-> v1-50 turning-acceleration) (-> this enemy-info walk-turning-acceleration))
|
||||
)
|
||||
0
|
||||
(let ((v1-52 (-> this nav)))
|
||||
(set! (-> v1-52 max-rotation-rate) (-> this enemy-info maximum-rotation-rate))
|
||||
)
|
||||
0
|
||||
(nav-enemy-method-175 this)
|
||||
(set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f))
|
||||
(when (and (zero? (-> this path curve num-cverts)) (-> this entity))
|
||||
(set! (-> this path curve num-cverts) 3)
|
||||
(set! (-> this path curve cverts) (-> (new 'process 'vector-array 3) data))
|
||||
(logclear! (-> this path flags) (path-control-flag not-found))
|
||||
(let ((v1-69 (-> this path curve cverts 0)))
|
||||
(let ((a0-33 (-> this entity trans)))
|
||||
(let ((a1-9 *x-vector*))
|
||||
(let ((a2-4 6144.0))
|
||||
(.mov vf7 a2-4)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-9 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-33 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-69 quad) vf6)
|
||||
)
|
||||
(let ((v1-72 (-> this path curve cverts 1)))
|
||||
(let ((a0-35 (-> this entity trans)))
|
||||
(let ((a1-10 *x-vector*))
|
||||
(let ((a2-6 -6144.0))
|
||||
(.mov vf7 a2-6)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-10 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-35 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-72 quad) vf6)
|
||||
)
|
||||
(let ((v1-75 (-> this path curve cverts 2)))
|
||||
(let ((a0-37 (-> this entity trans)))
|
||||
(let ((a1-11 *z-vector*))
|
||||
(let ((a2-8 6144.0))
|
||||
(.mov vf7 a2-8)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-11 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-37 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-75 quad) vf6)
|
||||
)
|
||||
)
|
||||
(if (and (nonzero? (-> this path)) (nonzero? (-> this path curve num-cverts)))
|
||||
(logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text))
|
||||
)
|
||||
(if (logtest? (-> *game-info* secrets) (game-secrets hero-mode))
|
||||
(set! (-> this hit-points) (* 2.0 (-> this enemy-info default-hit-points)))
|
||||
(set! (-> this hit-points) (-> this enemy-info default-hit-points))
|
||||
)
|
||||
(let* ((v1-91 *game-info*)
|
||||
(a0-42 (+ (-> v1-91 attack-id) 1))
|
||||
)
|
||||
(set! (-> v1-91 attack-id) a0-42)
|
||||
(set! (-> this attack-id) a0-42)
|
||||
)
|
||||
(let* ((v1-92 *game-info*)
|
||||
(a0-44 (+ (-> v1-92 attack-id) 1))
|
||||
)
|
||||
(set! (-> v1-92 attack-id) a0-44)
|
||||
(set! (-> this persistent-attack-id) a0-44)
|
||||
)
|
||||
(set! (-> this gnd-collide-with) (-> this enemy-info gnd-collide-with))
|
||||
(set! (-> this fact) (new 'process 'fact-info-enemy this (the-as (pointer float) (-> arg0 fact-defaults))))
|
||||
(let ((cspec (if (logtest? (enemy-option multi-focus) (-> this fact enemy-options))
|
||||
(the-as collide-spec (collide-spec jak bot player-list jak-vehicle))
|
||||
(the-as collide-spec (collide-spec jak player-list jak-vehicle))
|
||||
)
|
||||
)
|
||||
)
|
||||
(reset-to-collide-spec (-> this focus) (the-as collide-spec cspec))
|
||||
)
|
||||
(set! sv-16 (new 'static 'res-tag))
|
||||
(let ((v1-101 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16))))
|
||||
(cond
|
||||
((and v1-101 (nonzero? (-> sv-16 elt-count)))
|
||||
(set! (-> this actor-group) (the-as (pointer actor-group) v1-101))
|
||||
(set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count)))
|
||||
)
|
||||
(else
|
||||
(set! (-> this actor-group) (the-as (pointer actor-group) #f))
|
||||
(set! (-> this actor-group-count) 0)
|
||||
0
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice pair))
|
||||
(set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active pair))
|
||||
(set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile pair))
|
||||
(set! (-> this on-death) (res-lump-struct (-> this entity) 'on-death pair))
|
||||
(if (-> this on-notice)
|
||||
(logior! (-> this enemy-flags) (enemy-flag enable-on-notice))
|
||||
)
|
||||
(if (-> this on-active)
|
||||
(logior! (-> this enemy-flags) (enemy-flag enable-on-active))
|
||||
)
|
||||
(if (-> this on-hostile)
|
||||
(logior! (-> this enemy-flags) (enemy-flag enable-on-hostile))
|
||||
)
|
||||
(set! (-> this incoming attacker-handle) (the-as handle #f))
|
||||
(let ((s4-0 (-> this root)))
|
||||
(set! (-> this penetrated-by-all) (-> this root penetrated-by))
|
||||
(set! (-> this root penetrated-by) (get-penetrated-by this))
|
||||
(set! (-> s4-0 event-self) 'touched)
|
||||
)
|
||||
(set! (-> this penetrate-flinch) (-> arg0 penetrate-flinch))
|
||||
(set! (-> this penetrate-knocked) (-> arg0 penetrate-knocked))
|
||||
(set! (-> this reaction-time) (rnd-time-frame this (seconds 0.1) (seconds 0.8)))
|
||||
(let* ((v1-132 (-> this enemy-flags))
|
||||
(a0-61 (-> this fact enemy-options))
|
||||
(v1-133
|
||||
(logior (enemy-flag vulnerable vulnerable-backup use-notice-distance attackable-backup trackable trackable-backup)
|
||||
v1-132
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (logtest? (enemy-option multi-focus) a0-61)
|
||||
(set! v1-133 (logior (enemy-flag multi-focus) v1-133))
|
||||
)
|
||||
(if (logtest? (enemy-option has-trigger) a0-61)
|
||||
(set! v1-133 (logior (enemy-flag use-trigger) v1-133))
|
||||
)
|
||||
(set! (-> this enemy-flags) v1-133)
|
||||
)
|
||||
(do-navigation-to-destination (-> this nav state) (-> this root trans))
|
||||
(if (and (should-move-to-ground? this)
|
||||
(not (logtest? (enemy-flag no-initial-move-to-ground) (-> this enemy-flags)))
|
||||
(not (logtest? (enemy-option ambush) (-> this fact enemy-options)))
|
||||
)
|
||||
(move-to-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with))
|
||||
)
|
||||
(if (zero? (-> this draw light-index))
|
||||
(set! (-> this draw light-index) (the-as uint 10))
|
||||
)
|
||||
0
|
||||
(logior! (-> this enemy-flags) (enemy-flag drawn-mirrored))
|
||||
)
|
||||
(logior! (-> this mask) (process-mask enemy))
|
||||
(logior! (-> this mask) (process-mask actor-pause))
|
||||
(logior! (-> this enemy-flags) (enemy-flag actor-pause-backup))
|
||||
(set! (-> this nav-radius-backup) (-> this root nav-radius))
|
||||
(set-enemy-info! this arg0)
|
||||
(set! (-> this enemy-info callback-info) *default-nav-callback-info*)
|
||||
(set! (-> this ragdoll-proc) (the-as handle #f))
|
||||
(let ((a1-2 (-> this enemy-info idle-anim-script)))
|
||||
(if a1-2
|
||||
(init! (-> this idle-anim-player) a1-2)
|
||||
)
|
||||
)
|
||||
(if (-> this draw shadow)
|
||||
(set! (-> this draw shadow-ctrl) (new
|
||||
'process
|
||||
'shadow-control
|
||||
(-> this enemy-info shadow-min-y)
|
||||
(-> this enemy-info shadow-max-y)
|
||||
(-> this enemy-info shadow-locus-dist)
|
||||
(the-as vector #f)
|
||||
(shadow-flags shdf00 shdf04)
|
||||
245760.0
|
||||
)
|
||||
)
|
||||
(set! (-> this draw shadow-ctrl) *nav-enemy-dummy-shadow-control*)
|
||||
)
|
||||
(get-nav-control this (-> arg0 nav-mesh))
|
||||
(set! (-> this water-max-height) (-> this nav state mesh water-max-height))
|
||||
(let ((v1-32 this))
|
||||
(set! (-> v1-32 enemy-flags) (the-as enemy-flag (logclear (-> v1-32 enemy-flags) (enemy-flag ef37))))
|
||||
(set! (-> v1-32 nav callback-info) *null-nav-callback-info*)
|
||||
)
|
||||
0
|
||||
(let ((v1-35 this))
|
||||
(set! (-> v1-35 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-35 enemy-flags))))
|
||||
)
|
||||
0
|
||||
(logior! (-> this nav flags) (nav-control-flag display-marks limit-rotation-rate))
|
||||
(logior! (-> this nav flags) (nav-control-flag update-heading-from-facing))
|
||||
(set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag ef44) (-> this enemy-flags))))
|
||||
(let ((v1-46 (-> this nav)))
|
||||
(set! (-> v1-46 target-speed) 0.0)
|
||||
)
|
||||
0
|
||||
(let ((v1-48 (-> this nav)))
|
||||
(set! (-> v1-48 acceleration) (-> this enemy-info walk-acceleration))
|
||||
)
|
||||
0
|
||||
(let ((v1-50 (-> this nav)))
|
||||
(set! (-> v1-50 turning-acceleration) (-> this enemy-info walk-turning-acceleration))
|
||||
)
|
||||
0
|
||||
(let ((v1-52 (-> this nav)))
|
||||
(set! (-> v1-52 max-rotation-rate) (-> this enemy-info maximum-rotation-rate))
|
||||
)
|
||||
0
|
||||
(nav-enemy-method-175 this)
|
||||
(set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f))
|
||||
(when (and (zero? (-> this path curve num-cverts)) (-> this entity))
|
||||
(set! (-> this path curve num-cverts) 3)
|
||||
(set! (-> this path curve cverts) (-> (new 'process 'vector-array 3) data))
|
||||
(logclear! (-> this path flags) (path-control-flag not-found))
|
||||
(vector+*! (-> this path curve cverts 0) (-> this entity trans) *x-vector* 6144.0)
|
||||
(vector+*! (-> this path curve cverts 1) (-> this entity trans) *x-vector* -6144.0)
|
||||
(vector+*! (-> this path curve cverts 2) (-> this entity trans) *z-vector* 6144.0)
|
||||
)
|
||||
(if (and (nonzero? (-> this path)) (nonzero? (-> this path curve num-cverts)))
|
||||
(logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text))
|
||||
)
|
||||
(if (logtest? (-> *game-info* secrets) (game-secrets hero-mode))
|
||||
(set! (-> this hit-points) (* 2.0 (-> this enemy-info default-hit-points)))
|
||||
(set! (-> this hit-points) (-> this enemy-info default-hit-points))
|
||||
)
|
||||
(let* ((v1-94 *game-info*)
|
||||
(a0-42 (+ (-> v1-94 attack-id) 1))
|
||||
)
|
||||
(set! (-> v1-94 attack-id) a0-42)
|
||||
(set! (-> this attack-id) a0-42)
|
||||
)
|
||||
(let* ((v1-95 *game-info*)
|
||||
(a0-44 (+ (-> v1-95 attack-id) 1))
|
||||
)
|
||||
(set! (-> v1-95 attack-id) a0-44)
|
||||
(set! (-> this persistent-attack-id) a0-44)
|
||||
)
|
||||
(set! (-> this gnd-collide-with) (-> this enemy-info gnd-collide-with))
|
||||
(set! (-> this fact) (new 'process 'fact-info-enemy this (the-as (pointer float) (-> arg0 fact-defaults))))
|
||||
(let ((cspec (if (logtest? (enemy-option multi-focus) (-> this fact enemy-options))
|
||||
(the-as collide-spec (collide-spec jak bot player-list jak-vehicle))
|
||||
(the-as collide-spec (collide-spec jak player-list jak-vehicle))
|
||||
)
|
||||
)
|
||||
)
|
||||
(reset-to-collide-spec (-> this focus) (the-as collide-spec cspec))
|
||||
)
|
||||
(set! sv-16 (new 'static 'res-tag))
|
||||
(let ((v1-104 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16))))
|
||||
(cond
|
||||
((and v1-104 (nonzero? (-> sv-16 elt-count)))
|
||||
(set! (-> this actor-group) (the-as (pointer actor-group) v1-104))
|
||||
(set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count)))
|
||||
)
|
||||
(else
|
||||
(set! (-> this actor-group) (the-as (pointer actor-group) #f))
|
||||
(set! (-> this actor-group-count) 0)
|
||||
0
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice pair))
|
||||
(set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active pair))
|
||||
(set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile pair))
|
||||
(set! (-> this on-death) (res-lump-struct (-> this entity) 'on-death pair))
|
||||
(if (-> this on-notice)
|
||||
(logior! (-> this enemy-flags) (enemy-flag enable-on-notice))
|
||||
)
|
||||
(if (-> this on-active)
|
||||
(logior! (-> this enemy-flags) (enemy-flag enable-on-active))
|
||||
)
|
||||
(if (-> this on-hostile)
|
||||
(logior! (-> this enemy-flags) (enemy-flag enable-on-hostile))
|
||||
)
|
||||
(set! (-> this incoming attacker-handle) (the-as handle #f))
|
||||
(let ((s4-0 (-> this root)))
|
||||
(set! (-> this penetrated-by-all) (-> this root penetrated-by))
|
||||
(set! (-> this root penetrated-by) (get-penetrated-by this))
|
||||
(set! (-> s4-0 event-self) 'touched)
|
||||
)
|
||||
(set! (-> this penetrate-flinch) (-> arg0 penetrate-flinch))
|
||||
(set! (-> this penetrate-knocked) (-> arg0 penetrate-knocked))
|
||||
(set! (-> this reaction-time) (rnd-time-frame this (seconds 0.1) (seconds 0.8)))
|
||||
(let* ((v1-135 (-> this enemy-flags))
|
||||
(a0-61 (-> this fact enemy-options))
|
||||
(v1-136
|
||||
(logior (enemy-flag vulnerable vulnerable-backup use-notice-distance attackable-backup trackable trackable-backup)
|
||||
v1-135
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (logtest? (enemy-option multi-focus) a0-61)
|
||||
(set! v1-136 (logior (enemy-flag multi-focus) v1-136))
|
||||
)
|
||||
(if (logtest? (enemy-option has-trigger) a0-61)
|
||||
(set! v1-136 (logior (enemy-flag use-trigger) v1-136))
|
||||
)
|
||||
(set! (-> this enemy-flags) v1-136)
|
||||
)
|
||||
(do-navigation-to-destination (-> this nav state) (-> this root trans))
|
||||
(if (and (should-move-to-ground? this)
|
||||
(not (logtest? (enemy-flag no-initial-move-to-ground) (-> this enemy-flags)))
|
||||
(not (logtest? (enemy-option ambush) (-> this fact enemy-options)))
|
||||
)
|
||||
(move-to-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with))
|
||||
)
|
||||
(if (zero? (-> this draw light-index))
|
||||
(set! (-> this draw light-index) (the-as uint 10))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch int vs object.
|
||||
|
||||
@@ -1161,29 +1161,11 @@
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
(vf3 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(set! (-> arg0 current-poly) arg1)
|
||||
(vector-copy! (-> arg0 current-pos) arg2)
|
||||
(let ((a1-3 (-> arg0 dest-pos)))
|
||||
(let ((v1-1 (-> arg0 current-pos)))
|
||||
(let ((a2-1 arg3))
|
||||
(let ((a3-1 arg4))
|
||||
(.mov vf7 a3-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a2-1 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-1 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-3 quad) vf6)
|
||||
)
|
||||
(vector+*! (-> arg0 dest-pos) (-> arg0 current-pos) arg3 arg4)
|
||||
(let ((v1-2 arg0))
|
||||
(vector-! (-> v1-2 dir) (-> v1-2 dest-pos) (-> v1-2 current-pos))
|
||||
(set! (-> v1-2 dir y) 0.0)
|
||||
@@ -1191,8 +1173,8 @@
|
||||
(let ((f0-2 1.0))
|
||||
(.lvf vf1 (&-> a0-2 quad))
|
||||
(.mul.vf.xyz vf2 vf1 vf1)
|
||||
(let ((a1-6 f0-2))
|
||||
(.mov vf3 a1-6)
|
||||
(let ((a1-7 f0-2))
|
||||
(.mov vf3 a1-7)
|
||||
)
|
||||
)
|
||||
(.mul.x.vf.w acc vf0 vf2)
|
||||
@@ -1843,44 +1825,30 @@
|
||||
)
|
||||
|
||||
(defun find-nearest-nav-mesh ((arg0 vector) (arg1 float))
|
||||
(local-vars (v1-15 float) (sv-64 nav-find-poly-parms) (sv-68 nav-mesh) (sv-72 float) (sv-76 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(set! sv-64 (new 'stack-no-clear 'nav-find-poly-parms))
|
||||
(set! sv-68 (the-as nav-mesh #f))
|
||||
(set! sv-72 arg1)
|
||||
(set! sv-76 arg0)
|
||||
(set! (-> sv-64 ignore) (the-as uint 7))
|
||||
(dotimes (gp-0 (-> *level* length))
|
||||
(let ((v1-5 (-> *level* level gp-0)))
|
||||
(when (= (-> v1-5 status) 'active)
|
||||
(let ((s5-0 (-> v1-5 bsp nav-meshes)))
|
||||
(when (nonzero? s5-0)
|
||||
(dotimes (s4-0 (-> s5-0 length))
|
||||
(let ((s3-0 (-> s5-0 s4-0 nav-mesh)))
|
||||
(when s3-0
|
||||
(vector-! (-> sv-64 point) sv-76 (the-as vector (-> s3-0 bounds)))
|
||||
(.lvf vf1 (&-> (-> sv-64 point) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-15 vf1)
|
||||
(let ((f0-1 v1-15)
|
||||
(f1-0 (-> s3-0 bounds r))
|
||||
)
|
||||
(when (< f0-1 (* f1-0 f1-0))
|
||||
(set! (-> sv-64 y-threshold) (-> s3-0 nearest-y-threshold))
|
||||
(nav-mesh-method-46 s3-0 (the-as nav-poly sv-64))
|
||||
(when (>= sv-72 (-> sv-64 dist))
|
||||
(set! sv-72 (-> sv-64 dist))
|
||||
(set! sv-68 s3-0)
|
||||
)
|
||||
(local-vars (sv-64 nav-find-poly-parms) (sv-68 nav-mesh) (sv-72 float) (sv-76 vector))
|
||||
(set! sv-64 (new 'stack-no-clear 'nav-find-poly-parms))
|
||||
(set! sv-68 (the-as nav-mesh #f))
|
||||
(set! sv-72 arg1)
|
||||
(set! sv-76 arg0)
|
||||
(set! (-> sv-64 ignore) (the-as uint 7))
|
||||
(dotimes (gp-0 (-> *level* length))
|
||||
(let ((v1-5 (-> *level* level gp-0)))
|
||||
(when (= (-> v1-5 status) 'active)
|
||||
(let ((s5-0 (-> v1-5 bsp nav-meshes)))
|
||||
(when (nonzero? s5-0)
|
||||
(dotimes (s4-0 (-> s5-0 length))
|
||||
(let ((s3-0 (-> s5-0 s4-0 nav-mesh)))
|
||||
(when s3-0
|
||||
(vector-! (-> sv-64 point) sv-76 (the-as vector (-> s3-0 bounds)))
|
||||
(let ((f0-1 (vector-length-squared (-> sv-64 point)))
|
||||
(f1-0 (-> s3-0 bounds r))
|
||||
)
|
||||
(when (< f0-1 (* f1-0 f1-0))
|
||||
(set! (-> sv-64 y-threshold) (-> s3-0 nearest-y-threshold))
|
||||
(nav-mesh-method-46 s3-0 (the-as nav-poly sv-64))
|
||||
(when (>= sv-72 (-> sv-64 dist))
|
||||
(set! sv-72 (-> sv-64 dist))
|
||||
(set! sv-68 s3-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1891,8 +1859,8 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
sv-68
|
||||
)
|
||||
sv-68
|
||||
)
|
||||
|
||||
(defmethod nav-mesh-method-10 ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 nav-poly))
|
||||
|
||||
@@ -73,7 +73,6 @@
|
||||
|
||||
(defmethod update ((this chain-physics) (arg0 process-drawable))
|
||||
(local-vars
|
||||
(v1-78 float)
|
||||
(f0-11 float)
|
||||
(sv-272 chain-physics-joint)
|
||||
(sv-288 vector)
|
||||
@@ -254,22 +253,14 @@
|
||||
(.svf (&-> v1-73 quad) vf4)
|
||||
)
|
||||
(vector+! sv-528 (-> sv-272 position) (-> sv-272 velocity))
|
||||
(let ((a2-9 (vector-! (new 'stack-no-clear 'vector) s3-0 sv-528)))
|
||||
(.lvf vf1 (&-> a2-9 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-78 vf1)
|
||||
(let* ((f0-13 v1-78)
|
||||
(f1-6 (* (-> this maximum-stretch) (-> this joint-length)))
|
||||
(f2-3 f1-6)
|
||||
)
|
||||
(if (< (* f2-3 f2-3) f0-13)
|
||||
(vector--float*! sv-528 s3-0 a2-9 (/ f1-6 (sqrtf f0-13)))
|
||||
)
|
||||
)
|
||||
(let* ((a2-9 (vector-! (new 'stack-no-clear 'vector) s3-0 sv-528))
|
||||
(f0-13 (vector-length-squared a2-9))
|
||||
(f1-6 (* (-> this maximum-stretch) (-> this joint-length)))
|
||||
(f2-3 f1-6)
|
||||
)
|
||||
(if (< (* f2-3 f2-3) f0-13)
|
||||
(vector--float*! sv-528 s3-0 a2-9 (/ f1-6 (sqrtf f0-13)))
|
||||
)
|
||||
)
|
||||
(vector-copy! (-> sv-272 position) sv-528)
|
||||
(if (-> sv-272 joint-mod)
|
||||
|
||||
@@ -1019,8 +1019,6 @@
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defmethod cloth-system-method-22 ((this cloth-system))
|
||||
(local-vars
|
||||
(v1-25 float)
|
||||
(v1-27 float)
|
||||
(sv-16 sphere)
|
||||
(sv-24 int)
|
||||
(sv-32 verlet-particle)
|
||||
@@ -1038,69 +1036,48 @@
|
||||
(sv-164 float)
|
||||
(sv-168 vector)
|
||||
)
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(dotimes (s5-0 (-> this collision-constraints length))
|
||||
(set! sv-16 (-> this collision-constraints data s5-0))
|
||||
(set! sv-24 0)
|
||||
(dotimes (s4-0 (+ (-> this cloth-height) -1))
|
||||
(dotimes (s3-0 (+ (-> this cloth-width) -1))
|
||||
(set! sv-32 (-> this particles data sv-24))
|
||||
(set! sv-36 (-> this particles data (+ sv-24 1)))
|
||||
(set! sv-40 (-> this particles data (+ sv-24 (-> this cloth-width))))
|
||||
(set! sv-44 (-> this particles data (+ (-> this cloth-width) 1 sv-24)))
|
||||
(set! sv-96 (vector-! (new 'stack-no-clear 'vector) (-> sv-44 pos) (-> sv-32 pos)))
|
||||
(set! sv-100 (vector-! (new 'stack-no-clear 'vector) (-> sv-36 pos) (-> sv-40 pos)))
|
||||
(set! sv-104 (the-as float 0.0))
|
||||
(set! sv-108 (the-as float 0.0))
|
||||
(set! sv-112 (new 'stack-no-clear 'vector))
|
||||
(set! sv-116 (the-as float 0.0))
|
||||
(.lvf vf1 (&-> sv-96 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-25 vf1)
|
||||
(set! sv-104 v1-25)
|
||||
(.lvf vf1 (&-> sv-100 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-27 vf1)
|
||||
(set! sv-108 v1-27)
|
||||
(if (< sv-108 sv-104)
|
||||
(vector+float*! sv-112 (-> sv-32 pos) sv-96 0.5)
|
||||
(vector+float*! sv-112 (-> sv-40 pos) sv-100 0.5)
|
||||
)
|
||||
(set! sv-116 (the-as float 0.0))
|
||||
(set! sv-120 (the-as float 0.0))
|
||||
(set! sv-120 (-> sv-16 r))
|
||||
(set! sv-160 (the-as float (vector-! (new 'stack-no-clear 'vector) sv-112 (the-as vector sv-16))))
|
||||
(set! sv-164 (the-as float 0.0))
|
||||
(set! sv-168 (new 'stack-no-clear 'vector))
|
||||
(set! sv-164 (vector-dot (the-as vector sv-160) (the-as vector sv-160)))
|
||||
(when (< sv-164 (* sv-120 sv-120))
|
||||
(vector-normalize-copy! sv-168 (the-as vector sv-160) sv-120)
|
||||
(vector-! sv-168 sv-168 (the-as vector sv-160))
|
||||
(vector+! (-> sv-32 pos) (-> sv-32 pos) sv-168)
|
||||
(vector+! (-> sv-36 pos) (-> sv-36 pos) sv-168)
|
||||
(vector+! (-> sv-40 pos) (-> sv-40 pos) sv-168)
|
||||
(vector+! (-> sv-44 pos) (-> sv-44 pos) sv-168)
|
||||
(dotimes (s5-0 (-> this collision-constraints length))
|
||||
(set! sv-16 (-> this collision-constraints data s5-0))
|
||||
(set! sv-24 0)
|
||||
(dotimes (s4-0 (+ (-> this cloth-height) -1))
|
||||
(dotimes (s3-0 (+ (-> this cloth-width) -1))
|
||||
(set! sv-32 (-> this particles data sv-24))
|
||||
(set! sv-36 (-> this particles data (+ sv-24 1)))
|
||||
(set! sv-40 (-> this particles data (+ sv-24 (-> this cloth-width))))
|
||||
(set! sv-44 (-> this particles data (+ (-> this cloth-width) 1 sv-24)))
|
||||
(set! sv-96 (vector-! (new 'stack-no-clear 'vector) (-> sv-44 pos) (-> sv-32 pos)))
|
||||
(set! sv-100 (vector-! (new 'stack-no-clear 'vector) (-> sv-36 pos) (-> sv-40 pos)))
|
||||
(set! sv-104 (the-as float 0.0))
|
||||
(set! sv-108 (the-as float 0.0))
|
||||
(set! sv-112 (new 'stack-no-clear 'vector))
|
||||
(set! sv-116 (the-as float 0.0))
|
||||
(set! sv-104 (vector-length-squared sv-96))
|
||||
(set! sv-108 (vector-length-squared sv-100))
|
||||
(if (< sv-108 sv-104)
|
||||
(vector+float*! sv-112 (-> sv-32 pos) sv-96 0.5)
|
||||
(vector+float*! sv-112 (-> sv-40 pos) sv-100 0.5)
|
||||
)
|
||||
(set! sv-24 (+ sv-24 1))
|
||||
(set! sv-116 (the-as float 0.0))
|
||||
(set! sv-120 (the-as float 0.0))
|
||||
(set! sv-120 (-> sv-16 r))
|
||||
(set! sv-160 (the-as float (vector-! (new 'stack-no-clear 'vector) sv-112 (the-as vector sv-16))))
|
||||
(set! sv-164 (the-as float 0.0))
|
||||
(set! sv-168 (new 'stack-no-clear 'vector))
|
||||
(set! sv-164 (vector-dot (the-as vector sv-160) (the-as vector sv-160)))
|
||||
(when (< sv-164 (* sv-120 sv-120))
|
||||
(vector-normalize-copy! sv-168 (the-as vector sv-160) sv-120)
|
||||
(vector-! sv-168 sv-168 (the-as vector sv-160))
|
||||
(vector+! (-> sv-32 pos) (-> sv-32 pos) sv-168)
|
||||
(vector+! (-> sv-36 pos) (-> sv-36 pos) sv-168)
|
||||
(vector+! (-> sv-40 pos) (-> sv-40 pos) sv-168)
|
||||
(vector+! (-> sv-44 pos) (-> sv-44 pos) sv-168)
|
||||
)
|
||||
(set! sv-24 (+ sv-24 1))
|
||||
)
|
||||
(set! sv-24 (+ sv-24 1))
|
||||
)
|
||||
(none)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod run-one-iteration ((this cloth-system))
|
||||
|
||||
@@ -110,80 +110,65 @@
|
||||
)
|
||||
|
||||
(defmethod ragdoll-method-19 ((this ragdoll) (arg0 vector) (arg1 int) (arg2 object) (arg3 matrix))
|
||||
(local-vars (v1-22 float))
|
||||
(with-pp
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(vector-float*! arg0 (-> this gravity) (* 122.88 (-> pp clock time-adjust-ratio)))
|
||||
(if (logtest? (-> this ragdoll-joints arg1 ragdoll-joint-flags) (ragdoll-joint-flag rjf2))
|
||||
(vector-float*! arg0 arg0 0.15)
|
||||
)
|
||||
(cond
|
||||
((logtest? (-> this ragdoll-joints arg1 ragdoll-joint-flags) (ragdoll-joint-flag rjf0))
|
||||
(vector+float*!
|
||||
arg0
|
||||
arg0
|
||||
(the-as vector (+ (the-as uint (-> this ragdoll-joints 0 bounce)) (* 192 arg1)))
|
||||
0.5
|
||||
)
|
||||
(vector+float*!
|
||||
arg0
|
||||
arg0
|
||||
(the-as vector (+ (the-as uint (-> this ragdoll-joints 0 velocity)) (* 192 arg1)))
|
||||
0.7
|
||||
)
|
||||
(vector-float*! arg0 (-> this gravity) (* 122.88 (-> pp clock time-adjust-ratio)))
|
||||
(if (logtest? (-> this ragdoll-joints arg1 ragdoll-joint-flags) (ragdoll-joint-flag rjf2))
|
||||
(vector-float*! arg0 arg0 0.15)
|
||||
)
|
||||
(cond
|
||||
((logtest? (-> this ragdoll-joints arg1 ragdoll-joint-flags) (ragdoll-joint-flag rjf0))
|
||||
(vector+float*!
|
||||
arg0
|
||||
arg0
|
||||
(the-as vector (+ (the-as uint (-> this ragdoll-joints 0 bounce)) (* 192 arg1)))
|
||||
0.5
|
||||
)
|
||||
(else
|
||||
(vector+float*!
|
||||
arg0
|
||||
arg0
|
||||
(the-as vector (+ (the-as uint (-> this ragdoll-joints 0 velocity)) (* 192 arg1)))
|
||||
1.0
|
||||
)
|
||||
(vector+float*!
|
||||
arg0
|
||||
arg0
|
||||
(the-as vector (+ (the-as uint (-> this ragdoll-joints 0 velocity)) (* 192 arg1)))
|
||||
0.7
|
||||
)
|
||||
)
|
||||
(else
|
||||
(vector+float*!
|
||||
arg0
|
||||
arg0
|
||||
(the-as vector (+ (the-as uint (-> this ragdoll-joints 0 velocity)) (* 192 arg1)))
|
||||
1.0
|
||||
)
|
||||
)
|
||||
(.lvf vf1 (&-> arg0 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-22 vf1)
|
||||
(let ((f0-6 v1-22)
|
||||
(f1-1 16384.0)
|
||||
)
|
||||
(if (and (zero? arg1)
|
||||
(not (logtest? (-> this ragdoll-joints arg1 ragdoll-joint-flags) (ragdoll-joint-flag rjf2)))
|
||||
)
|
||||
(set! f1-1 24576.0)
|
||||
)
|
||||
(let ((f2-0 f1-1))
|
||||
(if (< (* f2-0 f2-0) f0-6)
|
||||
(vector-float*! arg0 arg0 (/ f1-1 (sqrtf f0-6)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? (-> this rotate-adj-count))
|
||||
(quaternion-slerp! (-> this rotate-vel) (-> this rotate-vel) (-> this rotate-adj) 0.5)
|
||||
(quaternion-identity! (-> this rotate-adj))
|
||||
(set! (-> this rotate-adj-count) 0)
|
||||
0
|
||||
)
|
||||
(if (< (-> this rotate-vel w) 0.0)
|
||||
(quaternion-negate! (-> this rotate-vel) (-> this rotate-vel))
|
||||
)
|
||||
(when (< (-> this rotate-vel w) (cos 7281.778))
|
||||
(let ((a1-4 (vector-normalize! (-> this rotate-vel vec) 1.0)))
|
||||
(quaternion-vector-angle! (-> this rotate-vel) a1-4 7281.778)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
(let ((f0-6 (vector-length-squared arg0))
|
||||
(f1-1 16384.0)
|
||||
)
|
||||
(if (and (zero? arg1)
|
||||
(not (logtest? (-> this ragdoll-joints arg1 ragdoll-joint-flags) (ragdoll-joint-flag rjf2)))
|
||||
)
|
||||
(set! f1-1 24576.0)
|
||||
)
|
||||
(let ((f2-0 f1-1))
|
||||
(if (< (* f2-0 f2-0) f0-6)
|
||||
(vector-float*! arg0 arg0 (/ f1-1 (sqrtf f0-6)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? (-> this rotate-adj-count))
|
||||
(quaternion-slerp! (-> this rotate-vel) (-> this rotate-vel) (-> this rotate-adj) 0.5)
|
||||
(quaternion-identity! (-> this rotate-adj))
|
||||
(set! (-> this rotate-adj-count) 0)
|
||||
0
|
||||
)
|
||||
(if (< (-> this rotate-vel w) 0.0)
|
||||
(quaternion-negate! (-> this rotate-vel) (-> this rotate-vel))
|
||||
)
|
||||
(when (< (-> this rotate-vel w) (cos 7281.778))
|
||||
(let ((a1-4 (vector-normalize! (-> this rotate-vel vec) 1.0)))
|
||||
(quaternion-vector-angle! (-> this rotate-vel) a1-4 7281.778)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -264,174 +249,157 @@
|
||||
)
|
||||
|
||||
(defmethod ragdoll-method-24 ((this ragdoll) (arg0 vector) (arg1 int))
|
||||
(local-vars (v1-85 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(when *debug-segment*
|
||||
(let ((s3-0 (-> *display* frames (-> *display* on-screen) profile-array data 0))
|
||||
(v1-7 'ragdoll-collision)
|
||||
(s2-0 *color-white*)
|
||||
)
|
||||
(when (and *dproc* *debug-segment*)
|
||||
(let ((s1-0 (-> s3-0 data (-> s3-0 count))))
|
||||
(let ((s0-0 (-> s3-0 base-time)))
|
||||
(set! (-> s1-0 name) v1-7)
|
||||
(set! (-> s1-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s0-0))))
|
||||
)
|
||||
(set! (-> s1-0 depth) (the-as uint (-> s3-0 depth)))
|
||||
(set! (-> s1-0 color) s2-0)
|
||||
(set! (-> s3-0 segment (-> s3-0 depth)) s1-0)
|
||||
)
|
||||
(set! (-> s3-0 count) (min 1023 (+ (-> s3-0 count) 1)))
|
||||
(+! (-> s3-0 depth) 1)
|
||||
(set! (-> s3-0 max-depth) (max (-> s3-0 max-depth) (-> s3-0 depth)))
|
||||
(when *debug-segment*
|
||||
(let ((s3-0 (-> *display* frames (-> *display* on-screen) profile-array data 0))
|
||||
(v1-7 'ragdoll-collision)
|
||||
(s2-0 *color-white*)
|
||||
)
|
||||
(when (and *dproc* *debug-segment*)
|
||||
(let ((s1-0 (-> s3-0 data (-> s3-0 count))))
|
||||
(let ((s0-0 (-> s3-0 base-time)))
|
||||
(set! (-> s1-0 name) v1-7)
|
||||
(set! (-> s1-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s0-0))))
|
||||
)
|
||||
(set! (-> s1-0 depth) (the-as uint (-> s3-0 depth)))
|
||||
(set! (-> s1-0 color) s2-0)
|
||||
(set! (-> s3-0 segment (-> s3-0 depth)) s1-0)
|
||||
)
|
||||
(set! (-> s3-0 count) (min 1023 (+ (-> s3-0 count) 1)))
|
||||
(+! (-> s3-0 depth) 1)
|
||||
(set! (-> s3-0 max-depth) (max (-> s3-0 max-depth) (-> s3-0 depth)))
|
||||
)
|
||||
0
|
||||
)
|
||||
(let ((s4-1 (-> this ragdoll-joints arg1)))
|
||||
(when (and (logtest? (-> this ragdoll-flags) (ragdoll-flag rf0)) (!= (-> s4-1 coll-rad) 0.0))
|
||||
(when (logtest? (-> this ragdoll-flags) (ragdoll-flag mirror))
|
||||
(vector-matrix*! arg0 arg0 (-> this mirror))
|
||||
(vector-matrix*! (-> s4-1 position) (-> s4-1 position) (-> this mirror))
|
||||
)
|
||||
(let ((s2-1 (new 'stack-no-clear 'collide-query))
|
||||
(s3-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> s4-1 position)))
|
||||
(s1-1 0)
|
||||
)
|
||||
(logclear! (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf1 rjf3))
|
||||
(if (logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf0))
|
||||
(logior! (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf1))
|
||||
)
|
||||
(if (logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf2))
|
||||
(logior! (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf3))
|
||||
)
|
||||
(logclear! (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf0 rjf2))
|
||||
(set! (-> s4-1 original-speed) 0.0)
|
||||
(vector-copy! arg0 (-> s4-1 position))
|
||||
(until (or (< 6 s1-1) (begin
|
||||
(.lvf vf1 (&-> s3-2 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-85 vf1)
|
||||
(let ((f0-13 v1-85)
|
||||
(f1-4 409.6)
|
||||
)
|
||||
(< f0-13 (* f1-4 f1-4))
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! s1-1 1)
|
||||
(vector-copy! (-> s2-1 start-pos) arg0)
|
||||
(vector-copy! (-> s2-1 move-dist) s3-2)
|
||||
(let ((v1-49 s2-1))
|
||||
(set! (-> v1-49 radius) (-> s4-1 coll-rad))
|
||||
(set! (-> v1-49 collide-with) (the-as collide-spec (-> this bg-collide-with)))
|
||||
(set! (-> v1-49 ignore-process0) #f)
|
||||
(set! (-> v1-49 ignore-process1) #f)
|
||||
(set! (-> v1-49 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-49 action-mask) (collide-action solid))
|
||||
)
|
||||
(set! (-> s2-1 best-other-prim) #f)
|
||||
(let ((f30-0 (probe-using-line-sphere *collide-cache* s2-1)))
|
||||
(cond
|
||||
((>= f30-0 0.0)
|
||||
(cond
|
||||
((logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf0))
|
||||
)
|
||||
((logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf1))
|
||||
(set! (-> s4-1 original-speed) (vector-length s3-2))
|
||||
(ragdoll-method-23 this (-> s4-1 position) *zero-vector* 1.0 #f)
|
||||
)
|
||||
(else
|
||||
(set! (-> s4-1 original-speed) (vector-length s3-2))
|
||||
(ragdoll-method-23 this (-> s4-1 position) *zero-vector* 1.0 #f)
|
||||
)
|
||||
)
|
||||
(set! (-> s4-1 ground-pat) (-> s2-1 best-other-tri pat))
|
||||
(let ((f0-7 (fmin 1.0 f30-0)))
|
||||
(vector+float*! arg0 arg0 s3-2 f0-7)
|
||||
(vector-float*! s3-2 s3-2 (- 1.0 f0-7))
|
||||
)
|
||||
(let ((f0-10 (vector-dot s3-2 (-> s2-1 best-other-tri normal))))
|
||||
(vector--float*! s3-2 s3-2 (-> s2-1 best-other-tri normal) (* 1.2 f0-10))
|
||||
)
|
||||
(logior! (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf0))
|
||||
(vector-float*! (-> s4-1 bounce) (-> s2-1 best-other-tri normal) (-> s4-1 original-speed))
|
||||
)
|
||||
(else
|
||||
(vector+! arg0 arg0 s3-2)
|
||||
(goto cfg-34)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(label cfg-34)
|
||||
(if (and (not (logtest? (-> this ragdoll-flags) (ragdoll-flag rf11)))
|
||||
(logtest? (water-flag touch-water) (-> this water-info flags))
|
||||
(< (- (-> arg0 y) (-> s4-1 coll-rad)) (-> this water-info base-height))
|
||||
)
|
||||
(logior! (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf2))
|
||||
)
|
||||
(when (and (nonzero? (-> s4-1 hit-sound))
|
||||
(or (and (logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf0))
|
||||
(not (logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf1 rjf2)))
|
||||
)
|
||||
(and (logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf2))
|
||||
(not (logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf3)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-107 (the int (lerp-scale 0.0 1024.0 (-> s4-1 original-speed) 409.6 2867.2)))
|
||||
(s3-3 (new 'static 'sound-spec))
|
||||
)
|
||||
(when (nonzero? v1-107)
|
||||
(set! (-> s3-3 sound-name) (-> s4-1 hit-sound))
|
||||
(set! (-> s3-3 volume) v1-107)
|
||||
(set! (-> s3-3 reg 0) (the-as uint 0))
|
||||
(if (logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf2))
|
||||
(set! (-> s3-3 reg 0) (the-as uint 127))
|
||||
(set! (-> s3-3 reg 0) (the-as uint (-> s4-1 ground-pat material)))
|
||||
)
|
||||
(sound-play-by-spec s3-3 (new-sound-id) (-> s4-1 position))
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (logtest? (-> this ragdoll-flags) (ragdoll-flag mirror))
|
||||
(vector-matrix*! arg0 arg0 (-> this mirror))
|
||||
(vector-matrix*! (-> s4-1 position) (-> s4-1 position) (-> this mirror))
|
||||
)
|
||||
)
|
||||
)
|
||||
(when *debug-segment*
|
||||
(let ((gp-1 (-> *display* frames (-> *display* on-screen) profile-array data 0)))
|
||||
(when (and *dproc* *debug-segment*)
|
||||
(let* ((v1-129 (+ (-> gp-1 depth) -1))
|
||||
(s5-1 (-> gp-1 segment v1-129))
|
||||
(s4-2 (-> gp-1 base-time))
|
||||
)
|
||||
(when (>= v1-129 0)
|
||||
(set! (-> s5-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-2))))
|
||||
(+! (-> gp-1 depth) -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
(let ((s4-1 (-> this ragdoll-joints arg1)))
|
||||
(when (and (logtest? (-> this ragdoll-flags) (ragdoll-flag rf0)) (!= (-> s4-1 coll-rad) 0.0))
|
||||
(when (logtest? (-> this ragdoll-flags) (ragdoll-flag mirror))
|
||||
(vector-matrix*! arg0 arg0 (-> this mirror))
|
||||
(vector-matrix*! (-> s4-1 position) (-> s4-1 position) (-> this mirror))
|
||||
)
|
||||
(let ((s2-1 (new 'stack-no-clear 'collide-query))
|
||||
(s3-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> s4-1 position)))
|
||||
(s1-1 0)
|
||||
)
|
||||
(logclear! (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf1 rjf3))
|
||||
(if (logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf0))
|
||||
(logior! (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf1))
|
||||
)
|
||||
(if (logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf2))
|
||||
(logior! (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf3))
|
||||
)
|
||||
(logclear! (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf0 rjf2))
|
||||
(set! (-> s4-1 original-speed) 0.0)
|
||||
(vector-copy! arg0 (-> s4-1 position))
|
||||
(until (or (< 6 s1-1) (let ((f0-13 (vector-length-squared s3-2))
|
||||
(f1-4 409.6)
|
||||
)
|
||||
(< f0-13 (* f1-4 f1-4))
|
||||
)
|
||||
)
|
||||
(+! s1-1 1)
|
||||
(vector-copy! (-> s2-1 start-pos) arg0)
|
||||
(vector-copy! (-> s2-1 move-dist) s3-2)
|
||||
(let ((v1-49 s2-1))
|
||||
(set! (-> v1-49 radius) (-> s4-1 coll-rad))
|
||||
(set! (-> v1-49 collide-with) (the-as collide-spec (-> this bg-collide-with)))
|
||||
(set! (-> v1-49 ignore-process0) #f)
|
||||
(set! (-> v1-49 ignore-process1) #f)
|
||||
(set! (-> v1-49 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-49 action-mask) (collide-action solid))
|
||||
)
|
||||
(set! (-> s2-1 best-other-prim) #f)
|
||||
(let ((f30-0 (probe-using-line-sphere *collide-cache* s2-1)))
|
||||
(cond
|
||||
((>= f30-0 0.0)
|
||||
(cond
|
||||
((logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf0))
|
||||
)
|
||||
((logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf1))
|
||||
(set! (-> s4-1 original-speed) (vector-length s3-2))
|
||||
(ragdoll-method-23 this (-> s4-1 position) *zero-vector* 1.0 #f)
|
||||
)
|
||||
(else
|
||||
(set! (-> s4-1 original-speed) (vector-length s3-2))
|
||||
(ragdoll-method-23 this (-> s4-1 position) *zero-vector* 1.0 #f)
|
||||
)
|
||||
)
|
||||
(set! (-> s4-1 ground-pat) (-> s2-1 best-other-tri pat))
|
||||
(let ((f0-7 (fmin 1.0 f30-0)))
|
||||
(vector+float*! arg0 arg0 s3-2 f0-7)
|
||||
(vector-float*! s3-2 s3-2 (- 1.0 f0-7))
|
||||
)
|
||||
(let ((f0-10 (vector-dot s3-2 (-> s2-1 best-other-tri normal))))
|
||||
(vector--float*! s3-2 s3-2 (-> s2-1 best-other-tri normal) (* 1.2 f0-10))
|
||||
)
|
||||
(logior! (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf0))
|
||||
(vector-float*! (-> s4-1 bounce) (-> s2-1 best-other-tri normal) (-> s4-1 original-speed))
|
||||
)
|
||||
(else
|
||||
(vector+! arg0 arg0 s3-2)
|
||||
(goto cfg-34)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(label cfg-34)
|
||||
(if (and (not (logtest? (-> this ragdoll-flags) (ragdoll-flag rf11)))
|
||||
(logtest? (water-flag touch-water) (-> this water-info flags))
|
||||
(< (- (-> arg0 y) (-> s4-1 coll-rad)) (-> this water-info base-height))
|
||||
)
|
||||
(logior! (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf2))
|
||||
)
|
||||
(when (and (nonzero? (-> s4-1 hit-sound))
|
||||
(or (and (logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf0))
|
||||
(not (logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf1 rjf2)))
|
||||
)
|
||||
(and (logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf2))
|
||||
(not (logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf3)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-107 (the int (lerp-scale 0.0 1024.0 (-> s4-1 original-speed) 409.6 2867.2)))
|
||||
(s3-3 (new 'static 'sound-spec))
|
||||
)
|
||||
(when (nonzero? v1-107)
|
||||
(set! (-> s3-3 sound-name) (-> s4-1 hit-sound))
|
||||
(set! (-> s3-3 volume) v1-107)
|
||||
(set! (-> s3-3 reg 0) (the-as uint 0))
|
||||
(if (logtest? (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf2))
|
||||
(set! (-> s3-3 reg 0) (the-as uint 127))
|
||||
(set! (-> s3-3 reg 0) (the-as uint (-> s4-1 ground-pat material)))
|
||||
)
|
||||
(sound-play-by-spec s3-3 (new-sound-id) (-> s4-1 position))
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (logtest? (-> this ragdoll-flags) (ragdoll-flag mirror))
|
||||
(vector-matrix*! arg0 arg0 (-> this mirror))
|
||||
(vector-matrix*! (-> s4-1 position) (-> s4-1 position) (-> this mirror))
|
||||
)
|
||||
)
|
||||
)
|
||||
(when *debug-segment*
|
||||
(let ((gp-1 (-> *display* frames (-> *display* on-screen) profile-array data 0)))
|
||||
(when (and *dproc* *debug-segment*)
|
||||
(let* ((v1-129 (+ (-> gp-1 depth) -1))
|
||||
(s5-1 (-> gp-1 segment v1-129))
|
||||
(s4-2 (-> gp-1 base-time))
|
||||
)
|
||||
(when (>= v1-129 0)
|
||||
(set! (-> s5-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-2))))
|
||||
(+! (-> gp-1 depth) -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod enable-ragdoll! ((this ragdoll) (proc process-drawable))
|
||||
@@ -990,7 +958,6 @@
|
||||
(defmethod ragdoll-method-15 ((this ragdoll) (arg0 process-drawable) (arg1 ragdoll-edit-info))
|
||||
(local-vars
|
||||
(at-0 int)
|
||||
(v1-156 float)
|
||||
(f0-14 float)
|
||||
(sv-320 vector)
|
||||
(sv-336 vector)
|
||||
@@ -1229,22 +1196,14 @@
|
||||
(t9-20 a0-72 a1-23 sv-464 a3-6)
|
||||
)
|
||||
)
|
||||
(let ((a2-12 (vector-! (new 'stack-no-clear 'vector) (-> s2-1 trans) sv-560)))
|
||||
(.lvf vf1 (&-> a2-12 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-156 vf1)
|
||||
(let* ((f0-17 v1-156)
|
||||
(f1-6 (* (-> this maximum-stretch) (-> s0-1 joint-length)))
|
||||
(f2-3 f1-6)
|
||||
)
|
||||
(if (< (* f2-3 f2-3) f0-17)
|
||||
(vector--float*! sv-560 (-> s2-1 trans) a2-12 (/ f1-6 (sqrtf f0-17)))
|
||||
)
|
||||
)
|
||||
(let* ((a2-12 (vector-! (new 'stack-no-clear 'vector) (-> s2-1 trans) sv-560))
|
||||
(f0-17 (vector-length-squared a2-12))
|
||||
(f1-6 (* (-> this maximum-stretch) (-> s0-1 joint-length)))
|
||||
(f2-3 f1-6)
|
||||
)
|
||||
(if (< (* f2-3 f2-3) f0-17)
|
||||
(vector--float*! sv-560 (-> s2-1 trans) a2-12 (/ f1-6 (sqrtf f0-17)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
|
||||
@@ -147,33 +147,13 @@
|
||||
|
||||
;; WARN: Return type mismatch vector vs none.
|
||||
(defmethod rigid-body-control-method-24 ((this rigid-body-control) (arg0 vector) (arg1 vector))
|
||||
(local-vars (t0-5 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((v1-0 (new 'stack-no-clear 'inline-array 'vector 2)))
|
||||
(vector-! (-> v1-0 0) arg0 (-> this position))
|
||||
(vector-cross! (-> v1-0 1) (-> this torque) (-> v1-0 0))
|
||||
(let ((a1-2 (-> v1-0 1))
|
||||
(a3-3 (-> v1-0 1))
|
||||
(f0-0 1.0)
|
||||
)
|
||||
(.lvf vf1 (&-> (-> v1-0 0) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov t0-5 vf1)
|
||||
(vector-float*! a1-2 a3-3 (/ f0-0 t0-5))
|
||||
)
|
||||
(vector+! arg1 (-> v1-0 1) (-> this force))
|
||||
)
|
||||
(none)
|
||||
(let ((v1-0 (new 'stack-no-clear 'inline-array 'vector 2)))
|
||||
(vector-! (-> v1-0 0) arg0 (-> this position))
|
||||
(vector-cross! (-> v1-0 1) (-> this torque) (-> v1-0 0))
|
||||
(vector-float*! (-> v1-0 1) (-> v1-0 1) (/ 1.0 (vector-length-squared (-> v1-0 0))))
|
||||
(vector+! arg1 (-> v1-0 1) (-> this force))
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun matrix-3x3-triple-transpose-product ((arg0 matrix) (arg1 matrix) (arg2 matrix))
|
||||
@@ -188,68 +168,20 @@
|
||||
)
|
||||
|
||||
(defmethod rigid-body-control-method-12 ((this rigid-body-control) (arg0 float))
|
||||
(local-vars (v1-6 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(vector+*! (-> this lin-momentum) (-> this lin-momentum) (-> this force) arg0)
|
||||
(vector+*! (-> this ang-momentum) (-> this ang-momentum) (-> this torque) arg0)
|
||||
(let* ((f0-3 (* 500000000.0 (-> this info mass)))
|
||||
(f1-1 f0-3)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((a2-0 (-> this lin-momentum)))
|
||||
(let ((v1-0 (-> this lin-momentum)))
|
||||
(let ((a0-1 (-> this force)))
|
||||
(let ((a3-0 arg0))
|
||||
(.mov vf7 a3-0)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-1 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-0 quad))
|
||||
(if (< (* f1-1 f1-1) (vector-length-squared (-> this ang-momentum)))
|
||||
(vector-normalize! (-> this ang-momentum) f0-3)
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a2-0 quad) vf6)
|
||||
)
|
||||
(let ((a2-1 (-> this ang-momentum)))
|
||||
(let ((v1-1 (-> this ang-momentum)))
|
||||
(let ((a0-2 (-> this torque)))
|
||||
(let ((a1-1 arg0))
|
||||
(.mov vf7 a1-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-2 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-1 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a2-1 quad) vf6)
|
||||
)
|
||||
(let* ((f0-3 (* 500000000.0 (-> this info mass)))
|
||||
(f1-1 f0-3)
|
||||
(f1-3 (* f1-1 f1-1))
|
||||
)
|
||||
(.lvf vf1 (&-> (-> this ang-momentum) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-6 vf1)
|
||||
(if (< f1-3 v1-6)
|
||||
(vector-normalize! (-> this ang-momentum) f0-3)
|
||||
)
|
||||
)
|
||||
(set! (-> this force quad) (the-as uint128 0))
|
||||
(set! (-> this torque quad) (the-as uint128 0))
|
||||
0
|
||||
0
|
||||
(none)
|
||||
)
|
||||
(set! (-> this force quad) (the-as uint128 0))
|
||||
(set! (-> this torque quad) (the-as uint128 0))
|
||||
0
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod init-velocities! ((this rigid-body-control))
|
||||
@@ -263,44 +195,21 @@
|
||||
)
|
||||
|
||||
(defmethod rigid-body-control-method-14 ((this rigid-body-control) (arg0 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((a1-1 (-> this position)))
|
||||
(let ((v1-0 (-> this position)))
|
||||
(let ((a0-1 (-> this lin-velocity)))
|
||||
(let ((a2-0 arg0))
|
||||
(.mov vf7 a2-0)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-1 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-0 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-1 quad) vf6)
|
||||
)
|
||||
(let ((s4-0 (new 'stack-no-clear 'quaternion)))
|
||||
(set! (-> (the-as vector (&-> s4-0 x)) quad) (-> this ang-velocity quad))
|
||||
(set! (-> s4-0 w) 0.0)
|
||||
(quaternion*! s4-0 s4-0 (the-as quaternion (-> this rot)))
|
||||
(quaternion-float*! s4-0 s4-0 0.5)
|
||||
(+! (-> this rot x) (* (-> s4-0 x) arg0))
|
||||
(+! (-> this rot y) (* (-> s4-0 y) arg0))
|
||||
(+! (-> this rot z) (* (-> s4-0 z) arg0))
|
||||
(+! (-> this rot w) (* (-> s4-0 w) arg0))
|
||||
)
|
||||
(quaternion-normalize! (the-as quaternion (-> this rot)))
|
||||
(rigid-body-control-method-26 this)
|
||||
0
|
||||
(none)
|
||||
(vector+*! (-> this position) (-> this position) (-> this lin-velocity) arg0)
|
||||
(let ((s4-0 (new 'stack-no-clear 'quaternion)))
|
||||
(set! (-> (the-as vector (&-> s4-0 x)) quad) (-> this ang-velocity quad))
|
||||
(set! (-> s4-0 w) 0.0)
|
||||
(quaternion*! s4-0 s4-0 (the-as quaternion (-> this rot)))
|
||||
(quaternion-float*! s4-0 s4-0 0.5)
|
||||
(+! (-> this rot x) (* (-> s4-0 x) arg0))
|
||||
(+! (-> this rot y) (* (-> s4-0 y) arg0))
|
||||
(+! (-> this rot z) (* (-> s4-0 z) arg0))
|
||||
(+! (-> this rot w) (* (-> s4-0 w) arg0))
|
||||
)
|
||||
(quaternion-normalize! (the-as quaternion (-> this rot)))
|
||||
(rigid-body-control-method-26 this)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun damping-time-adjust ((arg0 float) (arg1 float))
|
||||
|
||||
@@ -386,47 +386,24 @@
|
||||
)
|
||||
|
||||
(defmethod cubic-curve-method-9 ((this cubic-curve) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(set! (-> this vec 0 quad) (-> arg0 quad))
|
||||
(vector-copy! (-> this mat uvec) arg1)
|
||||
(let ((v1-2 (new 'stack-no-clear 'trajectory)))
|
||||
(vector-! (-> v1-2 initial-velocity) arg2 arg0)
|
||||
(vector-float*! (-> v1-2 initial-position) (-> v1-2 initial-velocity) 3.0)
|
||||
(let ((t1-7 (-> v1-2 initial-position)))
|
||||
(let ((a1-3 (-> v1-2 initial-position)))
|
||||
(let ((a3-2 arg1))
|
||||
(let ((t2-1 -2.0))
|
||||
(.mov vf7 t2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a3-2 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a1-3 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> t1-7 quad) vf6)
|
||||
)
|
||||
(vector-! (-> v1-2 initial-position) (-> v1-2 initial-position) arg3)
|
||||
(vector-copy! (-> this mat fvec) (-> v1-2 initial-position))
|
||||
(vector-float*! (-> v1-2 initial-position) (-> v1-2 initial-velocity) -2.0)
|
||||
(vector+! (-> v1-2 initial-position) (-> v1-2 initial-position) arg1)
|
||||
(vector+! (-> v1-2 initial-position) (-> v1-2 initial-position) arg3)
|
||||
(vector-copy! (-> this mat trans) (-> v1-2 initial-position))
|
||||
)
|
||||
(dotimes (v1-5 4)
|
||||
(set! (-> this vec v1-5 w) 0.0)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
(set! (-> this vec 0 quad) (-> arg0 quad))
|
||||
(vector-copy! (-> this mat uvec) arg1)
|
||||
(let ((v1-2 (new 'stack-no-clear 'trajectory)))
|
||||
(vector-! (-> v1-2 initial-velocity) arg2 arg0)
|
||||
(vector-float*! (-> v1-2 initial-position) (-> v1-2 initial-velocity) 3.0)
|
||||
(vector+*! (-> v1-2 initial-position) (-> v1-2 initial-position) arg1 -2.0)
|
||||
(vector-! (-> v1-2 initial-position) (-> v1-2 initial-position) arg3)
|
||||
(vector-copy! (-> this mat fvec) (-> v1-2 initial-position))
|
||||
(vector-float*! (-> v1-2 initial-position) (-> v1-2 initial-velocity) -2.0)
|
||||
(vector+! (-> v1-2 initial-position) (-> v1-2 initial-position) arg1)
|
||||
(vector+! (-> v1-2 initial-position) (-> v1-2 initial-position) arg3)
|
||||
(vector-copy! (-> this mat trans) (-> v1-2 initial-position))
|
||||
)
|
||||
(dotimes (v1-5 4)
|
||||
(set! (-> this vec v1-5 w) 0.0)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod cubic-curve-method-10 ((this cubic-curve) (arg0 vector) (arg1 float))
|
||||
|
||||
@@ -512,16 +512,7 @@
|
||||
(/ 1.0 (-> s1-0 move-dist z))
|
||||
)
|
||||
)
|
||||
(let ((f0-12 1.0))
|
||||
(.lvf vf1 (&-> (-> s1-0 move-dist) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-26 vf1)
|
||||
(set! (-> s1-0 rlength w) (/ f0-12 v1-26))
|
||||
)
|
||||
(set! (-> s1-0 rlength w) (/ 1.0 (vector-length-squared (-> s1-0 move-dist))))
|
||||
(set! (-> s1-0 exit-planes 0 x) (if (< 0.0 (-> s1-0 move-dist x))
|
||||
0.0
|
||||
100000000000000000000000000000000000000.0
|
||||
|
||||
@@ -1572,7 +1572,7 @@
|
||||
(set! (-> self control transv z) (-> v1-21 z))
|
||||
)
|
||||
(vector-xz-normalize! (-> self control transv) (the-as float (-> self control unknown-word04)))
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
@@ -2409,11 +2409,11 @@
|
||||
(ja-channel-push! 1 (seconds 0.04))
|
||||
(ja :group! jakb-board-turn-around-ja :num! min)
|
||||
(quaternion-rotate-y! (-> self control dir-targ) (-> self control quat-for-control) 32768.0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(until (ja-done? 0)
|
||||
(suspend)
|
||||
(ja :num! (seek! max 1.25))
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
|
||||
(set! (-> self control ctrl-xz-vel)
|
||||
(* f30-0 (* (/ (-> self clock frames-per-second) (meters 10)) (-> self align delta trans z)))
|
||||
|
||||
@@ -494,43 +494,28 @@
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defbehavior target-board-green-eco-attack target ((arg0 symbol))
|
||||
(local-vars (v1-14 float) (v1-25 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
||||
(cond
|
||||
(arg0
|
||||
(vector-copy! gp-0 (-> self control trans))
|
||||
(set! (-> gp-0 w) 49152.0)
|
||||
)
|
||||
(else
|
||||
(vector-normalize! (vector-z-quaternion! gp-0 (-> self control quat)) -12288.0)
|
||||
(vector+! gp-0 gp-0 (-> self control trans))
|
||||
(set! (-> gp-0 w) 24576.0)
|
||||
)
|
||||
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
||||
(cond
|
||||
(arg0
|
||||
(vector-copy! gp-0 (-> self control trans))
|
||||
(set! (-> gp-0 w) 49152.0)
|
||||
)
|
||||
(let ((s5-1 (new 'stack-no-clear 'array 'collide-shape 384)))
|
||||
(countdown (s4-0 (fill-actor-list-for-box *actor-hash* gp-0 s5-1 384))
|
||||
(let ((v1-10 (as-type (-> s5-1 s4-0) collide-shape)))
|
||||
(when v1-10
|
||||
(let ((a0-11 (as-type (-> v1-10 process) process-focusable)))
|
||||
(when a0-11
|
||||
(when (!= *target* a0-11)
|
||||
(let ((v1-13 (vector-! (new 'stack-no-clear 'vector) (-> a0-11 root trans) gp-0)))
|
||||
0.0
|
||||
(.lvf vf1 (&-> v1-13 quad))
|
||||
)
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-14 vf1)
|
||||
(let ((f0-3 v1-14)
|
||||
(else
|
||||
(vector-normalize! (vector-z-quaternion! gp-0 (-> self control quat)) -12288.0)
|
||||
(vector+! gp-0 gp-0 (-> self control trans))
|
||||
(set! (-> gp-0 w) 24576.0)
|
||||
)
|
||||
)
|
||||
(let ((s5-1 (new 'stack-no-clear 'array 'collide-shape 384)))
|
||||
(countdown (s4-0 (fill-actor-list-for-box *actor-hash* gp-0 s5-1 384))
|
||||
(let ((v1-10 (as-type (-> s5-1 s4-0) collide-shape)))
|
||||
(when v1-10
|
||||
(let ((a0-11 (as-type (-> v1-10 process) process-focusable)))
|
||||
(when a0-11
|
||||
(when (!= *target* a0-11)
|
||||
(let ((v1-13 (vector-! (new 'stack-no-clear 'vector) (-> a0-11 root trans) gp-0)))
|
||||
0.0
|
||||
(let ((f0-3 (vector-length-squared v1-13))
|
||||
(f1-0 (-> gp-0 w))
|
||||
)
|
||||
(if (>= (* f1-0 f1-0) f0-3)
|
||||
@@ -544,20 +529,13 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s5-2 (the-as target (as-type *target* process-focusable))))
|
||||
(when (and s5-2 (< (vector-vector-distance (get-trans s5-2 0) gp-0) (-> gp-0 w)))
|
||||
(when (!= *target* s5-2)
|
||||
(let ((v1-24 (vector-! (new 'stack-no-clear 'vector) (-> s5-2 control trans) gp-0)))
|
||||
0.0
|
||||
(.lvf vf1 (&-> v1-24 quad))
|
||||
)
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-25 vf1)
|
||||
(let ((f0-6 v1-25)
|
||||
)
|
||||
(let ((s5-2 (the-as target (as-type *target* process-focusable))))
|
||||
(when (and s5-2 (< (vector-vector-distance (get-trans s5-2 0) gp-0) (-> gp-0 w)))
|
||||
(when (!= *target* s5-2)
|
||||
(let ((v1-24 (vector-! (new 'stack-no-clear 'vector) (-> s5-2 control trans) gp-0)))
|
||||
0.0
|
||||
(let ((f0-6 (vector-length-squared v1-24))
|
||||
(f1-4 (-> gp-0 w))
|
||||
)
|
||||
(if (>= (* f1-4 f1-4) f0-6)
|
||||
@@ -568,8 +546,8 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch float vs none.
|
||||
|
||||
@@ -500,52 +500,37 @@
|
||||
)
|
||||
|
||||
(defmethod nav-enemy-method-187 ((this flut-racer))
|
||||
(local-vars (v1-26 float) (v1-40 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((t9-0 (method-of-type nav-enemy nav-enemy-method-187)))
|
||||
(t9-0 this)
|
||||
(let ((t9-0 (method-of-type nav-enemy nav-enemy-method-187)))
|
||||
(t9-0 this)
|
||||
)
|
||||
(let ((s5-0 (new 'stack 'traffic-danger-info)))
|
||||
(set! (-> s5-0 danger-type) (the-as uint 8))
|
||||
(set! (-> s5-0 sphere quad) (-> this root trans quad))
|
||||
(set! (-> s5-0 sphere r) 122880.0)
|
||||
(copy-nav-state-vel! this (-> s5-0 velocity))
|
||||
(vector-normalize! (-> s5-0 velocity) 122880.0)
|
||||
(set! (-> s5-0 danger-level) 0.5)
|
||||
(set! (-> s5-0 notify-radius) 491520.0)
|
||||
(set! (-> s5-0 decay-rate) 0.0)
|
||||
(add-danger *traffic-engine* s5-0)
|
||||
)
|
||||
(let ((s5-1 (new 'stack-no-clear 'vector)))
|
||||
(vector-normalize!
|
||||
(vector-z-quaternion! s5-1 (-> this root quat))
|
||||
(* (-> this nav target-speed) (seconds-per-frame) (seconds-per-frame))
|
||||
)
|
||||
(let ((s5-0 (new 'stack 'traffic-danger-info)))
|
||||
(set! (-> s5-0 danger-type) (the-as uint 8))
|
||||
(set! (-> s5-0 sphere quad) (-> this root trans quad))
|
||||
(set! (-> s5-0 sphere r) 122880.0)
|
||||
(copy-nav-state-vel! this (-> s5-0 velocity))
|
||||
(vector-normalize! (-> s5-0 velocity) 122880.0)
|
||||
(set! (-> s5-0 danger-level) 0.5)
|
||||
(set! (-> s5-0 notify-radius) 491520.0)
|
||||
(set! (-> s5-0 decay-rate) 0.0)
|
||||
(add-danger *traffic-engine* s5-0)
|
||||
)
|
||||
(let ((s5-1 (new 'stack-no-clear 'vector)))
|
||||
(vector-normalize!
|
||||
(vector-z-quaternion! s5-1 (-> this root quat))
|
||||
(* (-> this nav target-speed) (seconds-per-frame) (seconds-per-frame))
|
||||
)
|
||||
(vector+! s5-1 s5-1 (-> this root trans))
|
||||
(set! (-> s5-1 w) 16384.0)
|
||||
(let ((s4-1 (new 'stack-no-clear 'array 'collide-shape 384)))
|
||||
(countdown (s3-0 (fill-actor-list-for-box *actor-hash* s5-1 s4-1 384))
|
||||
(let ((v1-21 (as-type (-> s4-1 s3-0) collide-shape)))
|
||||
(when v1-21
|
||||
(let ((s2-1 (as-type (-> v1-21 process) process-focusable)))
|
||||
(when s2-1
|
||||
(when (and (!= *target* s2-1) (type? s2-1 civilian))
|
||||
(let ((v1-25 (vector-! (new 'stack-no-clear 'vector) (-> s2-1 root trans) s5-1)))
|
||||
0.0
|
||||
(.lvf vf1 (&-> v1-25 quad))
|
||||
)
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-26 vf1)
|
||||
(let ((f0-10 v1-26)
|
||||
(vector+! s5-1 s5-1 (-> this root trans))
|
||||
(set! (-> s5-1 w) 16384.0)
|
||||
(let ((s4-1 (new 'stack-no-clear 'array 'collide-shape 384)))
|
||||
(countdown (s3-0 (fill-actor-list-for-box *actor-hash* s5-1 s4-1 384))
|
||||
(let ((v1-21 (as-type (-> s4-1 s3-0) collide-shape)))
|
||||
(when v1-21
|
||||
(let ((s2-1 (as-type (-> v1-21 process) process-focusable)))
|
||||
(when s2-1
|
||||
(when (and (!= *target* s2-1) (type? s2-1 civilian))
|
||||
(let ((v1-25 (vector-! (new 'stack-no-clear 'vector) (-> s2-1 root trans) s5-1)))
|
||||
0.0
|
||||
(let ((f0-10 (vector-length-squared v1-25))
|
||||
(f1-2 (-> s5-1 w))
|
||||
)
|
||||
(when (>= (* f1-2 f1-2) f0-10)
|
||||
@@ -562,20 +547,13 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s4-2 (the-as target (as-type *target* process-focusable))))
|
||||
(when (and s4-2 (< (vector-vector-distance (get-trans s4-2 0) s5-1) (-> s5-1 w)))
|
||||
(when (and (!= *target* s4-2) (type? s4-2 civilian))
|
||||
(let ((v1-39 (vector-! (new 'stack-no-clear 'vector) (-> s4-2 control trans) s5-1)))
|
||||
0.0
|
||||
(.lvf vf1 (&-> v1-39 quad))
|
||||
)
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-40 vf1)
|
||||
(let ((f0-13 v1-40)
|
||||
)
|
||||
(let ((s4-2 (the-as target (as-type *target* process-focusable))))
|
||||
(when (and s4-2 (< (vector-vector-distance (get-trans s4-2 0) s5-1) (-> s5-1 w)))
|
||||
(when (and (!= *target* s4-2) (type? s4-2 civilian))
|
||||
(let ((v1-39 (vector-! (new 'stack-no-clear 'vector) (-> s4-2 control trans) s5-1)))
|
||||
0.0
|
||||
(let ((f0-13 (vector-length-squared v1-39))
|
||||
(f1-6 (-> s5-1 w))
|
||||
)
|
||||
(when (>= (* f1-6 f1-6) f0-13)
|
||||
@@ -589,8 +567,8 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod init-enemy! ((this flut-racer))
|
||||
|
||||
@@ -338,242 +338,136 @@
|
||||
)
|
||||
|
||||
(defun flut-leg-ik-callback ((arg0 joint-mod-ik) (arg1 object) (arg2 object) (arg3 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-0 arg3)
|
||||
(let ((f0-1 (- (-> arg3 y) (-> (target-pos 0) y))))
|
||||
(if (< 6144.0 f0-1)
|
||||
(set! f0-1 6144.0)
|
||||
)
|
||||
(if (< f0-1 -6144.0)
|
||||
(set! f0-1 -6144.0)
|
||||
)
|
||||
(+! (-> arg0 user-position y) f0-1)
|
||||
)
|
||||
(let ((f0-4 (- (-> arg3 y) (-> arg0 user-position y))))
|
||||
(seek! (-> arg0 user-float) f0-4 (* 40960.0 (seconds-per-frame)))
|
||||
)
|
||||
(let* ((f28-0 (-> arg0 user-float))
|
||||
(f30-1 (lerp-scale 1.0 0.0 f28-0 0.0 12288.0))
|
||||
(s3-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((v1-12 s5-0))
|
||||
(let ((a0-4 *up-vector*))
|
||||
(let ((a1-4 8192.0))
|
||||
(.mov vf7 a1-4)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-4 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-12 quad))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-0 arg3)
|
||||
(let ((f0-1 (- (-> arg3 y) (-> (target-pos 0) y))))
|
||||
(if (< 6144.0 f0-1)
|
||||
(set! f0-1 6144.0)
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s3-0 quad) vf6)
|
||||
(vector-float*! (new 'stack-no-clear 'vector) *up-vector* -16384.0)
|
||||
(let ((s2-0 (new 'stack-no-clear 'vector)))
|
||||
0.0
|
||||
(let ((f0-11 (intersect-ray-plane s3-0 *up-vector* (-> arg0 user-position) *up-vector*))
|
||||
(a0-7 s2-0)
|
||||
)
|
||||
(let ((v1-15 *up-vector*))
|
||||
(let ((a1-7 f0-11))
|
||||
(.mov vf7 a1-7)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-15 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> s3-0 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-7 quad) vf6)
|
||||
)
|
||||
(let ((a0-8 s2-0))
|
||||
(let ((v1-16 *up-vector*))
|
||||
(let ((a1-8 (- f28-0)))
|
||||
(.mov vf7 a1-8)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-16 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> arg3 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-8 quad) vf6)
|
||||
)
|
||||
(let ((a1-9 s5-0))
|
||||
(let ((v1-17 s5-0))
|
||||
(let ((a0-10 (vector-! (new 'stack-no-clear 'vector) s2-0 s5-0)))
|
||||
(let ((a2-6 (fmin 1.0 (* (-> arg0 user-blend) f30-1))))
|
||||
(.mov vf7 a2-6)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-10 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-17 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-9 quad) vf6)
|
||||
)
|
||||
(if (< f0-1 -6144.0)
|
||||
(set! f0-1 -6144.0)
|
||||
)
|
||||
)
|
||||
(set-ik-target! arg0 s5-0)
|
||||
(+! (-> arg0 user-position y) f0-1)
|
||||
)
|
||||
(none)
|
||||
(let ((f0-4 (- (-> arg3 y) (-> arg0 user-position y))))
|
||||
(seek! (-> arg0 user-float) f0-4 (* 40960.0 (seconds-per-frame)))
|
||||
)
|
||||
(let* ((f28-0 (-> arg0 user-float))
|
||||
(f30-1 (lerp-scale 1.0 0.0 f28-0 0.0 12288.0))
|
||||
(s3-1 (vector+*! (new 'stack-no-clear 'vector) s5-0 *up-vector* 8192.0))
|
||||
)
|
||||
(vector-float*! (new 'stack-no-clear 'vector) *up-vector* -16384.0)
|
||||
(let ((s2-0 (new 'stack-no-clear 'vector)))
|
||||
0.0
|
||||
(let ((f0-11 (intersect-ray-plane s3-1 *up-vector* (-> arg0 user-position) *up-vector*)))
|
||||
(vector+*! s2-0 s3-1 *up-vector* f0-11)
|
||||
)
|
||||
(vector+*! s2-0 arg3 *up-vector* (- f28-0))
|
||||
(vector+*!
|
||||
s5-0
|
||||
s5-0
|
||||
(vector-! (new 'stack-no-clear 'vector) s2-0 s5-0)
|
||||
(fmin 1.0 (* (-> arg0 user-blend) f30-1))
|
||||
)
|
||||
)
|
||||
)
|
||||
(set-ik-target! arg0 s5-0)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch int vs object.
|
||||
(defbehavior flut-update-ik target ()
|
||||
(local-vars (sv-720 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((gp-0 (new 'stack-no-clear 'collide-query))
|
||||
(s5-0 (-> (the-as process-drawable (-> self parent 0)) root))
|
||||
(let ((gp-0 (new 'stack-no-clear 'collide-query))
|
||||
(s5-0 (-> (the-as process-drawable (-> self parent 0)) root))
|
||||
)
|
||||
(let ((a1-0 (-> gp-0 bbox))
|
||||
(v1-2 (-> s5-0 trans))
|
||||
(a0-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((a1-0 (-> gp-0 bbox))
|
||||
(v1-2 (-> s5-0 trans))
|
||||
(a0-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> a0-0 x) 10240.0)
|
||||
(set! (-> a0-0 y) 10240.0)
|
||||
(set! (-> a0-0 z) 10240.0)
|
||||
(set! (-> a0-0 w) 1.0)
|
||||
(vector-! (-> a1-0 min) v1-2 a0-0)
|
||||
)
|
||||
(let ((a1-2 (-> gp-0 bbox max))
|
||||
(v1-3 (-> s5-0 trans))
|
||||
(a0-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> a0-1 x) 10240.0)
|
||||
(set! (-> a0-1 y) 10240.0)
|
||||
(set! (-> a0-1 z) 10240.0)
|
||||
(set! (-> a0-1 w) 1.0)
|
||||
(vector+! a1-2 v1-3 a0-1)
|
||||
)
|
||||
(set! (-> gp-0 collide-with) (-> (the-as collide-shape s5-0) root-prim prim-core collide-with))
|
||||
(set! (-> gp-0 ignore-process0) #f)
|
||||
(set! (-> gp-0 ignore-process1) #f)
|
||||
(set! (-> gp-0 ignore-pat) (-> (the-as collide-shape s5-0) pat-ignore-mask))
|
||||
(fill-using-bounding-box *collide-cache* gp-0)
|
||||
(dotimes (s4-0 2)
|
||||
(let ((s3-0 (-> self mech-ik s4-0)))
|
||||
#t
|
||||
(set! (-> s3-0 callback) (the-as (function joint-mod-ik matrix matrix vector object) flut-leg-ik-callback))
|
||||
(let ((a1-6 (not (logtest? (target-flags lleg-no-ik rleg-no-ik) (-> *target* target-flags)))))
|
||||
(enable-set! s3-0 a1-6)
|
||||
)
|
||||
(-> s3-0 shoulder-matrix-no-ik)
|
||||
(let ((v1-17 (-> s3-0 elbow-matrix-no-ik))
|
||||
(s0-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! sv-720 (new 'stack-no-clear 'vector))
|
||||
(let ((a0-8 (-> *y-vector* quad)))
|
||||
(set! (-> sv-720 quad) a0-8)
|
||||
(set! (-> a0-0 x) 10240.0)
|
||||
(set! (-> a0-0 y) 10240.0)
|
||||
(set! (-> a0-0 z) 10240.0)
|
||||
(set! (-> a0-0 w) 1.0)
|
||||
(vector-! (-> a1-0 min) v1-2 a0-0)
|
||||
)
|
||||
(let ((a1-2 (-> gp-0 bbox max))
|
||||
(v1-3 (-> s5-0 trans))
|
||||
(a0-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> a0-1 x) 10240.0)
|
||||
(set! (-> a0-1 y) 10240.0)
|
||||
(set! (-> a0-1 z) 10240.0)
|
||||
(set! (-> a0-1 w) 1.0)
|
||||
(vector+! a1-2 v1-3 a0-1)
|
||||
)
|
||||
(set! (-> gp-0 collide-with) (-> (the-as collide-shape s5-0) root-prim prim-core collide-with))
|
||||
(set! (-> gp-0 ignore-process0) #f)
|
||||
(set! (-> gp-0 ignore-process1) #f)
|
||||
(set! (-> gp-0 ignore-pat) (-> (the-as collide-shape s5-0) pat-ignore-mask))
|
||||
(fill-using-bounding-box *collide-cache* gp-0)
|
||||
(dotimes (s4-0 2)
|
||||
(let ((s3-0 (-> self mech-ik s4-0)))
|
||||
#t
|
||||
(set! (-> s3-0 callback) (the-as (function joint-mod-ik matrix matrix vector object) flut-leg-ik-callback))
|
||||
(let ((a1-6 (not (logtest? (target-flags lleg-no-ik rleg-no-ik) (-> *target* target-flags)))))
|
||||
(enable-set! s3-0 a1-6)
|
||||
)
|
||||
(-> s3-0 shoulder-matrix-no-ik)
|
||||
(let ((v1-17 (-> s3-0 elbow-matrix-no-ik))
|
||||
(s0-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((s2-0 (new 'stack-no-clear 'vector)))
|
||||
(new 'stack-no-clear 'vector)
|
||||
(new 'stack-no-clear 'vector)
|
||||
(let ((s1-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((a1-8 s0-0))
|
||||
(let ((a0-11 (-> v1-17 trans)))
|
||||
(let ((v1-18 (-> v1-17 uvec)))
|
||||
(let ((a2-8 (-> s3-0 hand-dist)))
|
||||
(.mov vf7 a2-8)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-18 quad))
|
||||
(set! sv-720 (new 'stack-no-clear 'vector))
|
||||
(let ((a0-8 (-> *y-vector* quad)))
|
||||
(set! (-> sv-720 quad) a0-8)
|
||||
)
|
||||
(let ((s2-0 (new 'stack-no-clear 'vector)))
|
||||
(new 'stack-no-clear 'vector)
|
||||
(new 'stack-no-clear 'vector)
|
||||
(let ((s1-0 (new 'stack-no-clear 'vector)))
|
||||
(vector+*! s0-0 (-> v1-17 trans) (-> v1-17 uvec) (-> s3-0 hand-dist))
|
||||
(let ((f0-11
|
||||
(lerp-scale 1.0 0.0 (- (-> s0-0 y) (-> (the-as collide-shape-moving s5-0) gspot-pos y)) 2048.0 12288.0)
|
||||
)
|
||||
(.lvf vf4 (&-> a0-11 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-8 quad) vf6)
|
||||
)
|
||||
(let ((f0-11
|
||||
(lerp-scale 1.0 0.0 (- (-> s0-0 y) (-> (the-as collide-shape-moving s5-0) gspot-pos y)) 2048.0 12288.0)
|
||||
)
|
||||
)
|
||||
(seek! (-> s3-0 user-blend) f0-11 (* 4.0 (seconds-per-frame)))
|
||||
)
|
||||
(let ((a1-11 (-> gp-0 start-pos)))
|
||||
(let ((v1-22 s0-0))
|
||||
(let ((a0-14 sv-720))
|
||||
(let ((a2-12 6144.0))
|
||||
(.mov vf7 a2-12)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-14 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-22 quad))
|
||||
(seek! (-> s3-0 user-blend) f0-11 (* 4.0 (seconds-per-frame)))
|
||||
)
|
||||
(vector+*! (-> gp-0 start-pos) s0-0 sv-720 6144.0)
|
||||
(let ((v1-23 (-> gp-0 move-dist))
|
||||
(f0-16 -20480.0)
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-11 quad) vf6)
|
||||
)
|
||||
(let ((v1-23 (-> gp-0 move-dist))
|
||||
(f0-16 -20480.0)
|
||||
(vector-float*! v1-23 sv-720 f0-16)
|
||||
)
|
||||
(let ((v1-25 gp-0))
|
||||
(set! (-> v1-25 radius) 4.096)
|
||||
(set! (-> v1-25 collide-with) (-> gp-0 collide-with))
|
||||
(set! (-> v1-25 ignore-process0) #f)
|
||||
(set! (-> v1-25 ignore-process1) #f)
|
||||
(set! (-> v1-25 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(vector-float*! v1-23 sv-720 f0-16)
|
||||
)
|
||||
(let ((v1-25 gp-0))
|
||||
(set! (-> v1-25 radius) 4.096)
|
||||
(set! (-> v1-25 collide-with) (-> gp-0 collide-with))
|
||||
(set! (-> v1-25 ignore-process0) #f)
|
||||
(set! (-> v1-25 ignore-process1) #f)
|
||||
(set! (-> v1-25 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-25 action-mask) (collide-action solid))
|
||||
)
|
||||
(let ((f30-0 (probe-using-line-sphere *collide-cache* gp-0)))
|
||||
(cond
|
||||
((>= f30-0 0.0)
|
||||
(vector-copy! s1-0 (-> gp-0 best-other-tri normal))
|
||||
(when (< 8192.0 (vector-vector-angle-safe *y-vector* s1-0))
|
||||
(let* ((a1-16 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) *y-vector* s1-0) 1.0))
|
||||
(a2-14 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-16 8192.0))
|
||||
)
|
||||
(vector-orient-by-quat! s1-0 *y-vector* a2-14)
|
||||
)
|
||||
(set! (-> v1-25 action-mask) (collide-action solid))
|
||||
)
|
||||
(let ((f30-0 (probe-using-line-sphere *collide-cache* gp-0)))
|
||||
(cond
|
||||
((>= f30-0 0.0)
|
||||
(vector-copy! s1-0 (-> gp-0 best-other-tri normal))
|
||||
(when (< 8192.0 (vector-vector-angle-safe *y-vector* s1-0))
|
||||
(let* ((a1-18 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) *y-vector* s1-0) 1.0))
|
||||
(a2-12 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-18 8192.0))
|
||||
)
|
||||
(vector-orient-by-quat! s1-0 *y-vector* a2-12)
|
||||
)
|
||||
(let ((a1-18 s2-0))
|
||||
(let ((v1-32 (-> gp-0 start-pos)))
|
||||
(let ((a0-29 (-> gp-0 move-dist)))
|
||||
(let ((a2-15 f30-0))
|
||||
(.mov vf7 a2-15)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-29 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-32 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-18 quad) vf6)
|
||||
)
|
||||
(vector-copy! (-> s3-0 user-position) s2-0)
|
||||
(vector-copy! (-> s3-0 user-normal) s1-0)
|
||||
)
|
||||
(else
|
||||
(set! (-> s0-0 y) (-> (target-pos 0) y))
|
||||
(vector-copy! (-> s3-0 user-position) s0-0)
|
||||
(vector-copy! (-> s3-0 user-normal) *y-vector*)
|
||||
)
|
||||
(vector+*! s2-0 (-> gp-0 start-pos) (-> gp-0 move-dist) f30-0)
|
||||
(vector-copy! (-> s3-0 user-position) s2-0)
|
||||
(vector-copy! (-> s3-0 user-normal) s1-0)
|
||||
)
|
||||
(else
|
||||
(set! (-> s0-0 y) (-> (target-pos 0) y))
|
||||
(vector-copy! (-> s3-0 user-position) s0-0)
|
||||
(vector-copy! (-> s3-0 user-normal) *y-vector*)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -582,8 +476,8 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
(defbehavior target-flut-get-off? target ()
|
||||
@@ -805,7 +699,7 @@
|
||||
(ja-channel-set! 1)
|
||||
(ja-no-eval :group! jakb-flut-air-attack-land-ja :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 1.0)
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
@@ -2362,7 +2256,7 @@
|
||||
)
|
||||
)
|
||||
(until (or (ja-done? 0) (< f30-0 0.05))
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(when (not (ja-min? 0))
|
||||
(cond
|
||||
((and (>= (ja-aframe-num 0) 20.0)
|
||||
@@ -2426,7 +2320,7 @@
|
||||
)
|
||||
(ja-no-eval :group! jakb-flut-running-attack-end-ja :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 f30-0)
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
@@ -2536,14 +2430,14 @@
|
||||
(ja-channel-push! 1 (seconds 0.05))
|
||||
(ja-no-eval :group! jakb-flut-air-attack-ja :num! (seek! (ja-aframe 8.0 0)) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0)
|
||||
(suspend)
|
||||
(ja :num! (seek! (ja-aframe 8.0 0)))
|
||||
)
|
||||
(ja-no-eval :group! jakb-flut-air-attack-ja :num! (seek!) :frame-num (ja-aframe 8.0 0))
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0)
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
@@ -2611,7 +2505,7 @@
|
||||
(ja-channel-set! 1)
|
||||
(ja-no-eval :group! jakb-flut-air-attack-land-ja :num! (seek! (ja-aframe 22.0 0)) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 1.0)
|
||||
(suspend)
|
||||
(ja :num! (seek! (ja-aframe 22.0 0)))
|
||||
@@ -2619,7 +2513,7 @@
|
||||
(target-danger-set! 'harmless #f)
|
||||
(ja-no-eval :group! jakb-flut-air-attack-land-ja :num! (seek!) :frame-num (ja-aframe 22.0 0))
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 1.0)
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
@@ -3128,7 +3022,7 @@
|
||||
(ja-no-eval :group! a1-48 :num! (seek!) :frame-num 0.0)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(let ((s5-13 (new 'stack-no-clear 'vector)))
|
||||
(when (not (logtest? (-> self align flags) (align-flags disabled)))
|
||||
(vector-matrix*! s5-13 (-> self align delta trans) (-> self control c-R-w))
|
||||
@@ -3238,7 +3132,7 @@
|
||||
(ja-no-eval :group! a1-52 :num! (seek!) :frame-num 0.0)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(let ((s5-14 (new 'stack-no-clear 'vector)))
|
||||
(when (not (logtest? (-> self align flags) (align-flags disabled)))
|
||||
(vector-matrix*! s5-14 (-> self align delta trans) (-> self control c-R-w))
|
||||
|
||||
@@ -264,12 +264,7 @@
|
||||
)
|
||||
(vector-cross! s2-0 (-> s3-0 vec-to-target) (-> s3-0 current-dir-vec))
|
||||
(vector-normalize! s2-0 1.0)
|
||||
(vector-rotate-around-axis!
|
||||
(-> s3-0 current-dir-vec)
|
||||
(the-as quaternion (-> s3-0 current-dir-vec))
|
||||
(* -1.0 f22-1)
|
||||
s2-0
|
||||
)
|
||||
(vector-rotate-around-axis! (-> s3-0 current-dir-vec) (-> s3-0 current-dir-vec) (* -1.0 f22-1) s2-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -857,7 +852,7 @@
|
||||
(.svf (&-> v1-20 quad) vf3)
|
||||
)
|
||||
(vector-normalize! sv-80 1.0)
|
||||
(vector-rotate-around-axis! sv-96 (the-as quaternion sv-96) f28-1 sv-80)
|
||||
(vector-rotate-around-axis! sv-96 sv-96 f28-1 sv-80)
|
||||
)
|
||||
)
|
||||
(vector-normalize! sv-96 1.0)
|
||||
@@ -1942,7 +1937,7 @@
|
||||
(the float (sar (shl (the int (+ (-> this sway-angle) (* 5461.3335 (the float s5-4)))) 48) 48))
|
||||
(vector-rotate-around-axis!
|
||||
(-> s4-1 uvec)
|
||||
(the-as quaternion (-> s4-1 uvec))
|
||||
(-> s4-1 uvec)
|
||||
f0-9
|
||||
(the-as vector (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 s5-4)))
|
||||
)
|
||||
@@ -2067,7 +2062,7 @@
|
||||
5461.3335
|
||||
(vector-cross! s5-1 sv-800 sv-776)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(vector-rotate-around-axis! sv-800 (the-as quaternion sv-776) f28-0 s5-1)
|
||||
(vector-rotate-around-axis! sv-800 sv-776 f28-0 s5-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -2411,7 +2411,7 @@
|
||||
(v1-39 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
|
||||
(v1-40 (the-as number (logior #x3f800000 v1-39)))
|
||||
)
|
||||
(s3-1 s2-2 (the-as quaternion s1-0) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-40)))) *up-vector*)
|
||||
(s3-1 s2-2 s1-0 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-40)))) *up-vector*)
|
||||
)
|
||||
(let ((f0-18 (/ (-> self obj-radius) (meters 4))))
|
||||
0.0
|
||||
|
||||
@@ -210,68 +210,53 @@
|
||||
)
|
||||
|
||||
(defmethod find-and-damage-targets ((this gun-red-3-grenade))
|
||||
(local-vars (v1-21 float) (v1-45 float))
|
||||
(with-pp
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector))
|
||||
(a1-0 (new 'stack-no-clear 'event-message-block))
|
||||
)
|
||||
(set! (-> a1-0 from) (process->ppointer pp))
|
||||
(set! (-> a1-0 num-params) 0)
|
||||
(set! (-> a1-0 message) 'get-vehicle)
|
||||
(let ((s4-0 (send-event-function *target* a1-0)))
|
||||
(vector-copy! s5-0 (-> this root trans))
|
||||
(set! (-> s5-0 w) (-> this blast-radius))
|
||||
(let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 384)))
|
||||
(countdown (s2-0 (fill-actor-list-for-box *actor-hash* s5-0 s3-0 384))
|
||||
(let ((a0-8 (as-type (-> s3-0 s2-0) collide-shape)))
|
||||
(when a0-8
|
||||
(let ((s1-1 (as-type (-> a0-8 process) process-focusable)))
|
||||
(when s1-1
|
||||
(when (and (!= s4-0 s1-1)
|
||||
(not (focus-test? (the-as process-focusable s1-1) disable dead inactive))
|
||||
(pc-check-focus-fix (the-as process-focusable s1-1)) ;; og:preserve-this
|
||||
(logtest? (process-mask crate enemy guard vehicle civilian) (-> s1-1 mask))
|
||||
(nonzero? (-> (the-as process-focusable s1-1) root root-prim prim-core collide-with))
|
||||
)
|
||||
(+! (-> *game-info* shots-hit 1) 1.0)
|
||||
(let ((s0-2
|
||||
(vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s1-1) 3) (-> this root trans))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector))
|
||||
(a1-0 (new 'stack-no-clear 'event-message-block))
|
||||
)
|
||||
(set! (-> a1-0 from) (process->ppointer pp))
|
||||
(set! (-> a1-0 num-params) 0)
|
||||
(set! (-> a1-0 message) 'get-vehicle)
|
||||
(let ((s4-0 (send-event-function *target* a1-0)))
|
||||
(vector-copy! s5-0 (-> this root trans))
|
||||
(set! (-> s5-0 w) (-> this blast-radius))
|
||||
(let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 384)))
|
||||
(countdown (s2-0 (fill-actor-list-for-box *actor-hash* s5-0 s3-0 384))
|
||||
(let ((a0-8 (as-type (-> s3-0 s2-0) collide-shape)))
|
||||
(when a0-8
|
||||
(let ((s1-1 (as-type (-> a0-8 process) process-focusable)))
|
||||
(when s1-1
|
||||
(when (and (!= s4-0 s1-1)
|
||||
(not (focus-test? (the-as process-focusable s1-1) disable dead inactive))
|
||||
(pc-check-focus-fix (the-as process-focusable s1-1)) ;; og:preserve-this
|
||||
(logtest? (process-mask crate enemy guard vehicle civilian) (-> s1-1 mask))
|
||||
(nonzero? (-> (the-as process-focusable s1-1) root root-prim prim-core collide-with))
|
||||
)
|
||||
(+! (-> *game-info* shots-hit 1) 1.0)
|
||||
(let ((s0-2
|
||||
(vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s1-1) 3) (-> this root trans))
|
||||
)
|
||||
)
|
||||
0.0
|
||||
(let ((f0-4 (vector-length-squared s0-2))
|
||||
(f1-1 (-> this blast-radius))
|
||||
)
|
||||
(if (>= (* f1-1 f1-1) f0-4)
|
||||
(send-event
|
||||
s1-1
|
||||
'attack
|
||||
#f
|
||||
(static-attack-info :mask (vehicle-impulse-factor) ((id (-> this attack-id))
|
||||
(damage 12.0)
|
||||
(vehicle-damage-factor 3.0)
|
||||
(vehicle-impulse-factor 1.0)
|
||||
(mode 'explode)
|
||||
(attacker-velocity s0-2)
|
||||
(penetrate-using (penetrate explode))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0.0
|
||||
(.lvf vf1 (&-> s0-2 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-21 vf1)
|
||||
(let ((f0-4 v1-21)
|
||||
(f1-1 (-> this blast-radius))
|
||||
)
|
||||
(if (>= (* f1-1 f1-1) f0-4)
|
||||
(send-event
|
||||
s1-1
|
||||
'attack
|
||||
#f
|
||||
(static-attack-info :mask (vehicle-impulse-factor) ((id (-> this attack-id))
|
||||
(damage 12.0)
|
||||
(vehicle-damage-factor 3.0)
|
||||
(vehicle-impulse-factor 1.0)
|
||||
(mode 'explode)
|
||||
(attacker-velocity s0-2)
|
||||
(penetrate-using (penetrate explode))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -280,44 +265,37 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s3-1 (the-as target (as-type *target* process-focusable))))
|
||||
(when (and s3-1 (< (vector-vector-distance (get-trans s3-1 0) s5-0) (-> s5-0 w)))
|
||||
(when (and (!= s4-0 s3-1)
|
||||
(not (focus-test? s3-1 disable dead inactive))
|
||||
(pc-check-focus-fix (the-as process-focusable s3-1)) ;; og:preserve-this
|
||||
(logtest? (process-mask crate enemy guard vehicle civilian) (-> s3-1 mask))
|
||||
(nonzero? (-> s3-1 control root-prim prim-core collide-with))
|
||||
)
|
||||
(+! (-> *game-info* shots-hit 1) 1.0)
|
||||
(let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (get-trans s3-1 3) (-> this root trans))))
|
||||
0.0
|
||||
(.lvf vf1 (&-> s5-2 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-45 vf1)
|
||||
(let ((f0-12 v1-45)
|
||||
(f1-6 (-> this blast-radius))
|
||||
)
|
||||
(let ((s3-1 (the-as target (as-type *target* process-focusable))))
|
||||
(when (and s3-1 (< (vector-vector-distance (get-trans s3-1 0) s5-0) (-> s5-0 w)))
|
||||
(when (and (!= s4-0 s3-1)
|
||||
(not (focus-test? s3-1 disable dead inactive))
|
||||
(pc-check-focus-fix (the-as process-focusable s3-1)) ;; og:preserve-this
|
||||
(logtest? (process-mask crate enemy guard vehicle civilian) (-> s3-1 mask))
|
||||
(nonzero? (-> s3-1 control root-prim prim-core collide-with))
|
||||
)
|
||||
(+! (-> *game-info* shots-hit 1) 1.0)
|
||||
(let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (get-trans s3-1 3) (-> this root trans))))
|
||||
0.0
|
||||
(let ((f0-12 (vector-length-squared s5-2))
|
||||
(f1-6 (-> this blast-radius))
|
||||
)
|
||||
(if (>= (* f1-6 f1-6) f0-12)
|
||||
(send-event
|
||||
s3-1
|
||||
'attack
|
||||
#f
|
||||
(static-attack-info :mask (vehicle-impulse-factor) ((id (-> this attack-id))
|
||||
(damage 12.0)
|
||||
(vehicle-damage-factor 3.0)
|
||||
(vehicle-impulse-factor 1.0)
|
||||
(mode 'explode)
|
||||
(attacker-velocity s5-2)
|
||||
(penetrate-using (penetrate explode))
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (>= (* f1-6 f1-6) f0-12)
|
||||
(send-event
|
||||
s3-1
|
||||
'attack
|
||||
#f
|
||||
(static-attack-info :mask (vehicle-impulse-factor) ((id (-> this attack-id))
|
||||
(damage 12.0)
|
||||
(vehicle-damage-factor 3.0)
|
||||
(vehicle-impulse-factor 1.0)
|
||||
(mode 'explode)
|
||||
(attacker-velocity s5-2)
|
||||
(penetrate-using (penetrate explode))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -929,126 +907,98 @@
|
||||
|
||||
(defmethod find-collision-point! ((this gun-red-2-shockwave))
|
||||
(local-vars (sv-560 collide-query) (sv-564 int) (sv-608 vector) (sv-612 vector) (sv-616 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(if (>= (-> this next-computed-collision-point) (-> this num-collision-pts-to-generate))
|
||||
(return 0)
|
||||
)
|
||||
(set! sv-560 (new 'stack-no-clear 'collide-query))
|
||||
(set! sv-564 (-> this num-collision-pts-to-generate))
|
||||
(set! sv-608 (new 'stack-no-clear 'vector))
|
||||
(set! sv-612 (new 'stack-no-clear 'vector))
|
||||
(set! sv-616 (/ 65536.0 (the float (+ sv-564 -1))))
|
||||
(let ((f30-1
|
||||
(+ (* sv-616 (the float (-> this generate-order-array (-> this next-computed-collision-point))))
|
||||
(rand-vu-float-range (* -0.43478262 sv-616) (* 0.43478262 sv-616))
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> this eventual-collision-points (-> this next-computed-collision-point) angle) f30-1)
|
||||
(set-vector!
|
||||
sv-608
|
||||
(* (rand-vu-float-range 0.7 0.9) (-> this max-ground-radius) (cos f30-1))
|
||||
32768.0
|
||||
(* (rand-vu-float-range 0.7 0.9) (-> this max-ground-radius) (sin f30-1))
|
||||
1.0
|
||||
)
|
||||
(if (>= (-> this next-computed-collision-point) (-> this num-collision-pts-to-generate))
|
||||
(return 0)
|
||||
)
|
||||
(vector+! (-> sv-560 start-pos) (-> this origin) sv-608)
|
||||
(set! (-> sv-560 start-pos y) (- (-> sv-560 start-pos y) (-> this height-off-ground)))
|
||||
(+! (-> sv-560 start-pos y) 20480.0)
|
||||
(set-vector! (-> sv-560 move-dist) 0.0 -65536.0 0.0 1.0)
|
||||
(let ((v1-29 sv-560))
|
||||
(set! (-> v1-29 radius) 40.96)
|
||||
(set! (-> v1-29 collide-with) (collide-spec backgnd hit-by-others-list pusher impenetrable-obj))
|
||||
(set! (-> v1-29 ignore-process0) #f)
|
||||
(set! (-> v1-29 ignore-process1) #f)
|
||||
(set! (-> v1-29 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-29 action-mask) (collide-action solid))
|
||||
)
|
||||
(let ((f0-25 (fill-and-probe-using-line-sphere *collide-cache* sv-560)))
|
||||
(when (>= f0-25 0.0)
|
||||
(let ((v1-33 sv-612))
|
||||
(let ((a0-17 (-> sv-560 start-pos)))
|
||||
(let ((a1-7 (-> sv-560 move-dist)))
|
||||
(let ((a2-0 f0-25))
|
||||
(.mov vf7 a2-0)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-7 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-17 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-33 quad) vf6)
|
||||
(set! sv-560 (new 'stack-no-clear 'collide-query))
|
||||
(set! sv-564 (-> this num-collision-pts-to-generate))
|
||||
(set! sv-608 (new 'stack-no-clear 'vector))
|
||||
(set! sv-612 (new 'stack-no-clear 'vector))
|
||||
(set! sv-616 (/ 65536.0 (the float (+ sv-564 -1))))
|
||||
(let ((f30-1
|
||||
(+ (* sv-616 (the float (-> this generate-order-array (-> this next-computed-collision-point))))
|
||||
(rand-vu-float-range (* -0.43478262 sv-616) (* 0.43478262 sv-616))
|
||||
)
|
||||
)
|
||||
(set! (-> this eventual-collision-points (-> this next-computed-collision-point) collision-pt quad)
|
||||
(-> sv-612 quad)
|
||||
)
|
||||
(+! (-> this eventual-collision-points (-> this next-computed-collision-point) collision-pt y) 204.8)
|
||||
(set! (-> this eventual-collision-points (-> this next-computed-collision-point) found?) #t)
|
||||
(set! (-> (the-as
|
||||
(pointer uint128)
|
||||
(+ (the-as uint (-> this eventual-collision-points 0 normal)) (* 48 (-> this next-computed-collision-point)))
|
||||
)
|
||||
)
|
||||
(set! (-> this eventual-collision-points (-> this next-computed-collision-point) angle) f30-1)
|
||||
(set-vector!
|
||||
sv-608
|
||||
(* (rand-vu-float-range 0.7 0.9) (-> this max-ground-radius) (cos f30-1))
|
||||
32768.0
|
||||
(* (rand-vu-float-range 0.7 0.9) (-> this max-ground-radius) (sin f30-1))
|
||||
1.0
|
||||
)
|
||||
)
|
||||
(vector+! (-> sv-560 start-pos) (-> this origin) sv-608)
|
||||
(set! (-> sv-560 start-pos y) (- (-> sv-560 start-pos y) (-> this height-off-ground)))
|
||||
(+! (-> sv-560 start-pos y) 20480.0)
|
||||
(set-vector! (-> sv-560 move-dist) 0.0 -65536.0 0.0 1.0)
|
||||
(let ((v1-29 sv-560))
|
||||
(set! (-> v1-29 radius) 40.96)
|
||||
(set! (-> v1-29 collide-with) (collide-spec backgnd hit-by-others-list pusher impenetrable-obj))
|
||||
(set! (-> v1-29 ignore-process0) #f)
|
||||
(set! (-> v1-29 ignore-process1) #f)
|
||||
(set! (-> v1-29 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-29 action-mask) (collide-action solid))
|
||||
)
|
||||
(let ((f0-25 (fill-and-probe-using-line-sphere *collide-cache* sv-560)))
|
||||
(when (>= f0-25 0.0)
|
||||
(vector+*! sv-612 (-> sv-560 start-pos) (-> sv-560 move-dist) f0-25)
|
||||
(set! (-> this eventual-collision-points (-> this next-computed-collision-point) collision-pt quad)
|
||||
(-> sv-612 quad)
|
||||
)
|
||||
(+! (-> this eventual-collision-points (-> this next-computed-collision-point) collision-pt y) 204.8)
|
||||
(set! (-> this eventual-collision-points (-> this next-computed-collision-point) found?) #t)
|
||||
(set! (-> (the-as
|
||||
(pointer uint128)
|
||||
(+ (the-as uint (-> this eventual-collision-points 0 normal)) (* 48 (-> this next-computed-collision-point)))
|
||||
)
|
||||
(-> sv-560 best-other-tri normal quad)
|
||||
)
|
||||
(let ((s5-1 (new 'stack-no-clear 'vector))
|
||||
(s4-0 (new 'stack-no-clear 'vector))
|
||||
(s3-1 (vector-float*! (new 'stack-no-clear 'vector) (-> sv-560 best-other-tri normal) 3072.0))
|
||||
)
|
||||
(let ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> sv-560 best-other-tri normal) 1.0))
|
||||
(s1-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-get-unique! s1-0 s2-0)
|
||||
(vector-cross! s5-1 s2-0 s1-0)
|
||||
(-> sv-560 best-other-tri normal quad)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(dotimes (s2-1 4)
|
||||
(vector-rotate-around-axis!
|
||||
s4-0
|
||||
(the-as quaternion s5-1)
|
||||
(* 16384.0 (the float s2-1))
|
||||
(-> sv-560 best-other-tri normal)
|
||||
)
|
||||
(vector-normalize! s4-0 10240.0)
|
||||
(vector+! s4-0 s4-0 s3-1)
|
||||
(vector+! (-> sv-560 start-pos) sv-612 s4-0)
|
||||
(vector-float*! (-> sv-560 move-dist) (-> sv-560 best-other-tri normal) -6144.0)
|
||||
(let ((v1-59 sv-560))
|
||||
(set! (-> v1-59 radius) 40.96)
|
||||
(set! (-> v1-59 collide-with) (collide-spec backgnd hit-by-others-list pusher impenetrable-obj))
|
||||
(set! (-> v1-59 ignore-process0) #f)
|
||||
(set! (-> v1-59 ignore-process1) #f)
|
||||
(set! (-> v1-59 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-59 action-mask) (collide-action solid))
|
||||
)
|
||||
(when (< (fill-and-probe-using-line-sphere *collide-cache* sv-560) 0.0)
|
||||
(set! (-> this eventual-collision-points (-> this next-computed-collision-point) found?) #f)
|
||||
0
|
||||
(goto cfg-11)
|
||||
(let ((s5-1 (new 'stack-no-clear 'vector))
|
||||
(s4-0 (new 'stack-no-clear 'vector))
|
||||
(s3-1 (vector-float*! (new 'stack-no-clear 'vector) (-> sv-560 best-other-tri normal) 3072.0))
|
||||
)
|
||||
(let ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> sv-560 best-other-tri normal) 1.0))
|
||||
(s1-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-get-unique! s1-0 s2-0)
|
||||
(vector-cross! s5-1 s2-0 s1-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(dotimes (s2-1 4)
|
||||
(vector-rotate-around-axis! s4-0 s5-1 (* 16384.0 (the float s2-1)) (-> sv-560 best-other-tri normal))
|
||||
(vector-normalize! s4-0 10240.0)
|
||||
(vector+! s4-0 s4-0 s3-1)
|
||||
(vector+! (-> sv-560 start-pos) sv-612 s4-0)
|
||||
(vector-float*! (-> sv-560 move-dist) (-> sv-560 best-other-tri normal) -6144.0)
|
||||
(let ((v1-60 sv-560))
|
||||
(set! (-> v1-60 radius) 40.96)
|
||||
(set! (-> v1-60 collide-with) (collide-spec backgnd hit-by-others-list pusher impenetrable-obj))
|
||||
(set! (-> v1-60 ignore-process0) #f)
|
||||
(set! (-> v1-60 ignore-process1) #f)
|
||||
(set! (-> v1-60 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-60 action-mask) (collide-action solid))
|
||||
)
|
||||
(when (< (fill-and-probe-using-line-sphere *collide-cache* sv-560) 0.0)
|
||||
(set! (-> this eventual-collision-points (-> this next-computed-collision-point) found?) #f)
|
||||
0
|
||||
(goto cfg-11)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(label cfg-11)
|
||||
(let ((v0-0 (+ (-> this next-computed-collision-point) 1)))
|
||||
(set! (-> this next-computed-collision-point) v0-0)
|
||||
v0-0
|
||||
)
|
||||
)
|
||||
(label cfg-11)
|
||||
(let ((v0-0 (+ (-> this next-computed-collision-point) 1)))
|
||||
(set! (-> this next-computed-collision-point) v0-0)
|
||||
v0-0
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1922,85 +1872,63 @@
|
||||
|
||||
;; WARN: Return type mismatch (pointer process) vs object.
|
||||
(defbehavior gun-fire-red-1 target ()
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((gp-0 (-> self gun)))
|
||||
(let ((s5-0 (-> *part-id-table* 216)))
|
||||
(get-field-spec-by-id s5-0 (sp-field-id spt-omega))
|
||||
(let ((s5-1 (get-field-spec-by-id s5-0 (sp-field-id spt-rotate-y))))
|
||||
(if s5-1
|
||||
(set! (-> s5-1 initial-valuef) (y-angle (-> self control)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(launch-particles (-> *part-id-table* 216) (-> gp-0 fire-point))
|
||||
(let ((s5-2 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-10 (-> gp-0 fire-point)))
|
||||
(let ((a0-4 (-> gp-0 fire-dir-out)))
|
||||
(let ((a1-4 24576.0))
|
||||
(.mov vf7 a1-4)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-4 quad))
|
||||
(let ((gp-0 (-> self gun)))
|
||||
(let ((s5-0 (-> *part-id-table* 216)))
|
||||
(get-field-spec-by-id s5-0 (sp-field-id spt-omega))
|
||||
(let ((s5-1 (get-field-spec-by-id s5-0 (sp-field-id spt-rotate-y))))
|
||||
(if s5-1
|
||||
(set! (-> s5-1 initial-valuef) (y-angle (-> self control)))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-10 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s5-2 quad) vf6)
|
||||
(set! (-> s5-2 w) 24576.0)
|
||||
(when (and (sphere-in-view-frustum? (the-as sphere s5-2))
|
||||
(< 24576.0 (vector-vector-distance s5-2 (math-camera-pos)))
|
||||
)
|
||||
(let ((s5-3
|
||||
(process-spawn
|
||||
manipy
|
||||
:init manipy-init
|
||||
(-> gp-0 fire-point)
|
||||
(-> self entity)
|
||||
(art-group-get-by-name *level* "skel-gun-red-cone" (the-as (pointer level) #f))
|
||||
#f
|
||||
0
|
||||
:name "manipy"
|
||||
:to self
|
||||
:stack-size #x20000
|
||||
)
|
||||
)
|
||||
)
|
||||
(launch-particles (-> *part-id-table* 216) (-> gp-0 fire-point))
|
||||
(let ((s5-3 (vector+*! (new 'stack-no-clear 'vector) (-> gp-0 fire-point) (-> gp-0 fire-dir-out) 24576.0)))
|
||||
(set! (-> s5-3 w) 24576.0)
|
||||
(when (and (sphere-in-view-frustum? (the-as sphere s5-3))
|
||||
(< 24576.0 (vector-vector-distance s5-3 (math-camera-pos)))
|
||||
)
|
||||
(let ((s5-4
|
||||
(process-spawn
|
||||
manipy
|
||||
:init manipy-init
|
||||
(-> gp-0 fire-point)
|
||||
(-> self entity)
|
||||
(art-group-get-by-name *level* "skel-gun-red-cone" (the-as (pointer level) #f))
|
||||
#f
|
||||
0
|
||||
:name "manipy"
|
||||
:to self
|
||||
:stack-size #x20000
|
||||
)
|
||||
)
|
||||
(when s5-3
|
||||
(send-event (ppointer->process s5-3) 'anim-mode 'play1)
|
||||
(send-event (ppointer->process s5-3) 'anim "idle")
|
||||
(forward-up->quaternion (-> (the-as manipy (-> s5-3 0)) root quat) (-> gp-0 fire-dir-out) *up-vector*)
|
||||
(let ((f30-1
|
||||
(vector-dot
|
||||
(-> gp-0 fire-dir-out)
|
||||
(vector-! (new 'stack-no-clear 'vector) (-> gp-0 fire-point) (math-camera-pos))
|
||||
)
|
||||
)
|
||||
(when s5-4
|
||||
(send-event (ppointer->process s5-4) 'anim-mode 'play1)
|
||||
(send-event (ppointer->process s5-4) 'anim "idle")
|
||||
(forward-up->quaternion (-> (the-as manipy (-> s5-4 0)) root quat) (-> gp-0 fire-dir-out) *up-vector*)
|
||||
(let ((f30-1
|
||||
(vector-dot
|
||||
(-> gp-0 fire-dir-out)
|
||||
(vector-! (new 'stack-no-clear 'vector) (-> gp-0 fire-point) (math-camera-pos))
|
||||
)
|
||||
(f0-5 (vector-vector-xz-distance (-> gp-0 fire-point) (math-camera-pos)))
|
||||
)
|
||||
(when (and (< f30-1 0.0) (< f0-5 32768.0))
|
||||
(set! (-> (the-as manipy (-> s5-3 0)) root scale z) (lerp-scale 0.2 1.0 (fabs f0-5) 20480.0 32768.0))
|
||||
(set! (-> (the-as manipy (-> s5-3 0)) root scale x) (-> (the-as manipy (-> s5-3 0)) root scale z))
|
||||
(f0-5 (vector-vector-xz-distance (-> gp-0 fire-point) (math-camera-pos)))
|
||||
)
|
||||
(when (and (< f30-1 0.0) (< f0-5 32768.0))
|
||||
(set! (-> (the-as manipy (-> s5-4 0)) root scale z) (lerp-scale 0.2 1.0 (fabs f0-5) 20480.0 32768.0))
|
||||
(set! (-> (the-as manipy (-> s5-4 0)) root scale x) (-> (the-as manipy (-> s5-4 0)) root scale z))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(process-spawn
|
||||
gun-red-shot
|
||||
(-> gp-0 fire-point)
|
||||
(-> gp-0 fire-dir-out)
|
||||
:name "gun-red-shot"
|
||||
:to (ppointer->process (-> gp-0 gun))
|
||||
)
|
||||
)
|
||||
(process-spawn
|
||||
gun-red-shot
|
||||
(-> gp-0 fire-point)
|
||||
(-> gp-0 fire-dir-out)
|
||||
:name "gun-red-shot"
|
||||
:to (ppointer->process (-> gp-0 gun))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1059,63 +1059,41 @@
|
||||
)
|
||||
|
||||
(defmethod projectile-method-25 ((this gun-yellow-shot))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let* ((s4-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(gp-1 (vector-! (new 'stack-no-clear 'vector) s4-0 a1-0))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((s4-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(gp-1 (vector-! (new 'stack-no-clear 'vector) s4-0 a1-0))
|
||||
)
|
||||
(let ((f30-0 (vector-length gp-1)))
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-4 a1-0))
|
||||
(let ((a0-2 gp-1))
|
||||
(let ((a2-1 0.8))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-2 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s3-0 quad) vf6)
|
||||
(draw-main-shot this a1-0 gp-1)
|
||||
(vector-normalize! gp-1 1.0)
|
||||
(spawn-particles this s3-0)
|
||||
)
|
||||
(let ((s3-1 (new 'stack-no-clear 'matrix))
|
||||
(f30-1 (fmin 1.0 (/ f30-0 (meters 16))))
|
||||
(f28-0 (-> *part-id-table* 267 init-specs 3 initial-valuef))
|
||||
)
|
||||
(forward-up->inv-matrix s3-1 gp-1 *up-vector*)
|
||||
(vector-copy! (-> s3-1 trans) s4-0)
|
||||
(gun-yellow-shot-method-42 this f30-1 f28-0 s3-1)
|
||||
)
|
||||
(let ((f30-0 (vector-length gp-1)))
|
||||
(let ((s3-1 (vector+*! (new 'stack-no-clear 'vector) a1-0 gp-1 0.8)))
|
||||
(draw-main-shot this a1-0 gp-1)
|
||||
(vector-normalize! gp-1 1.0)
|
||||
(spawn-particles this s3-1)
|
||||
)
|
||||
(let ((f0-3 (vector-dot gp-1 (-> (camera-matrix) fvec))))
|
||||
(when (< 0.0 f0-3)
|
||||
(let ((f2-0 (* f0-3 f0-3))
|
||||
(f0-4 (-> *part-id-table* 266 init-specs 8 initial-valuef))
|
||||
(f1-3 (-> *part-id-table* 266 init-specs 8 random-rangef))
|
||||
)
|
||||
(set! (-> *part-id-table* 266 init-specs 8 initial-valuef) (* f0-4 f2-0))
|
||||
(set! (-> *part-id-table* 266 init-specs 8 random-rangef) (* f1-3 f2-0))
|
||||
(set! (-> *part-id-table* 266 init-specs 8 initial-valuef) f0-4)
|
||||
(set! (-> *part-id-table* 266 init-specs 8 random-rangef) f1-3)
|
||||
(let ((s3-2 (new 'stack-no-clear 'matrix))
|
||||
(f30-1 (fmin 1.0 (/ f30-0 (meters 16))))
|
||||
(f28-0 (-> *part-id-table* 267 init-specs 3 initial-valuef))
|
||||
)
|
||||
(forward-up->inv-matrix s3-2 gp-1 *up-vector*)
|
||||
(vector-copy! (-> s3-2 trans) s4-0)
|
||||
(gun-yellow-shot-method-42 this f30-1 f28-0 s3-2)
|
||||
)
|
||||
)
|
||||
(let ((f0-3 (vector-dot gp-1 (-> (camera-matrix) fvec))))
|
||||
(when (< 0.0 f0-3)
|
||||
(let ((f2-0 (* f0-3 f0-3))
|
||||
(f0-4 (-> *part-id-table* 266 init-specs 8 initial-valuef))
|
||||
(f1-3 (-> *part-id-table* 266 init-specs 8 random-rangef))
|
||||
)
|
||||
(set! (-> *part-id-table* 266 init-specs 8 initial-valuef) (* f0-4 f2-0))
|
||||
(set! (-> *part-id-table* 266 init-specs 8 random-rangef) (* f1-3 f2-0))
|
||||
(set! (-> *part-id-table* 266 init-specs 8 initial-valuef) f0-4)
|
||||
(set! (-> *part-id-table* 266 init-specs 8 random-rangef) f1-3)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod deal-damage! ((this gun-yellow-shot) (arg0 process) (arg1 event-message-block))
|
||||
@@ -1960,49 +1938,27 @@
|
||||
)
|
||||
|
||||
(defmethod projectile-method-25 ((this gun-yellow-shot-2))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let* ((s5-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s4-1 (vector-! (new 'stack-no-clear 'vector) s5-0 a1-0))
|
||||
(f30-0 (vector-length s4-1))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((s5-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s4-1 (vector-! (new 'stack-no-clear 'vector) s5-0 a1-0))
|
||||
(f30-0 (vector-length s4-1))
|
||||
)
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-4 a1-0))
|
||||
(let ((a0-2 s4-1))
|
||||
(let ((a2-1 0.8))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-2 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s3-0 quad) vf6)
|
||||
(draw-main-shot this a1-0 s4-1)
|
||||
(vector-normalize! s4-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 270) s3-0)
|
||||
)
|
||||
(let ((s3-1 (new 'stack-no-clear 'matrix))
|
||||
(f30-1 (fmin 1.0 (/ f30-0 (meters 16))))
|
||||
(f28-0 (-> *part-id-table* 267 init-specs 3 initial-valuef))
|
||||
)
|
||||
(forward-up->inv-matrix s3-1 s4-1 *up-vector*)
|
||||
(vector-copy! (-> s3-1 trans) s5-0)
|
||||
(gun-yellow-shot-method-42 this f30-1 f28-0 s3-1)
|
||||
)
|
||||
(let ((s3-1 (vector+*! (new 'stack-no-clear 'vector) a1-0 s4-1 0.8)))
|
||||
(draw-main-shot this a1-0 s4-1)
|
||||
(vector-normalize! s4-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 270) s3-1)
|
||||
)
|
||||
(let ((s3-2 (new 'stack-no-clear 'matrix))
|
||||
(f30-1 (fmin 1.0 (/ f30-0 (meters 16))))
|
||||
(f28-0 (-> *part-id-table* 267 init-specs 3 initial-valuef))
|
||||
)
|
||||
(forward-up->inv-matrix s3-2 s4-1 *up-vector*)
|
||||
(vector-copy! (-> s3-2 trans) s5-0)
|
||||
(gun-yellow-shot-method-42 this f30-1 f28-0 s3-2)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod spawn-particles ((this gun-yellow-shot) (arg0 vector))
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
)
|
||||
(set! (-> v1-0 action-mask) (collide-action solid))
|
||||
)
|
||||
(set! (-> gp-0 start-pos quad) (-> self control trans quad))
|
||||
(vector-copy! (-> gp-0 start-pos) (-> self control trans))
|
||||
(vector-reset! (-> gp-0 move-dist))
|
||||
(set! (-> gp-0 move-dist y) 40960.0)
|
||||
(when (not (and (>= (fill-and-probe-using-line-sphere *collide-cache* gp-0) 0.0)
|
||||
@@ -236,7 +236,7 @@
|
||||
)
|
||||
:post (behavior ()
|
||||
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> gp-0 quad) (-> self control trans quad))
|
||||
(vector-copy! gp-0 (-> self control trans))
|
||||
(let ((a0-0 (-> self state parent)))
|
||||
(when a0-0
|
||||
(let ((t9-0 (-> a0-0 post)))
|
||||
@@ -272,9 +272,10 @@
|
||||
(go target-indax-hang-dodge)
|
||||
)
|
||||
(when (and (turn-around?) (time-elapsed? (-> self state-time) (seconds 0.3)))
|
||||
(set! (-> self control transv quad)
|
||||
(-> self control transv-history (-> self control idx-of-fastest-xz-vel) quad)
|
||||
)
|
||||
(vector-copy!
|
||||
(-> self control transv)
|
||||
(-> self control transv-history (-> self control idx-of-fastest-xz-vel))
|
||||
)
|
||||
(set! (-> self control transv w) 1.0)
|
||||
(go target-indax-hang-turn-around)
|
||||
)
|
||||
@@ -290,7 +291,7 @@
|
||||
(ja-channel-push! 1 (seconds 0.05))
|
||||
(ja-no-eval :group! jakb-dummy-59-ja :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 1.0)
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
@@ -403,7 +404,7 @@
|
||||
(ja-channel-push! 1 (seconds 0.05))
|
||||
(ja-no-eval :group! jakb-ladder-stance-ja :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(let ((v1-19 (and (>= (ja-aframe-num 0) 4.0) (>= 9.0 (ja-aframe-num 0)))))
|
||||
(if v1-19
|
||||
(align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 1.0)
|
||||
@@ -462,11 +463,11 @@
|
||||
(ja-channel-push! 1 (seconds 0.04))
|
||||
(ja :group! jakb-ladder-get-on-ja :num! min)
|
||||
(quaternion-rotate-y! (-> self control dir-targ) (-> self control dir-targ) 32768.0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(until (ja-done? 0)
|
||||
(suspend)
|
||||
(ja :num! (seek! max 2.0))
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
|
||||
)
|
||||
(remove-exit)
|
||||
|
||||
@@ -1148,7 +1148,7 @@
|
||||
(ja-channel-push! 1 (seconds 0.02))
|
||||
(ja-no-eval :group! daxter-indax-trip-ja :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-y-vel adjust-xz-vel) 1.0 1.0 2.0)
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
@@ -1180,7 +1180,7 @@
|
||||
(ja-no-eval :group! gp-0 :num! (seek! max (-> self control current-surface align-speed)) :frame-num 0.0)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
|
||||
;; og:preserve-this - High FPS Fix
|
||||
(when (and (recently-pressed? x)
|
||||
@@ -1219,7 +1219,7 @@
|
||||
(ja-no-eval :group! gp-0 :num! (seek! max (-> self control current-surface align-speed)) :frame-num 0.0)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
|
||||
;; og:preserve-this - High FPS Fix
|
||||
(when (and (recently-pressed? x)
|
||||
@@ -1264,7 +1264,7 @@
|
||||
(f28-0 1.0)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(when (not (ja-min? 0))
|
||||
(cond
|
||||
((and (>= (ja-aframe-num 0) 20.0)
|
||||
|
||||
@@ -1391,265 +1391,145 @@
|
||||
)
|
||||
|
||||
(defun leg-ik-callback ((arg0 joint-mod-ik) (arg1 object) (arg2 object) (arg3 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-0 arg3)
|
||||
(let ((f0-1 (- (-> arg3 y) (-> (target-pos 0) y))))
|
||||
(if (< 1228.8 f0-1)
|
||||
(set! f0-1 1228.8)
|
||||
)
|
||||
(if (< f0-1 409.6)
|
||||
(set! f0-1 409.6)
|
||||
)
|
||||
(+! (-> arg0 user-position y) f0-1)
|
||||
)
|
||||
(let* ((f0-4
|
||||
(vector-dot (-> arg0 user-normal) (vector-! (new 'stack-no-clear 'vector) arg3 (-> arg0 user-position)))
|
||||
)
|
||||
(f30-1 (lerp-scale 1.0 0.0 f0-4 0.0 2048.0))
|
||||
(s3-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((v1-13 s5-0))
|
||||
(let ((a0-4 (-> arg0 user-normal)))
|
||||
(let ((a1-4 4096.0))
|
||||
(.mov vf7 a1-4)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-4 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-13 quad))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-0 arg3)
|
||||
(let ((f0-1 (- (-> arg3 y) (-> (target-pos 0) y))))
|
||||
(if (< 1228.8 f0-1)
|
||||
(set! f0-1 1228.8)
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s3-0 quad) vf6)
|
||||
(vector-float*! (new 'stack-no-clear 'vector) (-> arg0 user-normal) -8192.0)
|
||||
(let ((s4-1 (new 'stack-no-clear 'vector)))
|
||||
0.0
|
||||
(let ((f0-8 (intersect-ray-plane s3-0 (-> arg0 user-normal) (-> arg0 user-position) (-> arg0 user-normal)))
|
||||
(a0-7 s4-1)
|
||||
)
|
||||
(let ((v1-16 (-> arg0 user-normal)))
|
||||
(let ((a1-7 f0-8))
|
||||
(.mov vf7 a1-7)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-16 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> s3-0 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-7 quad) vf6)
|
||||
)
|
||||
(let ((a1-8 s4-1))
|
||||
(let ((v1-17 s4-1))
|
||||
(let ((a0-8 (-> arg0 user-normal)))
|
||||
(let ((a2-6
|
||||
(- (vector-dot (-> arg0 user-normal) (vector-! (new 'stack-no-clear 'vector) s4-1 (-> arg0 user-position))))
|
||||
)
|
||||
)
|
||||
(.mov vf7 a2-6)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-8 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-17 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-8 quad) vf6)
|
||||
)
|
||||
(let ((a1-9 s5-0))
|
||||
(let ((v1-18 s5-0))
|
||||
(let ((a0-10 (vector-! (new 'stack-no-clear 'vector) s4-1 s5-0)))
|
||||
(let ((a2-9 (fmin 1.0 (* (-> arg0 user-blend) f30-1))))
|
||||
(.mov vf7 a2-9)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-10 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-18 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-9 quad) vf6)
|
||||
)
|
||||
(if (< f0-1 409.6)
|
||||
(set! f0-1 409.6)
|
||||
)
|
||||
)
|
||||
(set-ik-target! arg0 s5-0)
|
||||
(+! (-> arg0 user-position y) f0-1)
|
||||
)
|
||||
(none)
|
||||
(let* ((f0-4
|
||||
(vector-dot (-> arg0 user-normal) (vector-! (new 'stack-no-clear 'vector) arg3 (-> arg0 user-position)))
|
||||
)
|
||||
(f30-1 (lerp-scale 1.0 0.0 f0-4 0.0 2048.0))
|
||||
(s3-1 (vector+*! (new 'stack-no-clear 'vector) s5-0 (-> arg0 user-normal) 4096.0))
|
||||
)
|
||||
(vector-float*! (new 'stack-no-clear 'vector) (-> arg0 user-normal) -8192.0)
|
||||
(let ((s4-1 (new 'stack-no-clear 'vector)))
|
||||
0.0
|
||||
(let ((f0-8 (intersect-ray-plane s3-1 (-> arg0 user-normal) (-> arg0 user-position) (-> arg0 user-normal))))
|
||||
(vector+*! s4-1 s3-1 (-> arg0 user-normal) f0-8)
|
||||
)
|
||||
(vector+*!
|
||||
s4-1
|
||||
s4-1
|
||||
(-> arg0 user-normal)
|
||||
(- (vector-dot (-> arg0 user-normal) (vector-! (new 'stack-no-clear 'vector) s4-1 (-> arg0 user-position))))
|
||||
)
|
||||
(vector+*!
|
||||
s5-0
|
||||
s5-0
|
||||
(vector-! (new 'stack-no-clear 'vector) s4-1 s5-0)
|
||||
(fmin 1.0 (* (-> arg0 user-blend) f30-1))
|
||||
)
|
||||
)
|
||||
)
|
||||
(set-ik-target! arg0 s5-0)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defbehavior target-update-ik target ()
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((gp-0 (new 'stack-no-clear 'collide-query)))
|
||||
(let ((v1-0 (-> gp-0 bbox))
|
||||
(a0-1 (-> self control trans))
|
||||
(a1-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> a1-0 x) 8192.0)
|
||||
(set! (-> a1-0 y) 6144.0)
|
||||
(set! (-> a1-0 z) 8192.0)
|
||||
(set! (-> a1-0 w) 1.0)
|
||||
(vector-! (-> v1-0 min) a0-1 a1-0)
|
||||
)
|
||||
(let ((v1-2 (-> gp-0 bbox max))
|
||||
(a0-3 (-> self control trans))
|
||||
(a1-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> a1-1 x) 8192.0)
|
||||
(set! (-> a1-1 y) 6144.0)
|
||||
(set! (-> a1-1 z) 8192.0)
|
||||
(set! (-> a1-1 w) 1.0)
|
||||
(vector+! v1-2 a0-3 a1-1)
|
||||
)
|
||||
(set! (-> gp-0 collide-with) (-> self control root-prim prim-core collide-with))
|
||||
(set! (-> gp-0 ignore-process0) self)
|
||||
(set! (-> gp-0 ignore-process1) #f)
|
||||
(set! (-> gp-0 ignore-pat) (-> self control pat-ignore-mask))
|
||||
(fill-using-bounding-box *collide-cache* gp-0)
|
||||
(dotimes (s5-0 2)
|
||||
(let ((a1-4 (not (or (logtest? (target-flags lleg-no-ik rleg-no-ik) (-> self target-flags))
|
||||
(and (logtest? (-> self control mod-surface flags) (surface-flag air))
|
||||
(not (logtest? (-> self control status) (collide-status on-surface)))
|
||||
)
|
||||
(focus-test? self edge-grab pole flut pilot mech)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(enable-set! (-> self leg-ik s5-0) a1-4)
|
||||
(let ((gp-0 (new 'stack-no-clear 'collide-query)))
|
||||
(let ((v1-0 (-> gp-0 bbox))
|
||||
(a0-1 (-> self control trans))
|
||||
(a1-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-copy! (-> self foot s5-0 twist-max) (-> self control ground-contact-normal))
|
||||
(vector-copy! (-> self foot s5-0 trans) (-> self control gspot-pos))
|
||||
(vector-y-quaternion! (-> self foot s5-0 target) (-> self control quat-for-control))
|
||||
(set! (-> self foot s5-0 flex-blend) (if (if (zero? s5-0)
|
||||
(logtest? (target-flags lleg-no-ik) (-> self target-flags))
|
||||
(logtest? (target-flags rleg-no-ik) (-> self target-flags))
|
||||
)
|
||||
0.0
|
||||
1.0
|
||||
)
|
||||
)
|
||||
(-> self leg-ik s5-0 shoulder-matrix-no-ik)
|
||||
(let ((v1-51 (-> self leg-ik s5-0 elbow-matrix-no-ik))
|
||||
(s2-0 (new 'stack-no-clear 'vector))
|
||||
(s1-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-copy! s1-0 *y-vector*)
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
||||
(new 'stack-no-clear 'vector)
|
||||
(new 'stack-no-clear 'vector)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((a2-8 s2-0))
|
||||
(let ((a0-27 (-> v1-51 trans)))
|
||||
(let ((a1-8 (-> v1-51 uvec)))
|
||||
(let ((a3-3 (-> self leg-ik s5-0 hand-dist)))
|
||||
(.mov vf7 a3-3)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-8 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-27 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a2-8 quad) vf6)
|
||||
)
|
||||
(let ((a1-9 s2-0))
|
||||
(let ((a0-28 (-> v1-51 trans)))
|
||||
(let ((v1-52 (-> v1-51 uvec)))
|
||||
(let ((a2-12 (-> self leg-ik s5-0 hand-dist)))
|
||||
(.mov vf7 a2-12)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-52 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-28 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-9 quad) vf6)
|
||||
)
|
||||
(let ((f0-13 (lerp-scale 1.0 0.0 (- (-> s2-0 y) (-> self control gspot-pos y)) 819.2 2048.0)))
|
||||
(seek! (-> self leg-ik s5-0 user-blend) f0-13 (* 4.0 (seconds-per-frame)))
|
||||
)
|
||||
(let ((a1-12 (-> gp-0 start-pos)))
|
||||
(let ((v1-63 s2-0))
|
||||
(let ((a0-31 s1-0))
|
||||
(let ((a2-16 4096.0))
|
||||
(.mov vf7 a2-16)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-31 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-63 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-12 quad) vf6)
|
||||
)
|
||||
(vector-float*! (-> gp-0 move-dist) s1-0 -8192.0)
|
||||
(let ((v1-66 gp-0))
|
||||
(set! (-> v1-66 radius) 4.096)
|
||||
(set! (-> v1-66 collide-with) (-> gp-0 collide-with))
|
||||
(set! (-> v1-66 ignore-process0) #f)
|
||||
(set! (-> v1-66 ignore-process1) #f)
|
||||
(set! (-> v1-66 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-66 action-mask) (collide-action solid))
|
||||
)
|
||||
(let ((f30-0 (probe-using-line-sphere *collide-cache* gp-0)))
|
||||
(cond
|
||||
((and (>= f30-0 0.0) (< 0.5 (-> gp-0 best-other-tri normal y)))
|
||||
(vector-copy! s4-0 (-> gp-0 best-other-tri normal))
|
||||
(when (< 8192.0 (vector-vector-angle-safe *y-vector* s4-0))
|
||||
(let* ((a1-17 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) *y-vector* s4-0) 1.0))
|
||||
(a2-18 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-17 8192.0))
|
||||
)
|
||||
(vector-orient-by-quat! s4-0 *y-vector* a2-18)
|
||||
)
|
||||
)
|
||||
(let ((a1-19 s3-0))
|
||||
(let ((v1-77 (-> gp-0 start-pos)))
|
||||
(let ((a0-45 (-> gp-0 move-dist)))
|
||||
(let ((a2-19 f30-0))
|
||||
(.mov vf7 a2-19)
|
||||
(set! (-> a1-0 x) 8192.0)
|
||||
(set! (-> a1-0 y) 6144.0)
|
||||
(set! (-> a1-0 z) 8192.0)
|
||||
(set! (-> a1-0 w) 1.0)
|
||||
(vector-! (-> v1-0 min) a0-1 a1-0)
|
||||
)
|
||||
(let ((v1-2 (-> gp-0 bbox max))
|
||||
(a0-3 (-> self control trans))
|
||||
(a1-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> a1-1 x) 8192.0)
|
||||
(set! (-> a1-1 y) 6144.0)
|
||||
(set! (-> a1-1 z) 8192.0)
|
||||
(set! (-> a1-1 w) 1.0)
|
||||
(vector+! v1-2 a0-3 a1-1)
|
||||
)
|
||||
(set! (-> gp-0 collide-with) (-> self control root-prim prim-core collide-with))
|
||||
(set! (-> gp-0 ignore-process0) self)
|
||||
(set! (-> gp-0 ignore-process1) #f)
|
||||
(set! (-> gp-0 ignore-pat) (-> self control pat-ignore-mask))
|
||||
(fill-using-bounding-box *collide-cache* gp-0)
|
||||
(dotimes (s5-0 2)
|
||||
(let ((a1-4 (not (or (logtest? (target-flags lleg-no-ik rleg-no-ik) (-> self target-flags))
|
||||
(and (logtest? (-> self control mod-surface flags) (surface-flag air))
|
||||
(not (logtest? (-> self control status) (collide-status on-surface)))
|
||||
)
|
||||
(focus-test? self edge-grab pole flut pilot mech)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-45 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-77 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-19 quad) vf6)
|
||||
)
|
||||
(vector-copy! (-> self leg-ik s5-0 user-position) s3-0)
|
||||
(vector-copy! (-> self leg-ik s5-0 user-normal) s4-0)
|
||||
(vector-copy! (-> self foot s5-0 twist-max) s4-0)
|
||||
)
|
||||
(else
|
||||
(vector-copy! (-> self leg-ik s5-0 user-position) s2-0)
|
||||
(vector-copy! (-> self leg-ik s5-0 user-normal) *y-vector*)
|
||||
(vector-copy! (-> self foot s5-0 twist-max) *y-vector*)
|
||||
)
|
||||
)
|
||||
(enable-set! (-> self leg-ik s5-0) a1-4)
|
||||
)
|
||||
(vector-copy! (-> self foot s5-0 twist-max) (-> self control ground-contact-normal))
|
||||
(vector-copy! (-> self foot s5-0 trans) (-> self control gspot-pos))
|
||||
(vector-y-quaternion! (-> self foot s5-0 target) (-> self control quat-for-control))
|
||||
(set! (-> self foot s5-0 flex-blend) (if (if (zero? s5-0)
|
||||
(logtest? (target-flags lleg-no-ik) (-> self target-flags))
|
||||
(logtest? (target-flags rleg-no-ik) (-> self target-flags))
|
||||
)
|
||||
0.0
|
||||
1.0
|
||||
)
|
||||
)
|
||||
(-> self leg-ik s5-0 shoulder-matrix-no-ik)
|
||||
(let ((v1-51 (-> self leg-ik s5-0 elbow-matrix-no-ik))
|
||||
(s2-0 (new 'stack-no-clear 'vector))
|
||||
(s1-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-copy! s1-0 *y-vector*)
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector)))
|
||||
(new 'stack-no-clear 'vector)
|
||||
(new 'stack-no-clear 'vector)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(vector+*! s2-0 (-> v1-51 trans) (-> v1-51 uvec) (-> self leg-ik s5-0 hand-dist))
|
||||
(vector+*! s2-0 (-> v1-51 trans) (-> v1-51 uvec) (-> self leg-ik s5-0 hand-dist))
|
||||
(let ((f0-13 (lerp-scale 1.0 0.0 (- (-> s2-0 y) (-> self control gspot-pos y)) 819.2 2048.0)))
|
||||
(seek! (-> self leg-ik s5-0 user-blend) f0-13 (* 4.0 (seconds-per-frame)))
|
||||
)
|
||||
(vector+*! (-> gp-0 start-pos) s2-0 s1-0 4096.0)
|
||||
(vector-float*! (-> gp-0 move-dist) s1-0 -8192.0)
|
||||
(let ((v1-66 gp-0))
|
||||
(set! (-> v1-66 radius) 4.096)
|
||||
(set! (-> v1-66 collide-with) (-> gp-0 collide-with))
|
||||
(set! (-> v1-66 ignore-process0) #f)
|
||||
(set! (-> v1-66 ignore-process1) #f)
|
||||
(set! (-> v1-66 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-66 action-mask) (collide-action solid))
|
||||
)
|
||||
(let ((f30-0 (probe-using-line-sphere *collide-cache* gp-0)))
|
||||
(cond
|
||||
((and (>= f30-0 0.0) (< 0.5 (-> gp-0 best-other-tri normal y)))
|
||||
(vector-copy! s4-0 (-> gp-0 best-other-tri normal))
|
||||
(when (< 8192.0 (vector-vector-angle-safe *y-vector* s4-0))
|
||||
(let* ((a1-19 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) *y-vector* s4-0) 1.0))
|
||||
(a2-17 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-19 8192.0))
|
||||
)
|
||||
(vector-orient-by-quat! s4-0 *y-vector* a2-17)
|
||||
)
|
||||
)
|
||||
(vector+*! s3-0 (-> gp-0 start-pos) (-> gp-0 move-dist) f30-0)
|
||||
(vector-copy! (-> self leg-ik s5-0 user-position) s3-0)
|
||||
(vector-copy! (-> self leg-ik s5-0 user-normal) s4-0)
|
||||
(vector-copy! (-> self foot s5-0 twist-max) s4-0)
|
||||
)
|
||||
(else
|
||||
(vector-copy! (-> self leg-ik s5-0 user-position) s2-0)
|
||||
(vector-copy! (-> self leg-ik s5-0 user-normal) *y-vector*)
|
||||
(vector-copy! (-> self foot s5-0 twist-max) *y-vector*)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1657,9 +1537,9 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defbehavior pre-collide-setup target ()
|
||||
|
||||
@@ -134,71 +134,50 @@
|
||||
)
|
||||
|
||||
(defun mech-spawn-thruster ((arg0 mech-info) (arg1 vector) (arg2 vector) (arg3 float) (arg4 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(set! (-> arg0 part-thruster) (-> *part-id-table* 1037))
|
||||
(set! (-> arg0 part-thruster-scale-x) (-> *part-id-table* 1037 init-specs 4))
|
||||
(set! (-> arg0 part-thruster-scale-y) (-> *part-id-table* 1037 init-specs 5))
|
||||
(let ((s1-0 (new 'stack-no-clear 'quaternion))
|
||||
(s0-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(forward-up->quaternion s1-0 arg2 (new 'static 'vector :y 1.0 :w 1.0))
|
||||
(quaternion-rotate-local-x! s1-0 s1-0 32768.0)
|
||||
(let ((a0-3 s0-0))
|
||||
(let ((v1-10 arg1))
|
||||
(let ((a1-4 (/ arg4 2)))
|
||||
(.mov vf7 a1-4)
|
||||
)
|
||||
(.lvf vf5 (&-> arg2 quad))
|
||||
(.lvf vf4 (&-> v1-10 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-3 quad) vf6)
|
||||
(set! (-> arg0 part-thruster) (-> *part-id-table* 1037))
|
||||
(set! (-> arg0 part-thruster-scale-x) (-> *part-id-table* 1037 init-specs 4))
|
||||
(set! (-> arg0 part-thruster-scale-y) (-> *part-id-table* 1037 init-specs 5))
|
||||
(let ((s1-0 (new 'stack-no-clear 'quaternion))
|
||||
(s0-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> arg0 part-thruster-scale-x initial-valuef) arg3)
|
||||
(set! (-> arg0 part-thruster-scale-y initial-valuef) arg4)
|
||||
(dotimes (s4-1 2)
|
||||
(quaternion-rotate-local-z! s1-0 s1-0 16384.0)
|
||||
(quaternion-copy! (-> arg0 part-quat) s1-0)
|
||||
(let ((t9-4 sp-launch-particles-var)
|
||||
(a0-6 (-> arg0 particle-system-3d))
|
||||
(a1-7 (-> arg0 part-thruster))
|
||||
(a2-4 *launch-matrix*)
|
||||
)
|
||||
(vector-copy! (-> a2-4 trans) s0-0)
|
||||
(t9-4
|
||||
(the-as sparticle-system a0-6)
|
||||
a1-7
|
||||
a2-4
|
||||
(the-as sparticle-launch-state #f)
|
||||
(the-as sparticle-launch-control #f)
|
||||
1.0
|
||||
(forward-up->quaternion s1-0 arg2 (new 'static 'vector :y 1.0 :w 1.0))
|
||||
(quaternion-rotate-local-x! s1-0 s1-0 32768.0)
|
||||
(vector+*! s0-0 arg1 arg2 (/ arg4 2))
|
||||
(set! (-> arg0 part-thruster-scale-x initial-valuef) arg3)
|
||||
(set! (-> arg0 part-thruster-scale-y initial-valuef) arg4)
|
||||
(dotimes (s4-1 2)
|
||||
(quaternion-rotate-local-z! s1-0 s1-0 16384.0)
|
||||
(quaternion-copy! (-> arg0 part-quat) s1-0)
|
||||
(let ((t9-4 sp-launch-particles-var)
|
||||
(a0-7 (-> arg0 particle-system-3d))
|
||||
(a1-6 (-> arg0 part-thruster))
|
||||
(a2-4 *launch-matrix*)
|
||||
)
|
||||
(vector-copy! (-> a2-4 trans) s0-0)
|
||||
(t9-4
|
||||
(the-as sparticle-system a0-7)
|
||||
a1-6
|
||||
a2-4
|
||||
(the-as sparticle-launch-state #f)
|
||||
(the-as sparticle-launch-control #f)
|
||||
1.0
|
||||
)
|
||||
)
|
||||
)
|
||||
(launch-particles (-> *part-id-table* 1043) arg1)
|
||||
(launch-particles (-> *part-id-table* 1038) arg1)
|
||||
(cond
|
||||
((!= (-> *setting-control* user-current under-water-pitch-mod) 0.0)
|
||||
(launch-particles (-> *part-id-table* 1043) arg1)
|
||||
)
|
||||
(else
|
||||
(launch-particles (-> *part-id-table* 1039) arg1)
|
||||
(launch-particles (-> *part-id-table* 1041) arg1)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
(launch-particles (-> *part-id-table* 1043) arg1)
|
||||
(launch-particles (-> *part-id-table* 1038) arg1)
|
||||
(cond
|
||||
((!= (-> *setting-control* user-current under-water-pitch-mod) 0.0)
|
||||
(launch-particles (-> *part-id-table* 1043) arg1)
|
||||
)
|
||||
(else
|
||||
(launch-particles (-> *part-id-table* 1039) arg1)
|
||||
(launch-particles (-> *part-id-table* 1041) arg1)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defpart 1045
|
||||
|
||||
@@ -549,7 +549,7 @@
|
||||
)
|
||||
(target-mech-punch-pick (the-as symbol gp-0))
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(when (and (not (focus-test? self dangerous))
|
||||
(let ((v1-10 (ja-group)))
|
||||
(and v1-10 (or (= v1-10 jakb-mech-punch-l-ja)
|
||||
|
||||
@@ -905,237 +905,131 @@
|
||||
|
||||
;; WARN: Return type mismatch none vs object.
|
||||
(defbehavior mech-leg-ik-callback target ((arg0 joint-mod-ik) (arg1 matrix) (arg2 matrix) (arg3 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-0 arg3)
|
||||
(let ((f0-1 (- (-> arg3 y) (-> (target-pos 0) y))))
|
||||
(if (< 6144.0 f0-1)
|
||||
(set! f0-1 6144.0)
|
||||
)
|
||||
(if (< f0-1 -6144.0)
|
||||
(set! f0-1 -6144.0)
|
||||
)
|
||||
(+! (-> arg0 user-position y) f0-1)
|
||||
)
|
||||
(let ((f0-4 (- (-> arg3 y) (-> arg0 user-position y))))
|
||||
(seek! (-> arg0 user-float) f0-4 (* 40960.0 (seconds-per-frame)))
|
||||
)
|
||||
(let* ((f28-0 (-> arg0 user-float))
|
||||
(f30-1 (lerp-scale 1.0 0.0 f28-0 0.0 12288.0))
|
||||
(s3-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((v1-12 s5-0))
|
||||
(let ((a0-4 *up-vector*))
|
||||
(let ((a1-4 8192.0))
|
||||
(.mov vf7 a1-4)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-4 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-12 quad))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-0 arg3)
|
||||
(let ((f0-1 (- (-> arg3 y) (-> (target-pos 0) y))))
|
||||
(if (< 6144.0 f0-1)
|
||||
(set! f0-1 6144.0)
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s3-0 quad) vf6)
|
||||
(vector-float*! (new 'stack-no-clear 'vector) *up-vector* -16384.0)
|
||||
(let ((s2-0 (new 'stack-no-clear 'vector)))
|
||||
0.0
|
||||
(let ((f0-11 (intersect-ray-plane s3-0 *up-vector* (-> arg0 user-position) *up-vector*))
|
||||
(a0-7 s2-0)
|
||||
)
|
||||
(let ((v1-15 *up-vector*))
|
||||
(let ((a1-7 f0-11))
|
||||
(.mov vf7 a1-7)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-15 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> s3-0 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-7 quad) vf6)
|
||||
)
|
||||
(let ((a0-8 s2-0))
|
||||
(let ((v1-16 *up-vector*))
|
||||
(let ((a1-8 (- f28-0)))
|
||||
(.mov vf7 a1-8)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-16 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> arg3 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-8 quad) vf6)
|
||||
)
|
||||
(let ((a1-9 s5-0))
|
||||
(let ((v1-17 s5-0))
|
||||
(let ((a0-10 (vector-! (new 'stack-no-clear 'vector) s2-0 s5-0)))
|
||||
(let ((a2-6 (fmin 1.0 (* (-> arg0 user-blend) f30-1))))
|
||||
(.mov vf7 a2-6)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-10 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-17 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-9 quad) vf6)
|
||||
)
|
||||
(if (< f0-1 -6144.0)
|
||||
(set! f0-1 -6144.0)
|
||||
)
|
||||
)
|
||||
(set-ik-target! arg0 s5-0)
|
||||
(+! (-> arg0 user-position y) f0-1)
|
||||
)
|
||||
(let ((f0-4 (- (-> arg3 y) (-> arg0 user-position y))))
|
||||
(seek! (-> arg0 user-float) f0-4 (* 40960.0 (seconds-per-frame)))
|
||||
)
|
||||
(let* ((f28-0 (-> arg0 user-float))
|
||||
(f30-1 (lerp-scale 1.0 0.0 f28-0 0.0 12288.0))
|
||||
(s3-1 (vector+*! (new 'stack-no-clear 'vector) s5-0 *up-vector* 8192.0))
|
||||
)
|
||||
(vector-float*! (new 'stack-no-clear 'vector) *up-vector* -16384.0)
|
||||
(let ((s2-0 (new 'stack-no-clear 'vector)))
|
||||
0.0
|
||||
(let ((f0-11 (intersect-ray-plane s3-1 *up-vector* (-> arg0 user-position) *up-vector*)))
|
||||
(vector+*! s2-0 s3-1 *up-vector* f0-11)
|
||||
)
|
||||
(vector+*! s2-0 arg3 *up-vector* (- f28-0))
|
||||
(vector+*!
|
||||
s5-0
|
||||
s5-0
|
||||
(vector-! (new 'stack-no-clear 'vector) s2-0 s5-0)
|
||||
(fmin 1.0 (* (-> arg0 user-blend) f30-1))
|
||||
)
|
||||
)
|
||||
)
|
||||
(set-ik-target! arg0 s5-0)
|
||||
)
|
||||
)
|
||||
|
||||
(defbehavior mech-update-ik target ()
|
||||
(local-vars (sv-720 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((gp-0 (new 'stack-no-clear 'collide-query))
|
||||
(s5-0 (-> (the-as process-drawable (-> self parent 0)) root))
|
||||
(let ((gp-0 (new 'stack-no-clear 'collide-query))
|
||||
(s5-0 (-> (the-as process-drawable (-> self parent 0)) root))
|
||||
)
|
||||
(let ((a1-0 (-> gp-0 bbox))
|
||||
(v1-2 (-> s5-0 trans))
|
||||
(a0-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((a1-0 (-> gp-0 bbox))
|
||||
(v1-2 (-> s5-0 trans))
|
||||
(a0-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> a0-0 x) 10240.0)
|
||||
(set! (-> a0-0 y) 10240.0)
|
||||
(set! (-> a0-0 z) 10240.0)
|
||||
(set! (-> a0-0 w) 1.0)
|
||||
(vector-! (-> a1-0 min) v1-2 a0-0)
|
||||
)
|
||||
(let ((a1-2 (-> gp-0 bbox max))
|
||||
(v1-3 (-> s5-0 trans))
|
||||
(a0-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> a0-1 x) 10240.0)
|
||||
(set! (-> a0-1 y) 10240.0)
|
||||
(set! (-> a0-1 z) 10240.0)
|
||||
(set! (-> a0-1 w) 1.0)
|
||||
(vector+! a1-2 v1-3 a0-1)
|
||||
)
|
||||
(set! (-> gp-0 collide-with) (-> (the-as collide-shape s5-0) root-prim prim-core collide-with))
|
||||
(set! (-> gp-0 ignore-process0) #f)
|
||||
(set! (-> gp-0 ignore-process1) #f)
|
||||
(set! (-> gp-0 ignore-pat) (-> (the-as collide-shape s5-0) pat-ignore-mask))
|
||||
(fill-using-bounding-box *collide-cache* gp-0)
|
||||
(dotimes (s4-0 2)
|
||||
(let ((s3-0 (-> self mech-ik s4-0)))
|
||||
#t
|
||||
(set! (-> s3-0 callback) mech-leg-ik-callback)
|
||||
(-> s3-0 shoulder-matrix-no-ik)
|
||||
(let ((v1-13 (-> s3-0 elbow-matrix-no-ik))
|
||||
(s0-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! sv-720 (new 'stack-no-clear 'vector))
|
||||
(let ((a0-5 (-> *y-vector* quad)))
|
||||
(set! (-> sv-720 quad) a0-5)
|
||||
(set! (-> a0-0 x) 10240.0)
|
||||
(set! (-> a0-0 y) 10240.0)
|
||||
(set! (-> a0-0 z) 10240.0)
|
||||
(set! (-> a0-0 w) 1.0)
|
||||
(vector-! (-> a1-0 min) v1-2 a0-0)
|
||||
)
|
||||
(let ((a1-2 (-> gp-0 bbox max))
|
||||
(v1-3 (-> s5-0 trans))
|
||||
(a0-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> a0-1 x) 10240.0)
|
||||
(set! (-> a0-1 y) 10240.0)
|
||||
(set! (-> a0-1 z) 10240.0)
|
||||
(set! (-> a0-1 w) 1.0)
|
||||
(vector+! a1-2 v1-3 a0-1)
|
||||
)
|
||||
(set! (-> gp-0 collide-with) (-> (the-as collide-shape s5-0) root-prim prim-core collide-with))
|
||||
(set! (-> gp-0 ignore-process0) #f)
|
||||
(set! (-> gp-0 ignore-process1) #f)
|
||||
(set! (-> gp-0 ignore-pat) (-> (the-as collide-shape s5-0) pat-ignore-mask))
|
||||
(fill-using-bounding-box *collide-cache* gp-0)
|
||||
(dotimes (s4-0 2)
|
||||
(let ((s3-0 (-> self mech-ik s4-0)))
|
||||
#t
|
||||
(set! (-> s3-0 callback) mech-leg-ik-callback)
|
||||
(-> s3-0 shoulder-matrix-no-ik)
|
||||
(let ((v1-13 (-> s3-0 elbow-matrix-no-ik))
|
||||
(s0-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((s2-0 (new 'stack-no-clear 'vector)))
|
||||
(new 'stack-no-clear 'vector)
|
||||
(new 'stack-no-clear 'vector)
|
||||
(let ((s1-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((a1-6 s0-0))
|
||||
(let ((a0-8 (-> v1-13 trans)))
|
||||
(let ((v1-14 (-> v1-13 uvec)))
|
||||
(let ((a2-8 (-> s3-0 hand-dist)))
|
||||
(.mov vf7 a2-8)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-14 quad))
|
||||
(set! sv-720 (new 'stack-no-clear 'vector))
|
||||
(let ((a0-5 (-> *y-vector* quad)))
|
||||
(set! (-> sv-720 quad) a0-5)
|
||||
)
|
||||
(let ((s2-0 (new 'stack-no-clear 'vector)))
|
||||
(new 'stack-no-clear 'vector)
|
||||
(new 'stack-no-clear 'vector)
|
||||
(let ((s1-0 (new 'stack-no-clear 'vector)))
|
||||
(vector+*! s0-0 (-> v1-13 trans) (-> v1-13 uvec) (-> s3-0 hand-dist))
|
||||
(let ((f0-11
|
||||
(lerp-scale 1.0 0.0 (- (-> s0-0 y) (-> (the-as collide-shape-moving s5-0) gspot-pos y)) 2048.0 12288.0)
|
||||
)
|
||||
(.lvf vf4 (&-> a0-8 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-6 quad) vf6)
|
||||
)
|
||||
(let ((f0-11
|
||||
(lerp-scale 1.0 0.0 (- (-> s0-0 y) (-> (the-as collide-shape-moving s5-0) gspot-pos y)) 2048.0 12288.0)
|
||||
)
|
||||
)
|
||||
(seek! (-> s3-0 user-blend) f0-11 (* 4.0 (seconds-per-frame)))
|
||||
)
|
||||
(let ((a1-9 (-> gp-0 start-pos)))
|
||||
(let ((v1-18 s0-0))
|
||||
(let ((a0-11 sv-720))
|
||||
(let ((a2-12 6144.0))
|
||||
(.mov vf7 a2-12)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-11 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-18 quad))
|
||||
(seek! (-> s3-0 user-blend) f0-11 (* 4.0 (seconds-per-frame)))
|
||||
)
|
||||
(vector+*! (-> gp-0 start-pos) s0-0 sv-720 6144.0)
|
||||
(let ((v1-19 (-> gp-0 move-dist))
|
||||
(f0-16 -20480.0)
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-9 quad) vf6)
|
||||
)
|
||||
(let ((v1-19 (-> gp-0 move-dist))
|
||||
(f0-16 -20480.0)
|
||||
(vector-float*! v1-19 sv-720 f0-16)
|
||||
)
|
||||
(let ((v1-21 gp-0))
|
||||
(set! (-> v1-21 radius) 4.096)
|
||||
(set! (-> v1-21 collide-with) (-> gp-0 collide-with))
|
||||
(set! (-> v1-21 ignore-process0) #f)
|
||||
(set! (-> v1-21 ignore-process1) #f)
|
||||
(set! (-> v1-21 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(vector-float*! v1-19 sv-720 f0-16)
|
||||
)
|
||||
(let ((v1-21 gp-0))
|
||||
(set! (-> v1-21 radius) 4.096)
|
||||
(set! (-> v1-21 collide-with) (-> gp-0 collide-with))
|
||||
(set! (-> v1-21 ignore-process0) #f)
|
||||
(set! (-> v1-21 ignore-process1) #f)
|
||||
(set! (-> v1-21 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-21 action-mask) (collide-action solid))
|
||||
)
|
||||
(let ((f30-0 (probe-using-line-sphere *collide-cache* gp-0)))
|
||||
(cond
|
||||
((>= f30-0 0.0)
|
||||
(vector-copy! s1-0 (-> gp-0 best-other-tri normal))
|
||||
(when (< 8192.0 (vector-vector-angle-safe *y-vector* s1-0))
|
||||
(let* ((a1-14 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) *y-vector* s1-0) 1.0))
|
||||
(a2-14 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-14 8192.0))
|
||||
)
|
||||
(vector-orient-by-quat! s1-0 *y-vector* a2-14)
|
||||
)
|
||||
(set! (-> v1-21 action-mask) (collide-action solid))
|
||||
)
|
||||
(let ((f30-0 (probe-using-line-sphere *collide-cache* gp-0)))
|
||||
(cond
|
||||
((>= f30-0 0.0)
|
||||
(vector-copy! s1-0 (-> gp-0 best-other-tri normal))
|
||||
(when (< 8192.0 (vector-vector-angle-safe *y-vector* s1-0))
|
||||
(let* ((a1-16 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) *y-vector* s1-0) 1.0))
|
||||
(a2-12 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-16 8192.0))
|
||||
)
|
||||
(vector-orient-by-quat! s1-0 *y-vector* a2-12)
|
||||
)
|
||||
(let ((a1-16 s2-0))
|
||||
(let ((v1-28 (-> gp-0 start-pos)))
|
||||
(let ((a0-26 (-> gp-0 move-dist)))
|
||||
(let ((a2-15 f30-0))
|
||||
(.mov vf7 a2-15)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-26 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-28 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-16 quad) vf6)
|
||||
)
|
||||
(vector-copy! (-> s3-0 user-position) s2-0)
|
||||
(vector-copy! (-> s3-0 user-normal) s1-0)
|
||||
)
|
||||
(else
|
||||
(set! (-> s0-0 y) (-> (target-pos 0) y))
|
||||
(vector-copy! (-> s3-0 user-position) s0-0)
|
||||
(vector-copy! (-> s3-0 user-normal) *y-vector*)
|
||||
)
|
||||
(vector+*! s2-0 (-> gp-0 start-pos) (-> gp-0 move-dist) f30-0)
|
||||
(vector-copy! (-> s3-0 user-position) s2-0)
|
||||
(vector-copy! (-> s3-0 user-normal) s1-0)
|
||||
)
|
||||
(else
|
||||
(set! (-> s0-0 y) (-> (target-pos 0) y))
|
||||
(vector-copy! (-> s3-0 user-position) s0-0)
|
||||
(vector-copy! (-> s3-0 user-normal) *y-vector*)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1144,9 +1038,9 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
|
||||
@@ -395,22 +395,11 @@
|
||||
:exit target-pilot-exit
|
||||
:trans target-pilot-trans
|
||||
:code (behavior ()
|
||||
(local-vars (v1-1 float) (v1-196 int))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(local-vars (v1-196 int))
|
||||
(rlet ((vf0 :class vf))
|
||||
(init-vf0-vector)
|
||||
(let ((gp-0 (-> self pilot)))
|
||||
(.lvf vf1 (&-> (-> gp-0 local-accel) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-1 vf1)
|
||||
(let ((f0-0 v1-1)
|
||||
(let ((f0-0 (vector-length-squared (-> gp-0 local-accel)))
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-copy! s5-0 (-> gp-0 local-accel))
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
(if (and gp-0 (using-gun? self))
|
||||
(goto cfg-43)
|
||||
)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
@@ -1322,7 +1322,7 @@
|
||||
(set! (-> s5-0 frame-num) 0.0)
|
||||
(joint-control-channel-group! s5-0 (the-as art-joint-anim jakb-flop-down-land-ja) num-func-seek!)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align!
|
||||
(-> self align)
|
||||
(if arg1
|
||||
@@ -1756,7 +1756,7 @@
|
||||
(set! (-> self control unknown-sound-id01) (sound-play "spin-kick"))
|
||||
(ja-no-eval :group! jakb-attack-from-jump-ja :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
|
||||
@@ -1347,7 +1347,7 @@
|
||||
(the-as (pointer int64) (& sv-40))
|
||||
)
|
||||
)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(when (not (ja-min? 0))
|
||||
(cond
|
||||
((and (>= (ja-frame-num 0) 20.0)
|
||||
@@ -1980,7 +1980,7 @@
|
||||
(set-setting! 'ambient-volume 'rel 0.0 0)
|
||||
(ja-no-eval :group! (-> self draw art-group data 466) :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-y-vel) 1.0 1.0 1.0)
|
||||
(set! (-> self alt-cam-pos x) (-> self control trans x))
|
||||
(set! (-> self alt-cam-pos z) (-> self control trans z))
|
||||
@@ -2325,7 +2325,7 @@
|
||||
(set! (-> self neck flex-blend) 0.0)
|
||||
(set-setting! 'music-volume 'rel 0.0 0)
|
||||
(set-setting! 'ambient-volume 'rel 0.0 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(set-action!
|
||||
*gui-control*
|
||||
(gui-action play)
|
||||
@@ -2340,7 +2340,7 @@
|
||||
(ja-no-eval :num! (seek! max f0-1))
|
||||
)
|
||||
(while (not (ja-done? 0))
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(set! (-> self control turn-go-the-long-way) 1.0)
|
||||
(set! (-> self darkjak clock-vel) -4.0)
|
||||
(set! (-> self darkjak clock-on) #t)
|
||||
@@ -2461,7 +2461,7 @@
|
||||
(ja-no-eval :group! (-> self draw art-group data 471) :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(ja-blend-eval)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(set! (-> self control turn-go-the-long-way) 1.0)
|
||||
(set! (-> self darkjak clock-vel) 4.0)
|
||||
(suspend)
|
||||
|
||||
@@ -228,175 +228,138 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defbehavior apply-pos-from-entity target ((arg0 continue-point))
|
||||
(local-vars (sv-1328 collide-query))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s1-0 (entity-by-name (the-as string (-> arg0 on-goto)))))
|
||||
(cond
|
||||
(s1-0
|
||||
(entity-birth-no-kill s1-0)
|
||||
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
|
||||
(set! (-> a1-0 from) (process->ppointer self))
|
||||
(set! (-> a1-0 num-params) 0)
|
||||
(set! (-> a1-0 message) 'apply-pos-from-entity)
|
||||
(let ((t9-2 send-event-function)
|
||||
(v1-2 s1-0)
|
||||
)
|
||||
(t9-2
|
||||
(if v1-2
|
||||
(-> v1-2 extra process)
|
||||
)
|
||||
a1-0
|
||||
(let ((s1-0 (entity-by-name (the-as string (-> arg0 on-goto)))))
|
||||
(cond
|
||||
(s1-0
|
||||
(entity-birth-no-kill s1-0)
|
||||
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
|
||||
(set! (-> a1-0 from) (process->ppointer self))
|
||||
(set! (-> a1-0 num-params) 0)
|
||||
(set! (-> a1-0 message) 'apply-pos-from-entity)
|
||||
(let ((t9-2 send-event-function)
|
||||
(v1-2 s1-0)
|
||||
)
|
||||
(t9-2
|
||||
(if v1-2
|
||||
(-> v1-2 extra process)
|
||||
)
|
||||
a1-0
|
||||
)
|
||||
)
|
||||
(let ((s0-0 (-> s1-0 extra perm)))
|
||||
(logior! (-> s0-0 status) (entity-perm-status bit-5))
|
||||
(let ((s2-0 (new 'stack-no-clear 'vector))
|
||||
(s3-0 (new 'stack-no-clear 'vector))
|
||||
(s4-0 (new 'stack-no-clear 'vector))
|
||||
(s5-0 (new 'stack-no-clear 'matrix))
|
||||
)
|
||||
(let ((s0-0 (-> s1-0 extra perm)))
|
||||
(logior! (-> s0-0 status) (entity-perm-status bit-5))
|
||||
(let ((s2-0 (new 'stack-no-clear 'vector))
|
||||
(s3-0 (new 'stack-no-clear 'vector))
|
||||
(s4-0 (new 'stack-no-clear 'vector))
|
||||
(s5-0 (new 'stack-no-clear 'matrix))
|
||||
)
|
||||
(set! (-> s2-0 x) (* 4096.0 (the float (-> s0-0 user-int16 0))))
|
||||
(set! (-> s2-0 y) (-> s1-0 extra trans y))
|
||||
(set! (-> s2-0 z) (* 4096.0 (the float (-> s0-0 user-int16 1))))
|
||||
(set! sv-1328 (new 'stack-no-clear 'collide-query))
|
||||
(set-vector! (-> sv-1328 move-dist) 0.0 -204800.0 0.0 1.0)
|
||||
(vector-copy! (-> sv-1328 start-pos) s2-0)
|
||||
(+! (-> sv-1328 start-pos y) 102400.0)
|
||||
(let ((v1-20 sv-1328))
|
||||
(set! (-> v1-20 radius) 409.6)
|
||||
(set! (-> v1-20 collide-with) (collide-spec backgnd))
|
||||
(set! (-> v1-20 ignore-process0) #f)
|
||||
(set! (-> v1-20 ignore-process1) #f)
|
||||
(set! (-> v1-20 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-20 action-mask) (collide-action solid))
|
||||
)
|
||||
(let ((f0-12 (fill-and-probe-using-line-sphere *collide-cache* sv-1328)))
|
||||
(cond
|
||||
((>= f0-12 0.0)
|
||||
(vector+*! s2-0 (-> sv-1328 start-pos) (-> sv-1328 move-dist) f0-12)
|
||||
(set! (-> s2-0 y) (+ 4096.0 (-> s2-0 y)))
|
||||
)
|
||||
(else
|
||||
(format 0 "failed to find gem ground on pos-from-entity~%")
|
||||
)
|
||||
(set! (-> s2-0 x) (* 4096.0 (the float (-> s0-0 user-int16 0))))
|
||||
(set! (-> s2-0 y) (-> s1-0 extra trans y))
|
||||
(set! (-> s2-0 z) (* 4096.0 (the float (-> s0-0 user-int16 1))))
|
||||
(set! sv-1328 (new 'stack-no-clear 'collide-query))
|
||||
(set-vector! (-> sv-1328 move-dist) 0.0 -204800.0 0.0 1.0)
|
||||
(vector-copy! (-> sv-1328 start-pos) s2-0)
|
||||
(+! (-> sv-1328 start-pos y) 102400.0)
|
||||
(let ((v1-20 sv-1328))
|
||||
(set! (-> v1-20 radius) 409.6)
|
||||
(set! (-> v1-20 collide-with) (collide-spec backgnd))
|
||||
(set! (-> v1-20 ignore-process0) #f)
|
||||
(set! (-> v1-20 ignore-process1) #f)
|
||||
(set! (-> v1-20 ignore-pat)
|
||||
)
|
||||
)
|
||||
(set! (-> s3-0 x) (* 4096.0 (the float (-> s0-0 user-int16 2))))
|
||||
(set! (-> s3-0 y) (-> s1-0 extra trans y))
|
||||
(set! (-> s3-0 z) (* 4096.0 (the float (-> s0-0 user-int16 3))))
|
||||
(let ((s1-1 (new 'stack-no-clear 'collide-query)))
|
||||
(set-vector! (-> s1-1 move-dist) 0.0 -204800.0 0.0 1.0)
|
||||
(vector-copy! (-> s1-1 start-pos) s3-0)
|
||||
(+! (-> s1-1 start-pos y) 102400.0)
|
||||
(let ((v1-34 s1-1))
|
||||
(set! (-> v1-34 radius) 409.6)
|
||||
(set! (-> v1-34 collide-with) (collide-spec backgnd))
|
||||
(set! (-> v1-34 ignore-process0) #f)
|
||||
(set! (-> v1-34 ignore-process1) #f)
|
||||
(set! (-> v1-34 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-20 action-mask) (collide-action solid))
|
||||
(set! (-> v1-34 action-mask) (collide-action solid))
|
||||
)
|
||||
(let ((f0-12 (fill-and-probe-using-line-sphere *collide-cache* sv-1328)))
|
||||
(let ((f0-27 (fill-and-probe-using-line-sphere *collide-cache* s1-1)))
|
||||
(cond
|
||||
((>= f0-12 0.0)
|
||||
(let ((v1-22 s2-0))
|
||||
(let ((a0-15 (-> sv-1328 start-pos)))
|
||||
(let ((a1-3 (-> sv-1328 move-dist)))
|
||||
(let ((a2-0 f0-12))
|
||||
(.mov vf7 a2-0)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-3 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-15 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-22 quad) vf6)
|
||||
)
|
||||
(set! (-> s2-0 y) (+ 4096.0 (-> s2-0 y)))
|
||||
((>= f0-27 0.0)
|
||||
(vector+*! s3-0 (-> s1-1 start-pos) (-> s1-1 move-dist) f0-27)
|
||||
(set! (-> s3-0 y) (+ 4096.0 (-> s3-0 y)))
|
||||
)
|
||||
(else
|
||||
(format 0 "failed to find gem ground on pos-from-entity~%")
|
||||
(format 0 "failed to find jak ground on pos-from-entity~%")
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> s3-0 x) (* 4096.0 (the float (-> s0-0 user-int16 2))))
|
||||
(set! (-> s3-0 y) (-> s1-0 extra trans y))
|
||||
(set! (-> s3-0 z) (* 4096.0 (the float (-> s0-0 user-int16 3))))
|
||||
(let ((s1-1 (new 'stack-no-clear 'collide-query)))
|
||||
(set-vector! (-> s1-1 move-dist) 0.0 -204800.0 0.0 1.0)
|
||||
(vector-copy! (-> s1-1 start-pos) s3-0)
|
||||
(+! (-> s1-1 start-pos y) 102400.0)
|
||||
(let ((v1-33 s1-1))
|
||||
(set! (-> v1-33 radius) 409.6)
|
||||
(set! (-> v1-33 collide-with) (collide-spec backgnd))
|
||||
(set! (-> v1-33 ignore-process0) #f)
|
||||
(set! (-> v1-33 ignore-process1) #f)
|
||||
(set! (-> v1-33 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-33 action-mask) (collide-action solid))
|
||||
)
|
||||
(let ((f0-27 (fill-and-probe-using-line-sphere *collide-cache* s1-1)))
|
||||
(cond
|
||||
((>= f0-27 0.0)
|
||||
(let ((a0-26 s3-0))
|
||||
(let ((v1-35 (-> s1-1 start-pos)))
|
||||
(let ((a1-6 (-> s1-1 move-dist)))
|
||||
(let ((a2-1 f0-27))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-6 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-35 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-26 quad) vf6)
|
||||
)
|
||||
(set! (-> s3-0 y) (+ 4096.0 (-> s3-0 y)))
|
||||
)
|
||||
(else
|
||||
(format 0 "failed to find jak ground on pos-from-entity~%")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(vector-copy! (-> arg0 trans) s3-0)
|
||||
(vector-! s4-0 s3-0 s2-0)
|
||||
(set! (-> s4-0 y) 16384.0)
|
||||
(vector+! (-> arg0 camera-trans) s4-0 s3-0)
|
||||
(vector-negate! s4-0 s4-0)
|
||||
(set! (-> s4-0 y) 0.0)
|
||||
(vector-normalize! s4-0 1.0)
|
||||
(let ((s3-1 (new 'stack-no-clear 'quaternion)))
|
||||
(quaternion-from-two-vectors! s3-1 (new 'static 'vector :z 1.0) s4-0)
|
||||
(quaternion->matrix s5-0 s3-1)
|
||||
(set-vector!
|
||||
(-> arg0 quat)
|
||||
(the int (* 32767.0 (-> s3-1 x)))
|
||||
(the int (* 32767.0 (-> s3-1 y)))
|
||||
(the int (* 32767.0 (-> s3-1 z)))
|
||||
(the int (* 32767.0 (-> s3-1 w)))
|
||||
)
|
||||
)
|
||||
(set! (-> arg0 camera-rot 0) (the int (* 32767.0 (-> s5-0 rvec x))))
|
||||
(set! (-> arg0 camera-rot 1) (the int (* 32767.0 (-> s5-0 rvec y))))
|
||||
(set! (-> arg0 camera-rot 2) (the int (* 32767.0 (-> s5-0 rvec z))))
|
||||
(set! (-> arg0 camera-rot 3) (the int (* 32767.0 (-> s5-0 uvec x))))
|
||||
(set! (-> arg0 camera-rot 4) (the int (* 32767.0 (-> s5-0 uvec y))))
|
||||
(set! (-> arg0 camera-rot 5) (the int (* 32767.0 (-> s5-0 uvec z))))
|
||||
(set! (-> arg0 camera-rot 6) (the int (* 32767.0 (-> s5-0 fvec x))))
|
||||
(set! (-> arg0 camera-rot 7) (the int (* 32767.0 (-> s5-0 fvec y))))
|
||||
(set! (-> arg0 camera-rot 8) (the int (* 32767.0 (-> s5-0 fvec z))))
|
||||
)
|
||||
)
|
||||
(let ((t9-11 quaternion-copy!)
|
||||
(a0-46 (-> self control quat-for-control))
|
||||
(a1-12 (new 'stack-no-clear 'quaternion))
|
||||
(vector-copy! (-> arg0 trans) s3-0)
|
||||
(vector-! s4-0 s3-0 s2-0)
|
||||
(set! (-> s4-0 y) 16384.0)
|
||||
(vector+! (-> arg0 camera-trans) s4-0 s3-0)
|
||||
(vector-negate! s4-0 s4-0)
|
||||
(set! (-> s4-0 y) 0.0)
|
||||
(vector-normalize! s4-0 1.0)
|
||||
(let ((s3-1 (new 'stack-no-clear 'quaternion)))
|
||||
(quaternion-from-two-vectors! s3-1 (new 'static 'vector :z 1.0) s4-0)
|
||||
(quaternion->matrix s5-0 s3-1)
|
||||
(set-vector!
|
||||
(-> arg0 quat)
|
||||
(the int (* 32767.0 (-> s3-1 x)))
|
||||
(the int (* 32767.0 (-> s3-1 y)))
|
||||
(the int (* 32767.0 (-> s3-1 z)))
|
||||
(the int (* 32767.0 (-> s3-1 w)))
|
||||
)
|
||||
(set! (-> a1-12 x) (* 0.00003051851 (the float (-> arg0 quat x))))
|
||||
(set! (-> a1-12 y) (* 0.00003051851 (the float (-> arg0 quat y))))
|
||||
(set! (-> a1-12 z) (* 0.00003051851 (the float (-> arg0 quat z))))
|
||||
(set! (-> a1-12 w) (* 0.00003051851 (the float (-> arg0 quat w))))
|
||||
(t9-11 a0-46 a1-12)
|
||||
)
|
||||
(set! (-> arg0 camera-rot 0) (the int (* 32767.0 (-> s5-0 rvec x))))
|
||||
(set! (-> arg0 camera-rot 1) (the int (* 32767.0 (-> s5-0 rvec y))))
|
||||
(set! (-> arg0 camera-rot 2) (the int (* 32767.0 (-> s5-0 rvec z))))
|
||||
(set! (-> arg0 camera-rot 3) (the int (* 32767.0 (-> s5-0 uvec x))))
|
||||
(set! (-> arg0 camera-rot 4) (the int (* 32767.0 (-> s5-0 uvec y))))
|
||||
(set! (-> arg0 camera-rot 5) (the int (* 32767.0 (-> s5-0 uvec z))))
|
||||
(set! (-> arg0 camera-rot 6) (the int (* 32767.0 (-> s5-0 fvec x))))
|
||||
(set! (-> arg0 camera-rot 7) (the int (* 32767.0 (-> s5-0 fvec y))))
|
||||
(set! (-> arg0 camera-rot 8) (the int (* 32767.0 (-> s5-0 fvec z))))
|
||||
)
|
||||
(move-to-point! (-> self control) (-> arg0 trans))
|
||||
(rot->dir-targ! (-> self control))
|
||||
(vector-copy! (-> self control camera-pos) (-> self control trans))
|
||||
)
|
||||
(else
|
||||
(format 0 "ERROR: failed to find '~S' for pos-from-entity~%" (-> arg0 on-goto))
|
||||
(let ((t9-11 quaternion-copy!)
|
||||
(a0-47 (-> self control quat-for-control))
|
||||
(a1-12 (new 'stack-no-clear 'quaternion))
|
||||
)
|
||||
(set! (-> a1-12 x) (* 0.00003051851 (the float (-> arg0 quat x))))
|
||||
(set! (-> a1-12 y) (* 0.00003051851 (the float (-> arg0 quat y))))
|
||||
(set! (-> a1-12 z) (* 0.00003051851 (the float (-> arg0 quat z))))
|
||||
(set! (-> a1-12 w) (* 0.00003051851 (the float (-> arg0 quat w))))
|
||||
(t9-11 a0-47 a1-12)
|
||||
)
|
||||
(move-to-point! (-> self control) (-> arg0 trans))
|
||||
(rot->dir-targ! (-> self control))
|
||||
(vector-copy! (-> self control camera-pos) (-> self control trans))
|
||||
)
|
||||
(else
|
||||
(format 0 "ERROR: failed to find '~S' for pos-from-entity~%" (-> arg0 on-goto))
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defbehavior target-continue-init-art target ()
|
||||
@@ -1814,7 +1777,7 @@
|
||||
|
||||
(defbehavior target-death-anim-trans target ()
|
||||
(send-event *camera* 'joystick 0.0 -1.0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
||||
(when (not (logtest? (-> self align flags) (align-flags disabled)))
|
||||
(vector-matrix*! gp-0 (-> self align delta trans) (-> self control c-R-w))
|
||||
|
||||
@@ -590,7 +590,7 @@
|
||||
(let ((f30-0 (-> self ladder flip)))
|
||||
(ja-no-eval :group! jakb-ladder-switch-ja :num! (seek! max 1.25) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(set! (-> self ladder flip)
|
||||
(the float (sar (shl (the int (lerp-scale f30-0 (+ 32768.0 f30-0) (ja-aframe-num 0) 0.0 30.0)) 48) 48))
|
||||
)
|
||||
@@ -612,7 +612,7 @@
|
||||
(ja-channel-push! 1 (seconds 0.1))
|
||||
(ja-no-eval :group! jakb-ladder-jump-ja :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
|
||||
@@ -1607,7 +1607,7 @@
|
||||
)
|
||||
(ja-no-eval :group! jakb-lightjak-get-on-ja :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-y-vel) 1.0 f30-0 1.0)
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
@@ -2277,41 +2277,21 @@
|
||||
)
|
||||
|
||||
(defmethod freeze-screen-method-24 ((this freeze-screen))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s3-0 (camera-matrix))
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
(gp-0 (new 'stack-no-clear 'vector))
|
||||
(f30-0 4096.0)
|
||||
)
|
||||
;; og:preserve-this resize effect based on aspect ratio
|
||||
(let ((f0-4 (* 0.00013563369 (tan (* 0.5 (-> *math-camera* fov))) f30-0)))
|
||||
(set-vector! (-> this root scale) (* f0-4 (if (-> *pc-settings* use-vis?) 1.0 (-> *pc-settings* aspect-ratio-scale))) f0-4 f0-4 1.0)
|
||||
)
|
||||
(vector-copy! gp-0 (camera-pos))
|
||||
(vector-normalize-copy! s5-0 (-> s3-0 fvec) 1.0)
|
||||
(matrix->quaternion (-> this root quat) s3-0)
|
||||
(let ((v1-10 (-> this root trans)))
|
||||
(let ((a0-5 f30-0))
|
||||
(.mov vf7 a0-5)
|
||||
)
|
||||
(.lvf vf5 (&-> s5-0 quad))
|
||||
(.lvf vf4 (&-> gp-0 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-10 quad) vf6)
|
||||
(let ((s3-0 (camera-matrix))
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
(gp-0 (new 'stack-no-clear 'vector))
|
||||
(f30-0 4096.0)
|
||||
)
|
||||
(let ((f0-4 (* 0.00013563369 (tan (/ (-> *math-camera* fov) 2)) f30-0)))
|
||||
(set-vector! (-> this root scale) (* f0-4 (if (-> *pc-settings* use-vis?) 1.0 (-> *pc-settings* aspect-ratio-scale))) f0-4 f0-4 1.0)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
(vector-copy! gp-0 (camera-pos))
|
||||
(vector-normalize-copy! s5-0 (-> s3-0 fvec) 1.0)
|
||||
(matrix->quaternion (-> this root quat) s3-0)
|
||||
(vector+*! (-> this root trans) gp-0 s5-0 f30-0)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defbehavior freeze-screen-init freeze-screen ((arg0 vector) (arg1 quaternion) (arg2 entity))
|
||||
@@ -2790,7 +2770,7 @@
|
||||
(ja-no-eval :group! gp-0 :num! (seek! max (-> self control current-surface align-speed)) :frame-num 0.0)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
|
||||
(suspend)
|
||||
(ja :num! (seek! max (-> self control current-surface align-speed)))
|
||||
@@ -2881,7 +2861,7 @@
|
||||
(show-hud 'hud-health)
|
||||
(ja-no-eval :group! jakb-lightjak-heal-ja :num! (seek!) :frame-num (ja-aframe f28-0 0))
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-y-vel) 1.0 2.0 1.0)
|
||||
(set-forward-vel (* 0.6 (-> self control ctrl-xz-vel)))
|
||||
(suspend)
|
||||
@@ -3020,42 +3000,23 @@
|
||||
#f
|
||||
)
|
||||
:post (behavior ()
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s3-0 (the-as target (as-type (ppointer->process (-> self parent)) process-focusable)))
|
||||
(s4-0 (camera-matrix))
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
(gp-1 (new 'stack-no-clear 'vector))
|
||||
(f30-0 4096.0)
|
||||
)
|
||||
(let ((f0-0 3.0))
|
||||
(set-vector! (-> self root scale) f0-0 f0-0 f0-0 1.0)
|
||||
)
|
||||
(vector-copy! gp-1 (get-trans s3-0 5))
|
||||
(vector-normalize-copy! s5-0 (-> s4-0 fvec) 0.0)
|
||||
(matrix->quaternion (-> self root quat) s4-0)
|
||||
(let ((v1-11 (-> self root trans)))
|
||||
(let ((a0-5 f30-0))
|
||||
(.mov vf7 a0-5)
|
||||
)
|
||||
(.lvf vf5 (&-> s5-0 quad))
|
||||
(.lvf vf4 (&-> gp-1 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-11 quad) vf6)
|
||||
(let ((s3-0 (the-as target (as-type (ppointer->process (-> self parent)) process-focusable)))
|
||||
(s4-0 (camera-matrix))
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
(gp-1 (new 'stack-no-clear 'vector))
|
||||
(f30-0 4096.0)
|
||||
)
|
||||
(let ((f0-0 3.0))
|
||||
(set-vector! (-> self root scale) f0-0 f0-0 f0-0 1.0)
|
||||
)
|
||||
(set! (-> self draw force-fade) (the-as uint (the int (* 128.0 (- 1.0 (-> self fade))))))
|
||||
(sound-play "ltjak-shield" :id (the-as sound-id (-> self tone)))
|
||||
(ja-post)
|
||||
(vector-copy! gp-1 (get-trans s3-0 5))
|
||||
(vector-normalize-copy! s5-0 (-> s4-0 fvec) 0.0)
|
||||
(matrix->quaternion (-> self root quat) s4-0)
|
||||
(vector+*! (-> self root trans) gp-1 s5-0 f30-0)
|
||||
)
|
||||
(set! (-> self draw force-fade) (the-as uint (the int (* 128.0 (- 1.0 (-> self fade))))))
|
||||
(sound-play "ltjak-shield" :id (the-as sound-id (-> self tone)))
|
||||
(ja-post)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -3223,12 +3223,10 @@
|
||||
(sv-624 int)
|
||||
(sv-640 vector)
|
||||
)
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s1-0 (-> arg0 draw lod-set lod (-> arg0 draw cur-lod) geo length)))
|
||||
@@ -3345,21 +3343,7 @@
|
||||
(s2-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> s4-1 state points-to-draw) 0)
|
||||
(let ((a1-32 s3-1))
|
||||
(let ((v1-44 sv-432))
|
||||
(let ((a0-38 sv-448))
|
||||
(let ((a2-30 arg4))
|
||||
(.mov vf7 a2-30)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-38 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-44 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-32 quad) vf6)
|
||||
)
|
||||
(vector+*! s3-1 sv-432 sv-448 arg4)
|
||||
(set-point! s4-1 (-> s4-1 state points-to-draw) s3-1)
|
||||
(+! (-> s4-1 state points-to-draw) 1)
|
||||
(set! sv-576 0)
|
||||
@@ -3371,26 +3355,12 @@
|
||||
(quaternion-from-two-vectors! sv-480 s0-2 sv-464)
|
||||
(vector-orient-by-quat! s1-2 sv-448 sv-480)
|
||||
(vector-copy! s1-2 sv-448)
|
||||
(let ((a1-40 s2-1))
|
||||
(let ((v1-56 sv-640))
|
||||
(let ((a0-47 s1-2))
|
||||
(let ((a2-34 arg4))
|
||||
(.mov vf7 a2-34)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-47 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-56 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-40 quad) vf6)
|
||||
)
|
||||
(vector+*! s2-1 sv-640 s1-2 arg4)
|
||||
(set! sv-608 s4-1)
|
||||
(set! sv-592 (method-of-object sv-608 set-point!))
|
||||
(set! sv-624 (-> s4-1 state points-to-draw))
|
||||
(let ((a2-36 (vector-average! (new 'stack-no-clear 'vector) s2-1 s3-1)))
|
||||
(sv-592 sv-608 sv-624 a2-36)
|
||||
(let ((a2-34 (vector-average! (new 'stack-no-clear 'vector) s2-1 s3-1)))
|
||||
(sv-592 sv-608 sv-624 a2-34)
|
||||
)
|
||||
(+! (-> s4-1 state points-to-draw) 1)
|
||||
(set-point! s4-1 (-> s4-1 state points-to-draw) s2-1)
|
||||
|
||||
@@ -549,7 +549,7 @@
|
||||
(ja-channel-push! 1 (seconds 0.15))
|
||||
(ja-no-eval :group! jakb-swim-walk-ja :num! (seek!) :frame-num (ja-aframe 19.0 0))
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(if (not (logtest? (-> self align flags) (align-flags disabled)))
|
||||
(set! (-> self control mod-surface target-speed)
|
||||
(* (-> self align delta trans z) (-> self control current-surface alignv) (-> self clock frames-per-second))
|
||||
@@ -567,7 +567,7 @@
|
||||
(until #f
|
||||
(ja-no-eval :group! jakb-swim-walk-ja :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(if (not (logtest? (-> self align flags) (align-flags disabled)))
|
||||
(set! (-> self control mod-surface target-speed)
|
||||
(* (-> self align delta trans z) (-> self control current-surface alignv) (-> self clock frames-per-second))
|
||||
@@ -719,7 +719,7 @@
|
||||
(let ((s4-0 #f))
|
||||
(ja-no-eval :group! jakb-swim-walk-to-down-ja :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0)
|
||||
(when (and (>= (ja-aframe-num 0) 73.0) (not s4-0))
|
||||
(set! s4-0 #t)
|
||||
@@ -884,7 +884,7 @@
|
||||
)
|
||||
(goto cfg-51)
|
||||
)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(when (not (logtest? (-> self water flags) (water-flag under-water)))
|
||||
(logior! (-> self water flags) (water-flag swim-ground))
|
||||
(set! s5-0 #f)
|
||||
@@ -913,7 +913,7 @@
|
||||
(if (cpad-pressed? (-> self control cpad number) x)
|
||||
(set! f30-0 2.0)
|
||||
)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(when (logtest? (-> self water flags) (water-flag under-water))
|
||||
(align! (-> self align) (align-opts adjust-y-vel) 1.0 1.0 1.0)
|
||||
(set! (-> self control transv y) (+ 8192.0 (* 8192.0 f30-0)))
|
||||
@@ -967,7 +967,7 @@
|
||||
(ja-channel-push! 1 (seconds 0.05))
|
||||
(ja :group! jakb-swim-jump-ja :num! min)
|
||||
(until (and (ja-done? 0) (= (-> self skel root-channel 0) (-> self skel channel)))
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(if (not (logtest? (-> self align flags) (align-flags disabled)))
|
||||
(+! (-> self water align-offset) (* 0.6 (-> self align delta trans y)))
|
||||
)
|
||||
|
||||
@@ -982,7 +982,7 @@
|
||||
(ja-channel-push! 1 (seconds 0.1))
|
||||
(ja-no-eval :group! jakb-deatha-ja :num! (seek! (ja-aframe 134.0 0)) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(let ((gp-2 (new 'stack-no-clear 'vector)))
|
||||
(when (not (logtest? (-> self align flags) (align-flags disabled)))
|
||||
(vector-matrix*! gp-2 (-> self align delta trans) (-> self control c-R-w))
|
||||
|
||||
@@ -234,59 +234,37 @@
|
||||
)
|
||||
|
||||
(defmethod projectile-method-25 ((this turret-shot))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let* ((gp-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0))
|
||||
(f30-0 (vector-length s5-1))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((gp-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0))
|
||||
(f30-0 (vector-length s5-1))
|
||||
)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-4 a1-0))
|
||||
(let ((a0-2 s5-1))
|
||||
(let ((a2-1 0.8))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-2 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s4-0 quad) vf6)
|
||||
(let ((f28-0 (-> *part-id-table* 1013 init-specs 4 initial-valuef)))
|
||||
(set! (-> *part-id-table* 1013 init-specs 4 initial-valuef) (vector-length s5-1))
|
||||
(draw-beam (-> *part-id-table* 1013) a1-0 s5-1 #f)
|
||||
(set! (-> *part-id-table* 1013 init-specs 4 initial-valuef) f28-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 851) s4-0)
|
||||
(launch-particles (-> *part-id-table* 852) s4-0)
|
||||
)
|
||||
(let ((s4-1 (new 'stack-no-clear 'matrix))
|
||||
(f26-0 (/ f30-0 (meters 9)))
|
||||
(f30-1 (-> *part-id-table* 1021 init-specs 3 initial-valuef))
|
||||
(f28-1 (-> *part-id-table* 1021 init-specs 4 initial-valuef))
|
||||
)
|
||||
(forward-up->inv-matrix s4-1 s5-1 *up-vector*)
|
||||
(vector-copy! (-> s4-1 trans) gp-0)
|
||||
(set! (-> *part-id-table* 1021 init-specs 3 initial-valuef) (* f26-0 f30-1))
|
||||
(set! (-> *part-id-table* 1021 init-specs 4 initial-valuef) (* f26-0 f28-1))
|
||||
(launch-particles (-> *part-id-table* 1021) s4-1 :origin-is-matrix #t)
|
||||
(set! (-> *part-id-table* 1021 init-specs 3 initial-valuef) f30-1)
|
||||
(set! (-> *part-id-table* 1021 init-specs 4 initial-valuef) f28-1)
|
||||
(let ((s4-1 (vector+*! (new 'stack-no-clear 'vector) a1-0 s5-1 0.8)))
|
||||
(let ((f28-0 (-> *part-id-table* 1013 init-specs 4 initial-valuef)))
|
||||
(set! (-> *part-id-table* 1013 init-specs 4 initial-valuef) (vector-length s5-1))
|
||||
(draw-beam (-> *part-id-table* 1013) a1-0 s5-1 #f)
|
||||
(set! (-> *part-id-table* 1013 init-specs 4 initial-valuef) f28-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 851) s4-1)
|
||||
(launch-particles (-> *part-id-table* 852) s4-1)
|
||||
)
|
||||
(let ((s4-2 (new 'stack-no-clear 'matrix))
|
||||
(f26-0 (/ f30-0 (meters 9)))
|
||||
(f30-1 (-> *part-id-table* 1021 init-specs 3 initial-valuef))
|
||||
(f28-1 (-> *part-id-table* 1021 init-specs 4 initial-valuef))
|
||||
)
|
||||
(forward-up->inv-matrix s4-2 s5-1 *up-vector*)
|
||||
(vector-copy! (-> s4-2 trans) gp-0)
|
||||
(set! (-> *part-id-table* 1021 init-specs 3 initial-valuef) (* f26-0 f30-1))
|
||||
(set! (-> *part-id-table* 1021 init-specs 4 initial-valuef) (* f26-0 f28-1))
|
||||
(launch-particles (-> *part-id-table* 1021) s4-2 :origin-is-matrix #t)
|
||||
(set! (-> *part-id-table* 1021 init-specs 3 initial-valuef) f30-1)
|
||||
(set! (-> *part-id-table* 1021 init-specs 4 initial-valuef) f28-1)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod projectile-method-26 ((this turret-shot))
|
||||
|
||||
@@ -1382,48 +1382,30 @@
|
||||
)
|
||||
|
||||
(defbehavior target-turret-blend-mat target ((arg0 cam-rotation-tracker) (arg1 matrix) (arg2 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(cond
|
||||
((>= arg2 1.0)
|
||||
(dotimes (s4-1 3)
|
||||
(vector-normalize-copy! (the-as vector (&-> arg0 inv-mat quad s4-1)) (the-as vector (&-> arg1 quad s4-1)) 1.0)
|
||||
(set! (-> arg0 inv-mat vector s4-1 w) 0.0)
|
||||
)
|
||||
(cond
|
||||
((>= arg2 1.0)
|
||||
(dotimes (s4-1 3)
|
||||
(vector-normalize-copy! (the-as vector (&-> arg0 inv-mat quad s4-1)) (the-as vector (&-> arg1 quad s4-1)) 1.0)
|
||||
(set! (-> arg0 inv-mat vector s4-1 w) 0.0)
|
||||
)
|
||||
(else
|
||||
(dotimes (s3-0 3)
|
||||
(set! arg2 (fmax 0.0 (fmin 1.0 arg2)))
|
||||
(vector-normalize! (the-as vector (&-> arg0 inv-mat quad s3-0)) (- 1.0 arg2))
|
||||
(let ((v1-15 (&-> arg0 inv-mat quad s3-0)))
|
||||
(let ((a0-5 (&-> arg0 inv-mat quad s3-0)))
|
||||
(let ((a1-5 (&-> arg1 quad s3-0)))
|
||||
(let ((a2-2 arg2))
|
||||
(.mov vf7 a2-2)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-5 0))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-5 0))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-15 0) vf6)
|
||||
)
|
||||
(vector-normalize! (the-as vector (&-> arg0 inv-mat quad s3-0)) 1.0)
|
||||
(set! (-> arg0 inv-mat vector s3-0 w) 0.0)
|
||||
)
|
||||
(else
|
||||
(dotimes (s3-0 3)
|
||||
(set! arg2 (fmax 0.0 (fmin 1.0 arg2)))
|
||||
(vector-normalize! (the-as vector (&-> arg0 inv-mat quad s3-0)) (- 1.0 arg2))
|
||||
(vector+*!
|
||||
(the-as vector (&-> arg0 inv-mat quad s3-0))
|
||||
(the-as vector (&-> arg0 inv-mat quad s3-0))
|
||||
(the-as vector (&-> arg1 quad s3-0))
|
||||
arg2
|
||||
)
|
||||
(vector-normalize! (the-as vector (&-> arg0 inv-mat quad s3-0)) 1.0)
|
||||
(set! (-> arg0 inv-mat vector s3-0 w) 0.0)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defstate cam-turret (camera-slave)
|
||||
|
||||
@@ -1698,66 +1698,51 @@
|
||||
)
|
||||
|
||||
(defmethod attack-info-method-9 ((this attack-info) (arg0 attack-info) (arg1 process-drawable) (arg2 process-drawable))
|
||||
(local-vars (v1-14 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
(let ((s5-0 (as-type arg1 process-drawable)))
|
||||
(let ((v1-0 (as-type arg2 process-drawable)))
|
||||
(cond
|
||||
((logtest? (attack-mask attacker-velocity) (-> this mask))
|
||||
(vector-copy! (-> arg0 attacker-velocity) (-> this attacker-velocity))
|
||||
(vector-normalize-copy! (-> arg0 trans) (-> arg0 attacker-velocity) 1.0)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0 (as-type arg1 process-drawable)))
|
||||
(let ((v1-0 (as-type arg2 process-drawable)))
|
||||
(cond
|
||||
((logtest? (attack-mask attacker-velocity) (-> this mask))
|
||||
(vector-copy! (-> arg0 attacker-velocity) (-> this attacker-velocity))
|
||||
(vector-normalize-copy! (-> arg0 trans) (-> arg0 attacker-velocity) 1.0)
|
||||
)
|
||||
(v1-0
|
||||
(cond
|
||||
(s5-0
|
||||
(vector-! (-> arg0 trans) (-> v1-0 root trans) (-> s5-0 root trans))
|
||||
(vector-normalize! (-> arg0 trans) 1.0)
|
||||
(vector-copy! (-> arg0 attacker-velocity) (-> arg0 trans))
|
||||
)
|
||||
(else
|
||||
(vector-z-quaternion! (-> arg0 trans) (-> v1-0 root quat))
|
||||
(vector-negate-in-place! (-> arg0 trans))
|
||||
(vector-normalize! (-> arg0 trans) 1.0)
|
||||
(vector-copy! (-> arg0 attacker-velocity) (-> arg0 trans))
|
||||
)
|
||||
(v1-0
|
||||
(cond
|
||||
(s5-0
|
||||
(vector-! (-> arg0 trans) (-> v1-0 root trans) (-> s5-0 root trans))
|
||||
(vector-normalize! (-> arg0 trans) 1.0)
|
||||
(vector-copy! (-> arg0 attacker-velocity) (-> arg0 trans))
|
||||
)
|
||||
(else
|
||||
(vector-z-quaternion! (-> arg0 trans) (-> v1-0 root quat))
|
||||
(vector-negate-in-place! (-> arg0 trans))
|
||||
(vector-normalize! (-> arg0 trans) 1.0)
|
||||
(vector-copy! (-> arg0 attacker-velocity) (-> arg0 trans))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! (-> arg0 trans quad) (the-as uint128 0))
|
||||
(set! (-> arg0 attacker-velocity quad) (the-as uint128 0))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! (-> arg0 trans quad) (the-as uint128 0))
|
||||
(set! (-> arg0 attacker-velocity quad) (the-as uint128 0))
|
||||
)
|
||||
)
|
||||
(if s5-0
|
||||
(vector-copy! (-> arg0 intersection) (-> s5-0 root trans))
|
||||
(vector-copy! (-> arg0 intersection) (target-pos 0))
|
||||
)
|
||||
)
|
||||
(.lvf vf1 (&-> (-> arg0 trans) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-14 vf1)
|
||||
(cond
|
||||
((!= v1-14 0.0)
|
||||
(vector-copy! (-> arg0 vector) (-> arg0 trans))
|
||||
(set! (-> arg0 vector y) 0.0)
|
||||
(vector-xz-normalize! (-> arg0 vector) 1.0)
|
||||
)
|
||||
(else
|
||||
(set! (-> arg0 vector quad) (the-as uint128 0))
|
||||
(if s5-0
|
||||
(vector-copy! (-> arg0 intersection) (-> s5-0 root trans))
|
||||
(vector-copy! (-> arg0 intersection) (target-pos 0))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
(cond
|
||||
((!= (vector-length-squared (-> arg0 trans)) 0.0)
|
||||
(vector-copy! (-> arg0 vector) (-> arg0 trans))
|
||||
(set! (-> arg0 vector y) 0.0)
|
||||
(vector-xz-normalize! (-> arg0 vector) 1.0)
|
||||
)
|
||||
(else
|
||||
(set! (-> arg0 vector quad) (the-as uint128 0))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod compute-intersect-info ((this attack-info) (arg0 object) (arg1 process-drawable) (arg2 process) (arg3 touching-shapes-entry))
|
||||
|
||||
@@ -324,11 +324,11 @@
|
||||
(ja-channel-push! 1 (seconds 0.04))
|
||||
(ja :group! jakb-turn-around-ja :num! min)
|
||||
(quaternion-rotate-y! (-> self control dir-targ) (-> self control dir-targ) 32768.0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(until (ja-done? 0)
|
||||
(suspend)
|
||||
(ja :num! (seek! max 2.0))
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
|
||||
)
|
||||
(remove-exit)
|
||||
@@ -2216,7 +2216,7 @@
|
||||
(ja-channel-push! 1 (seconds 0.05))
|
||||
(ja-no-eval :group! s5-0 :num! (seek! max (-> self control current-surface align-speed)) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0)
|
||||
(set! (-> self control mod-surface) *attack-mods*)
|
||||
(when (and gp-0 (send-event (handle->process (-> self control unknown-combo-tracker00 target)) 'combo))
|
||||
@@ -2615,7 +2615,7 @@
|
||||
(f28-0 1.0)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(when (not (ja-min? 0))
|
||||
(cond
|
||||
((and (>= (ja-aframe-num 0) 20.0)
|
||||
@@ -3293,11 +3293,11 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(until (ja-done? 0)
|
||||
(suspend)
|
||||
(ja :num! (seek! max 0.9))
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(set! (-> self control turn-go-the-long-way) 1.0)
|
||||
(let ((v1-27 (ja-group)))
|
||||
(if (and v1-27 (= v1-27 jakb-attack-uppercut-ja))
|
||||
@@ -3691,12 +3691,14 @@
|
||||
)
|
||||
:exit target-exit
|
||||
:trans (behavior ()
|
||||
(when (and (!= (-> self control unknown-spool-anim00) 'stuck) (!= (-> self state-time) (current-time)))
|
||||
;; og:preserve-this - High FPS Fix
|
||||
(if (and (recently-pressed? circle)
|
||||
(can-feet? #f)
|
||||
)
|
||||
(go target-attack-air 'flop)
|
||||
)
|
||||
)
|
||||
(when (and (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0))
|
||||
(not (time-elapsed? (-> self state-time) (seconds 0.25)))
|
||||
)
|
||||
@@ -3822,7 +3824,7 @@
|
||||
(if (cpad-pressed? (-> self control cpad number) square)
|
||||
(current-time)
|
||||
)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(cond
|
||||
((nonzero? s5-0)
|
||||
)
|
||||
@@ -3944,7 +3946,7 @@
|
||||
)
|
||||
(let ((f30-0 1.0))
|
||||
(until v1-37
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(if (not (ja-max? 0))
|
||||
(align!
|
||||
(-> self align)
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
(ja-channel-push! 1 (seconds 0.1))
|
||||
(ja-no-eval :group! jakb-trip-ja :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 1.0)
|
||||
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
|
||||
(let ((v1-22 (process->ppointer self)))
|
||||
@@ -1125,7 +1125,7 @@
|
||||
(target-compute-edge-rider)
|
||||
)
|
||||
)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(when (not (logtest? (-> self align flags) (align-flags disabled)))
|
||||
(vector-matrix*! s3-0 (-> self align delta trans) (-> self control c-R-w))
|
||||
(move-by-vector! (-> self control) s3-0)
|
||||
@@ -1175,7 +1175,7 @@
|
||||
)
|
||||
(ja-no-eval :group! jakb-edge-grab-off-ja :num! (seek! (ja-aframe 191.0 0)) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(when (not (logtest? (-> self align flags) (align-flags disabled)))
|
||||
(vector-matrix*! gp-0 (-> self align delta trans) (-> self control c-R-w))
|
||||
(move-by-vector! (-> self control) gp-0)
|
||||
@@ -1293,7 +1293,7 @@
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(gp-0)
|
||||
(compute-alignment! (-> self align))
|
||||
(compute-delta-align! (-> self align))
|
||||
(align!
|
||||
(-> self align)
|
||||
(align-opts adjust-y-vel)
|
||||
|
||||
@@ -2842,44 +2842,30 @@
|
||||
)
|
||||
|
||||
(defun kg-bombbot-find-nearest-nav-mesh ((arg0 kg-bombbot) (arg1 float))
|
||||
(local-vars (v1-15 float) (sv-64 nav-poly) (sv-68 nav-mesh) (sv-72 float) (sv-76 kg-bombbot))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(set! sv-64 (new 'stack-no-clear 'nav-poly))
|
||||
(set! sv-68 (the-as nav-mesh #f))
|
||||
(set! sv-72 arg1)
|
||||
(set! sv-76 arg0)
|
||||
(set! (-> sv-64 data 20) (the-as uint 7))
|
||||
(dotimes (gp-0 (-> *level* length))
|
||||
(let ((v1-5 (-> *level* level gp-0)))
|
||||
(when (= (-> v1-5 status) 'active)
|
||||
(let ((s5-0 (-> v1-5 bsp nav-meshes)))
|
||||
(when (nonzero? s5-0)
|
||||
(dotimes (s4-0 (-> s5-0 length))
|
||||
(let ((s3-0 (-> s5-0 s4-0 nav-mesh)))
|
||||
(when s3-0
|
||||
(vector-! (-> sv-64 vertex 0) (the-as vector sv-76) (the-as vector (-> s3-0 bounds)))
|
||||
(.lvf vf1 (&-> (-> sv-64 vertex) 0 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-15 vf1)
|
||||
(let ((f0-1 v1-15)
|
||||
(f1-0 (-> s3-0 bounds r))
|
||||
)
|
||||
(when (< f0-1 (* f1-0 f1-0))
|
||||
(set! (-> sv-64 vertex1 x) 4096.0)
|
||||
(nav-mesh-method-46 s3-0 sv-64)
|
||||
(when (>= sv-72 (-> sv-64 vertex1 w))
|
||||
(set! sv-72 (-> sv-64 vertex1 w))
|
||||
(set! sv-68 s3-0)
|
||||
)
|
||||
(local-vars (sv-64 nav-poly) (sv-68 nav-mesh) (sv-72 float) (sv-76 kg-bombbot))
|
||||
(set! sv-64 (new 'stack-no-clear 'nav-poly))
|
||||
(set! sv-68 (the-as nav-mesh #f))
|
||||
(set! sv-72 arg1)
|
||||
(set! sv-76 arg0)
|
||||
(set! (-> sv-64 data 20) (the-as uint 7))
|
||||
(dotimes (gp-0 (-> *level* length))
|
||||
(let ((v1-5 (-> *level* level gp-0)))
|
||||
(when (= (-> v1-5 status) 'active)
|
||||
(let ((s5-0 (-> v1-5 bsp nav-meshes)))
|
||||
(when (nonzero? s5-0)
|
||||
(dotimes (s4-0 (-> s5-0 length))
|
||||
(let ((s3-0 (-> s5-0 s4-0 nav-mesh)))
|
||||
(when s3-0
|
||||
(vector-! (-> sv-64 vertex 0) (the-as vector sv-76) (the-as vector (-> s3-0 bounds)))
|
||||
(let ((f0-1 (vector-length-squared (-> sv-64 vertex 0)))
|
||||
(f1-0 (-> s3-0 bounds r))
|
||||
)
|
||||
(when (< f0-1 (* f1-0 f1-0))
|
||||
(set! (-> sv-64 vertex1 x) 4096.0)
|
||||
(nav-mesh-method-46 s3-0 sv-64)
|
||||
(when (>= sv-72 (-> sv-64 vertex1 w))
|
||||
(set! sv-72 (-> sv-64 vertex1 w))
|
||||
(set! sv-68 s3-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -2890,8 +2876,8 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
sv-68
|
||||
)
|
||||
sv-68
|
||||
)
|
||||
|
||||
(defmethod bombbot-method-205 ((this kg-bombbot))
|
||||
@@ -2920,50 +2906,27 @@
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod bombbot-method-196 ((this kg-bombbot) (arg0 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0
|
||||
(as-type
|
||||
(handle->process (-> *blow-tower-targets* target-handles (logand (rand-uint31-gen *random-generator*) 1)))
|
||||
process-focusable
|
||||
)
|
||||
(let ((s5-0
|
||||
(as-type
|
||||
(handle->process (-> *blow-tower-targets* target-handles (logand (rand-uint31-gen *random-generator*) 1)))
|
||||
process-focusable
|
||||
)
|
||||
)
|
||||
(cond
|
||||
(s5-0
|
||||
(vector-copy! (-> this target-pos) (get-trans s5-0 3))
|
||||
(let ((v1-9 (-> this target-pos)))
|
||||
(let ((a0-9 (-> s5-0 root trans)))
|
||||
(let ((a1-5 (-> s5-0 root transv)))
|
||||
(let ((a2-0 0.0))
|
||||
(.mov vf7 a2-0)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-5 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-9 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-9 quad) vf6)
|
||||
)
|
||||
(vector-copy! (-> this start-target-pos) (-> this target-pos))
|
||||
(vector-copy! (-> this start-target-vel) (-> s5-0 root transv))
|
||||
(focus-on! (-> this focus) s5-0 this)
|
||||
)
|
||||
(else
|
||||
(clear-focused (-> this focus))
|
||||
)
|
||||
)
|
||||
(cond
|
||||
(s5-0
|
||||
(vector-copy! (-> this target-pos) (get-trans s5-0 3))
|
||||
(vector+*! (-> this target-pos) (-> s5-0 root trans) (-> s5-0 root transv) 0.0)
|
||||
(vector-copy! (-> this start-target-pos) (-> this target-pos))
|
||||
(vector-copy! (-> this start-target-vel) (-> s5-0 root transv))
|
||||
(focus-on! (-> this focus) s5-0 this)
|
||||
)
|
||||
(else
|
||||
(clear-focused (-> this focus))
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defstate hostile (kg-bombbot)
|
||||
|
||||
@@ -1006,7 +1006,7 @@
|
||||
)
|
||||
(set! sv-176 f30-1)
|
||||
(let ((a3-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) arg2)))
|
||||
(s4-1 s3-1 (the-as quaternion s0-1) sv-176 a3-1)
|
||||
(s4-1 s3-1 s0-1 sv-176 a3-1)
|
||||
)
|
||||
)
|
||||
(vector+! s2-0 s2-0 s1-0)
|
||||
@@ -3022,7 +3022,7 @@
|
||||
(s3-3 (-> this pitch-quat))
|
||||
)
|
||||
(let ((f28-1 (-> this roll-amount)))
|
||||
(vector-rotate-around-axis! sv-268 (the-as quaternion sv-260) (-> v1-68 rot-y-shift) *up-vector*)
|
||||
(vector-rotate-around-axis! sv-268 sv-260 (-> v1-68 rot-y-shift) *up-vector*)
|
||||
(quaternion-vector-angle! s3-3 sv-268 f28-1)
|
||||
)
|
||||
(quaternion*! s4-2 s3-3 s4-2)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -494,74 +494,51 @@
|
||||
|
||||
(defmethod crimson-guard-method-254 ((this crimson-guard))
|
||||
(local-vars (sv-112 vector) (sv-128 vector) (sv-144 int))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(handle->process (-> this focus handle))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-0 (-> this move-position))
|
||||
(when (< 8192000.0 (-> this target-self-xz-dist))
|
||||
(let ((s3-0 (-> this root trans))
|
||||
(s2-0 (new 'stack-no-clear 'vector))
|
||||
(s1-0 (new 'stack-no-clear 'vector))
|
||||
(s0-0 (new 'stack-no-clear 'vector))
|
||||
(s4-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! sv-112 (new 'stack-no-clear 'vector))
|
||||
(vector-copy! s1-0 s5-0)
|
||||
(vector-z-quaternion! s2-0 (-> this root quat))
|
||||
(let ((f30-0 (* 182.04445 (* 60.0 (the float (- (-> this traffic-id) *guard-min-id-hack*))))))
|
||||
(set! sv-128 s0-0)
|
||||
(set! (-> sv-128 x) (cos f30-0))
|
||||
(set! (-> sv-128 y) 0.0)
|
||||
(set! (-> sv-128 z) (sin f30-0))
|
||||
(handle->process (-> this focus handle))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-0 (-> this move-position))
|
||||
(when (< 8192000.0 (-> this target-self-xz-dist))
|
||||
(let ((s3-0 (-> this root trans))
|
||||
(s2-0 (new 'stack-no-clear 'vector))
|
||||
(s1-0 (new 'stack-no-clear 'vector))
|
||||
(s0-0 (new 'stack-no-clear 'vector))
|
||||
(s4-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set! (-> sv-128 w) 1.0)
|
||||
(let ((a1-2 s1-0))
|
||||
(let ((v1-21 s1-0))
|
||||
(let ((a0-13 s0-0))
|
||||
(let ((a2-1 12288.0))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-13 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-21 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-2 quad) vf6)
|
||||
)
|
||||
(let ((f30-2 (* 0.5 (vector-vector-xz-distance s3-0 s1-0))))
|
||||
(vector-normalize! s2-0 (/ f30-2 2))
|
||||
(vector-normalize! s0-0 (* 2.0 f30-2))
|
||||
)
|
||||
(set! sv-144 0)
|
||||
(while (< sv-144 10)
|
||||
(do-spline s4-0 s3-0 s2-0 s1-0 s0-0 (* 0.1 (the float sv-144)))
|
||||
(do-spline sv-112 s3-0 s2-0 s1-0 s0-0 (* 0.1 (the float (+ sv-144 1))))
|
||||
(add-debug-line #t (bucket-id debug-no-zbuf1) s4-0 sv-112 *color-red* #f (the-as rgba -1))
|
||||
(set! sv-144 (+ sv-144 1))
|
||||
)
|
||||
(do-spline s4-0 s3-0 s2-0 s1-0 s0-0 0.9)
|
||||
(vector-copy! s4-0 s5-0)
|
||||
(set! sv-112 (new 'stack-no-clear 'vector))
|
||||
(vector-copy! s1-0 s5-0)
|
||||
(vector-z-quaternion! s2-0 (-> this root quat))
|
||||
(let ((f30-0 (* 182.04445 (* 60.0 (the float (- (-> this traffic-id) *guard-min-id-hack*))))))
|
||||
(set! sv-128 s0-0)
|
||||
(set! (-> sv-128 x) (cos f30-0))
|
||||
(set! (-> sv-128 y) 0.0)
|
||||
(set! (-> sv-128 z) (sin f30-0))
|
||||
)
|
||||
)
|
||||
(let ((v1-39 (-> this nav state)))
|
||||
(logclear! (-> v1-39 flags) (nav-state-flag directional-mode))
|
||||
(logior! (-> v1-39 flags) (nav-state-flag target-poly-dirty))
|
||||
(vector-copy! (-> v1-39 target-pos) s5-0)
|
||||
(set! (-> sv-128 w) 1.0)
|
||||
(vector+*! s1-0 s1-0 s0-0 12288.0)
|
||||
(let ((f30-2 (* 0.5 (vector-vector-xz-distance s3-0 s1-0))))
|
||||
(vector-normalize! s2-0 (/ f30-2 2))
|
||||
(vector-normalize! s0-0 (* 2.0 f30-2))
|
||||
)
|
||||
(set! sv-144 0)
|
||||
(while (< sv-144 10)
|
||||
(do-spline s4-0 s3-0 s2-0 s1-0 s0-0 (* 0.1 (the float sv-144)))
|
||||
(do-spline sv-112 s3-0 s2-0 s1-0 s0-0 (* 0.1 (the float (+ sv-144 1))))
|
||||
(add-debug-line #t (bucket-id debug-no-zbuf1) s4-0 sv-112 *color-red* #f (the-as rgba -1))
|
||||
(set! sv-144 (+ sv-144 1))
|
||||
)
|
||||
(do-spline s4-0 s3-0 s2-0 s1-0 s0-0 0.9)
|
||||
(vector-copy! s4-0 s5-0)
|
||||
)
|
||||
)
|
||||
0
|
||||
(nav-enemy-method-187 this)
|
||||
(none)
|
||||
(let ((v1-39 (-> this nav state)))
|
||||
(logclear! (-> v1-39 flags) (nav-state-flag directional-mode))
|
||||
(logior! (-> v1-39 flags) (nav-state-flag target-poly-dirty))
|
||||
(vector-copy! (-> v1-39 target-pos) s5-0)
|
||||
)
|
||||
)
|
||||
0
|
||||
(nav-enemy-method-187 this)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defstate hostile (crimson-guard)
|
||||
@@ -1047,60 +1024,39 @@
|
||||
)
|
||||
)
|
||||
:trans (behavior ()
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(when (not (-> self already-shot))
|
||||
(crimson-guard-method-265 self 1.0)
|
||||
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! gp-0 (-> self root trans))
|
||||
(let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))
|
||||
(s5-0 (new 'stack 'collide-query))
|
||||
)
|
||||
(let ((a0-3 gp-0))
|
||||
(let ((v1-8 gp-0))
|
||||
(let ((a1-4 20480.0))
|
||||
(.mov vf7 a1-4)
|
||||
)
|
||||
(.lvf vf5 (&-> s4-0 quad))
|
||||
(.lvf vf4 (&-> v1-8 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-3 quad) vf6)
|
||||
(when (not (-> self already-shot))
|
||||
(crimson-guard-method-265 self 1.0)
|
||||
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! gp-0 (-> self root trans))
|
||||
(let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))
|
||||
(s5-0 (new 'stack 'collide-query))
|
||||
)
|
||||
(vector+*! gp-0 gp-0 s4-0 20480.0)
|
||||
(if (enemy-above-ground? self s5-0 gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0)
|
||||
(set! (-> gp-0 y) (-> s5-0 best-other-tri intersect y))
|
||||
)
|
||||
(if (enemy-above-ground? self s5-0 gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0)
|
||||
(set! (-> gp-0 y) (-> s5-0 best-other-tri intersect y))
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (!= (crimson-guard-method-266 self (-> self event-param-point)) 0.0)
|
||||
(let* ((v1-16 (-> self nav))
|
||||
(a1-7 (-> self event-param-point))
|
||||
(f0-3 (-> v1-16 extra-nav-sphere w))
|
||||
)
|
||||
(vector-copy! (-> v1-16 extra-nav-sphere) a1-7)
|
||||
(set! (-> v1-16 extra-nav-sphere w) f0-3)
|
||||
)
|
||||
0
|
||||
(let ((v1-19 (-> self nav)))
|
||||
(set! (-> v1-19 extra-nav-sphere w) (-> self nav-radius-backup))
|
||||
)
|
||||
0
|
||||
(let ((v1-21 (-> self nav)))
|
||||
(logior! (-> v1-21 shape nav-flags) (nav-flags has-extra-sphere))
|
||||
)
|
||||
0
|
||||
(set! (-> self already-shot) #t)
|
||||
)
|
||||
(crimson-guard-method-265 self 0.0)
|
||||
)
|
||||
(when (!= (crimson-guard-method-266 self (-> self event-param-point)) 0.0)
|
||||
(let* ((v1-16 (-> self nav))
|
||||
(a1-6 (-> self event-param-point))
|
||||
(f0-3 (-> v1-16 extra-nav-sphere w))
|
||||
)
|
||||
(vector-copy! (-> v1-16 extra-nav-sphere) a1-6)
|
||||
(set! (-> v1-16 extra-nav-sphere w) f0-3)
|
||||
)
|
||||
0
|
||||
(let ((v1-19 (-> self nav)))
|
||||
(set! (-> v1-19 extra-nav-sphere w) (-> self nav-radius-backup))
|
||||
)
|
||||
0
|
||||
(let ((v1-21 (-> self nav)))
|
||||
(logior! (-> v1-21 shape nav-flags) (nav-flags has-extra-sphere))
|
||||
)
|
||||
0
|
||||
(set! (-> self already-shot) #t)
|
||||
)
|
||||
(crimson-guard-method-265 self 0.0)
|
||||
)
|
||||
)
|
||||
:code (behavior ()
|
||||
|
||||
@@ -9,313 +9,227 @@
|
||||
|
||||
(defun spread-lightning-lazer ((arg0 lightning-control) (arg1 vector) (arg2 vector) (arg3 vector))
|
||||
(local-vars (sv-640 int) (sv-656 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-0 arg1)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s4-0 arg2)
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector))
|
||||
(s2-0 (new 'stack-no-clear 'quaternion))
|
||||
)
|
||||
(vector-length arg2)
|
||||
(let ((s1-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s1-0 arg3)
|
||||
(let ((s0-0 (new 'stack-no-clear 'collide-query)))
|
||||
(set! sv-640 0)
|
||||
(while (< sv-640 6)
|
||||
(let ((v1-6 s0-0))
|
||||
(set! (-> v1-6 radius) 2867.2)
|
||||
(set! (-> v1-6 collide-with)
|
||||
(collide-spec jak bot civilian enemy vehicle-sphere hit-by-others-list player-list)
|
||||
)
|
||||
(set! (-> v1-6 ignore-process0) #f)
|
||||
(set! (-> v1-6 ignore-process1) #f)
|
||||
(set! (-> v1-6 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-6 action-mask) (collide-action solid))
|
||||
)
|
||||
(vector-copy! (-> s0-0 start-pos) s5-0)
|
||||
(vector-copy! (-> s0-0 move-dist) s4-0)
|
||||
(set-from-point-offset-pad! (-> s0-0 bbox) (-> s0-0 start-pos) (-> s0-0 move-dist) (-> s0-0 radius))
|
||||
(fill-using-bounding-box *collide-cache* s0-0)
|
||||
(set! (-> s0-0 radius) 409.6)
|
||||
(let ((f0-4 (probe-using-line-sphere *collide-cache* s0-0)))
|
||||
(cond
|
||||
((>= f0-4 0.0)
|
||||
(let ((a1-4 s3-0))
|
||||
(let ((v1-13 (-> s0-0 start-pos)))
|
||||
(let ((a0-12 (-> s0-0 move-dist)))
|
||||
(let ((a2-2 f0-4))
|
||||
(.mov vf7 a2-2)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-12 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-13 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-4 quad) vf6)
|
||||
)
|
||||
(vector-copy! s5-0 s3-0)
|
||||
)
|
||||
(else
|
||||
(vector+! (-> s0-0 start-pos) s5-0 s4-0)
|
||||
(let ((a1-7 (-> s0-0 start-pos)))
|
||||
(let ((v1-16 (-> s0-0 start-pos)))
|
||||
(let ((a0-16 s1-0))
|
||||
(let ((a2-4 -2048.0))
|
||||
(.mov vf7 a2-4)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-16 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-16 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-7 quad) vf6)
|
||||
)
|
||||
(vector-negate! (-> s0-0 move-dist) s4-0)
|
||||
(set! f0-4 (probe-using-line-sphere *collide-cache* s0-0))
|
||||
(when (>= f0-4 0.0)
|
||||
(let ((a1-10 s3-0))
|
||||
(let ((v1-19 (-> s0-0 start-pos)))
|
||||
(let ((a0-19 (-> s0-0 move-dist)))
|
||||
(let ((a2-5 f0-4))
|
||||
(.mov vf7 a2-5)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-19 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-19 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-10 quad) vf6)
|
||||
)
|
||||
(let ((a1-11 s3-0))
|
||||
(let ((v1-20 s3-0))
|
||||
(let ((a0-20 s1-0))
|
||||
(let ((a2-7 2048.0))
|
||||
(.mov vf7 a2-7)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-20 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-20 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-11 quad) vf6)
|
||||
)
|
||||
(vector-copy! s5-0 s3-0)
|
||||
)
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-0 arg1)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s4-0 arg2)
|
||||
(let ((s3-0 (new 'stack-no-clear 'vector))
|
||||
(s2-0 (new 'stack-no-clear 'quaternion))
|
||||
)
|
||||
(vector-length arg2)
|
||||
(let ((s1-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s1-0 arg3)
|
||||
(let ((s0-0 (new 'stack-no-clear 'collide-query)))
|
||||
(set! sv-640 0)
|
||||
(while (< sv-640 6)
|
||||
(let ((v1-6 s0-0))
|
||||
(set! (-> v1-6 radius) 2867.2)
|
||||
(set! (-> v1-6 collide-with)
|
||||
(collide-spec jak bot civilian enemy vehicle-sphere hit-by-others-list player-list)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((>= f0-4 0.0)
|
||||
(+! (-> s3-0 x) (rand-vu-float-range -819.2 819.2))
|
||||
(+! (-> s3-0 y) (rand-vu-float-range -819.2 819.2))
|
||||
(+! (-> s3-0 z) (rand-vu-float-range -819.2 819.2))
|
||||
(set-point! arg0 (-> arg0 state points-to-draw) s3-0)
|
||||
(+! (-> arg0 state points-to-draw) 1)
|
||||
(set! sv-656 (-> s0-0 best-other-tri normal))
|
||||
(quaternion-from-two-vectors! s2-0 s1-0 sv-656)
|
||||
(vector-orient-by-quat! s4-0 s4-0 s2-0)
|
||||
(vector-copy! s1-0 sv-656)
|
||||
(vector-flatten! s4-0 s4-0 sv-656)
|
||||
)
|
||||
(else
|
||||
(vector+! s5-0 s5-0 s4-0)
|
||||
(when (< sv-640 6)
|
||||
(set-point! arg0 (-> arg0 state points-to-draw) s5-0)
|
||||
(+! (-> arg0 state points-to-draw) 1)
|
||||
)
|
||||
(set! (-> v1-6 ignore-process0) #f)
|
||||
(set! (-> v1-6 ignore-process1) #f)
|
||||
(set! (-> v1-6 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! sv-640 (+ sv-640 1))
|
||||
(set! (-> v1-6 action-mask) (collide-action solid))
|
||||
)
|
||||
(vector-copy! (-> s0-0 start-pos) s5-0)
|
||||
(vector-copy! (-> s0-0 move-dist) s4-0)
|
||||
(set-from-point-offset-pad! (-> s0-0 bbox) (-> s0-0 start-pos) (-> s0-0 move-dist) (-> s0-0 radius))
|
||||
(fill-using-bounding-box *collide-cache* s0-0)
|
||||
(set! (-> s0-0 radius) 409.6)
|
||||
(let ((f0-4 (probe-using-line-sphere *collide-cache* s0-0)))
|
||||
(cond
|
||||
((>= f0-4 0.0)
|
||||
(vector+*! s3-0 (-> s0-0 start-pos) (-> s0-0 move-dist) f0-4)
|
||||
(vector-copy! s5-0 s3-0)
|
||||
)
|
||||
(else
|
||||
(vector+! (-> s0-0 start-pos) s5-0 s4-0)
|
||||
(vector+*! (-> s0-0 start-pos) (-> s0-0 start-pos) s1-0 -2048.0)
|
||||
(vector-negate! (-> s0-0 move-dist) s4-0)
|
||||
(set! f0-4 (probe-using-line-sphere *collide-cache* s0-0))
|
||||
(when (>= f0-4 0.0)
|
||||
(vector+*! s3-0 (-> s0-0 start-pos) (-> s0-0 move-dist) f0-4)
|
||||
(vector+*! s3-0 s3-0 s1-0 2048.0)
|
||||
(vector-copy! s5-0 s3-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((>= f0-4 0.0)
|
||||
(+! (-> s3-0 x) (rand-vu-float-range -819.2 819.2))
|
||||
(+! (-> s3-0 y) (rand-vu-float-range -819.2 819.2))
|
||||
(+! (-> s3-0 z) (rand-vu-float-range -819.2 819.2))
|
||||
(set-point! arg0 (-> arg0 state points-to-draw) s3-0)
|
||||
(+! (-> arg0 state points-to-draw) 1)
|
||||
(set! sv-656 (-> s0-0 best-other-tri normal))
|
||||
(quaternion-from-two-vectors! s2-0 s1-0 sv-656)
|
||||
(vector-orient-by-quat! s4-0 s4-0 s2-0)
|
||||
(vector-copy! s1-0 sv-656)
|
||||
(vector-flatten! s4-0 s4-0 sv-656)
|
||||
)
|
||||
(else
|
||||
(vector+! s5-0 s5-0 s4-0)
|
||||
(when (< sv-640 6)
|
||||
(set-point! arg0 (-> arg0 state points-to-draw) s5-0)
|
||||
(+! (-> arg0 state points-to-draw) 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! sv-640 (+ sv-640 1))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
#f
|
||||
)
|
||||
#f
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod crimson-guard-method-263 ((this crimson-guard))
|
||||
(local-vars (sv-832 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14)))
|
||||
(v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15)))
|
||||
(s2-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 v0-1) 16384.0))
|
||||
(s1-0
|
||||
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this target-pos-predict-miss) s4-0) 16384.0)
|
||||
)
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
(s3-0 (new 'stack-no-clear 'collide-query))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14)))
|
||||
(v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15)))
|
||||
(s2-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 v0-1) 16384.0))
|
||||
(s1-0
|
||||
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this target-pos-predict-miss) s4-0) 16384.0)
|
||||
(when (< 1820.4445 (vector-vector-angle-safe s2-0 s1-0))
|
||||
(let* ((a1-9 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) s2-0 s1-0) 1.0))
|
||||
(a2-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-9 1820.4445))
|
||||
)
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
(s3-0 (new 'stack-no-clear 'collide-query))
|
||||
)
|
||||
(when (< 1820.4445 (vector-vector-angle-safe s2-0 s1-0))
|
||||
(let* ((a1-9 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) s2-0 s1-0) 1.0))
|
||||
(a2-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-9 1820.4445))
|
||||
)
|
||||
(vector-orient-by-quat! s1-0 s2-0 a2-1)
|
||||
)
|
||||
(vector-orient-by-quat! s1-0 s2-0 a2-1)
|
||||
)
|
||||
(let ((a0-12 s4-0))
|
||||
(let ((v1-8 s4-0))
|
||||
(let ((a1-12 0.2))
|
||||
(.mov vf7 a1-12)
|
||||
)
|
||||
(vector+*! s4-0 s4-0 s2-0 0.2)
|
||||
(vector+! s5-0 s4-0 s1-0)
|
||||
(let ((v1-10 s3-0))
|
||||
(set! (-> v1-10 radius) 409.6)
|
||||
(set! (-> v1-10 collide-with)
|
||||
(collide-spec jak bot civilian enemy vehicle-sphere hit-by-others-list player-list)
|
||||
)
|
||||
(.lvf vf5 (&-> s2-0 quad))
|
||||
(.lvf vf4 (&-> v1-8 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-12 quad) vf6)
|
||||
)
|
||||
(vector+! s5-0 s4-0 s1-0)
|
||||
(let ((v1-10 s3-0))
|
||||
(set! (-> v1-10 radius) 409.6)
|
||||
(set! (-> v1-10 collide-with)
|
||||
(collide-spec jak bot civilian enemy vehicle-sphere hit-by-others-list player-list)
|
||||
)
|
||||
(set! (-> v1-10 ignore-process0) #f)
|
||||
(set! (-> v1-10 ignore-process1) #f)
|
||||
(set! (-> v1-10 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-10 action-mask) (collide-action solid))
|
||||
)
|
||||
(vector-copy! (-> s3-0 start-pos) s4-0)
|
||||
(vector-copy! (-> s3-0 move-dist) s1-0)
|
||||
(set! (-> this l-control state points-to-draw) 0)
|
||||
(let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* s3-0))
|
||||
(s2-1 (new 'stack-no-clear 'vector))
|
||||
(set! (-> v1-10 ignore-process0) #f)
|
||||
(set! (-> v1-10 ignore-process1) #f)
|
||||
(set! (-> v1-10 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(cond
|
||||
((>= f0-3 0.0)
|
||||
(vector-float*! s1-0 (-> s3-0 move-dist) f0-3)
|
||||
(vector+! s5-0 s4-0 s1-0)
|
||||
(point-in-plane-<-point+normal! s2-1 s5-0 (-> s3-0 best-other-tri normal))
|
||||
(vector-! s2-1 s2-1 s5-0)
|
||||
(let ((s1-1 quaternion-vector-angle!)
|
||||
(s0-0 (new 'stack-no-clear 'quaternion))
|
||||
)
|
||||
(set! sv-832 (-> s3-0 best-other-tri normal))
|
||||
(let* ((a2-3 (rand-vu-float-range 0.0 65536.0))
|
||||
(a2-4 (s1-1 s0-0 sv-832 a2-3))
|
||||
)
|
||||
(vector-orient-by-quat! s2-1 s2-1 a2-4)
|
||||
(set! (-> v1-10 action-mask) (collide-action solid))
|
||||
)
|
||||
(vector-copy! (-> s3-0 start-pos) s4-0)
|
||||
(vector-copy! (-> s3-0 move-dist) s1-0)
|
||||
(set! (-> this l-control state points-to-draw) 0)
|
||||
(let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* s3-0))
|
||||
(s2-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(cond
|
||||
((>= f0-3 0.0)
|
||||
(vector-float*! s1-0 (-> s3-0 move-dist) f0-3)
|
||||
(vector+! s5-0 s4-0 s1-0)
|
||||
(point-in-plane-<-point+normal! s2-1 s5-0 (-> s3-0 best-other-tri normal))
|
||||
(vector-! s2-1 s2-1 s5-0)
|
||||
(let ((s1-1 quaternion-vector-angle!)
|
||||
(s0-0 (new 'stack-no-clear 'quaternion))
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13))
|
||||
(vector-copy! (-> *launch-matrix* trans) s4-0)
|
||||
(part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
(else
|
||||
(vector-copy! (-> *launch-matrix* trans) s4-0)
|
||||
(part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13))
|
||||
(vector-copy! (-> *launch-matrix* trans) s5-0)
|
||||
(part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
(else
|
||||
(vector-copy! (-> *launch-matrix* trans) s5-0)
|
||||
(part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
)
|
||||
(set-point! (-> this l-control) 0 s4-0)
|
||||
(set-point! (-> this l-control) 1 s5-0)
|
||||
(set! (-> this l-control spec) (-> *lightning-spec-id-table* 19))
|
||||
(+! (-> this l-control state points-to-draw) 2)
|
||||
(let ((v1-91 (as-type (-> s3-0 best-other-tri collide-ptr) collide-shape-prim))
|
||||
(s1-7 #t)
|
||||
)
|
||||
(when v1-91
|
||||
(set! s1-7 #f)
|
||||
(let ((s0-1 (new 'stack-no-clear 'projectile-init-by-other-params)))
|
||||
(set! (-> s0-1 ent) (-> this entity))
|
||||
(set! (-> s0-1 charge) 1.0)
|
||||
(set! (-> s0-1 options) (projectile-options))
|
||||
(logclear! (-> s0-1 options) (projectile-options po14 po15 po16))
|
||||
(set! (-> s0-1 notify-handle) (process->handle this))
|
||||
(set! (-> s0-1 owner-handle) (the-as handle #f))
|
||||
(set! (-> s0-1 target-handle) (the-as handle #f))
|
||||
(set! (-> s0-1 target-pos quad) (the-as uint128 0))
|
||||
(set! (-> s0-1 ignore-handle) (process->handle this))
|
||||
(set! (-> s0-1 attack-id) (-> this attack-id))
|
||||
(set! (-> s0-1 timeout) (seconds 4))
|
||||
(vector-copy! (-> s0-1 pos) s4-0)
|
||||
(vector-! (-> s0-1 vel) s5-0 s4-0)
|
||||
(vector-normalize! (-> s0-1 vel) 131072.0)
|
||||
(spawn-projectile guard-lazer-shot s0-1 this *default-dead-pool*)
|
||||
)
|
||||
)
|
||||
)
|
||||
(spread-lightning-lazer (-> this l-control) s5-0 s2-1 (-> s3-0 best-other-tri normal))
|
||||
)
|
||||
(else
|
||||
(cond
|
||||
((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13))
|
||||
(vector-copy! (-> *launch-matrix* trans) s4-0)
|
||||
(part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
(else
|
||||
(vector-copy! (-> *launch-matrix* trans) s4-0)
|
||||
(part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13))
|
||||
(vector-copy! (-> *launch-matrix* trans) s5-0)
|
||||
(part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
(else
|
||||
(vector-copy! (-> *launch-matrix* trans) s5-0)
|
||||
(part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
)
|
||||
(set! (-> this l-control state points-to-draw) 9)
|
||||
(set! (-> this l-control spec) (-> *lightning-spec-id-table* 20))
|
||||
(let ((v1-176 s4-0))
|
||||
(set! (-> this l-control state meet data 0 quad) (-> v1-176 quad))
|
||||
)
|
||||
(let ((a0-97 (-> this l-control))
|
||||
(v1-178 s5-0)
|
||||
(set! sv-832 (-> s3-0 best-other-tri normal))
|
||||
(let* ((a2-3 (rand-vu-float-range 0.0 65536.0))
|
||||
(a2-4 (s1-1 s0-0 sv-832 a2-3))
|
||||
)
|
||||
(vector-copy! (-> a0-97 state meet data (+ (-> a0-97 state points-to-draw) -1)) v1-178)
|
||||
(vector-orient-by-quat! s2-1 s2-1 a2-4)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13))
|
||||
(vector-copy! (-> *launch-matrix* trans) s4-0)
|
||||
(part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
(else
|
||||
(vector-copy! (-> *launch-matrix* trans) s4-0)
|
||||
(part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13))
|
||||
(vector-copy! (-> *launch-matrix* trans) s5-0)
|
||||
(part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
(else
|
||||
(vector-copy! (-> *launch-matrix* trans) s5-0)
|
||||
(part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
)
|
||||
(set-point! (-> this l-control) 0 s4-0)
|
||||
(set-point! (-> this l-control) 1 s5-0)
|
||||
(set! (-> this l-control spec) (-> *lightning-spec-id-table* 19))
|
||||
(+! (-> this l-control state points-to-draw) 2)
|
||||
(let ((v1-91 (as-type (-> s3-0 best-other-tri collide-ptr) collide-shape-prim))
|
||||
(s1-7 #t)
|
||||
)
|
||||
(when v1-91
|
||||
(set! s1-7 #f)
|
||||
(let ((s0-1 (new 'stack-no-clear 'projectile-init-by-other-params)))
|
||||
(set! (-> s0-1 ent) (-> this entity))
|
||||
(set! (-> s0-1 charge) 1.0)
|
||||
(set! (-> s0-1 options) (projectile-options))
|
||||
(logclear! (-> s0-1 options) (projectile-options po14 po15 po16))
|
||||
(set! (-> s0-1 notify-handle) (process->handle this))
|
||||
(set! (-> s0-1 owner-handle) (the-as handle #f))
|
||||
(set! (-> s0-1 target-handle) (the-as handle #f))
|
||||
(set! (-> s0-1 target-pos quad) (the-as uint128 0))
|
||||
(set! (-> s0-1 ignore-handle) (process->handle this))
|
||||
(set! (-> s0-1 attack-id) (-> this attack-id))
|
||||
(set! (-> s0-1 timeout) (seconds 4))
|
||||
(vector-copy! (-> s0-1 pos) s4-0)
|
||||
(vector-! (-> s0-1 vel) s5-0 s4-0)
|
||||
(vector-normalize! (-> s0-1 vel) 131072.0)
|
||||
(spawn-projectile guard-lazer-shot s0-1 this *default-dead-pool*)
|
||||
)
|
||||
)
|
||||
)
|
||||
(spread-lightning-lazer (-> this l-control) s5-0 s2-1 (-> s3-0 best-other-tri normal))
|
||||
)
|
||||
(else
|
||||
(cond
|
||||
((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13))
|
||||
(vector-copy! (-> *launch-matrix* trans) s4-0)
|
||||
(part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
(else
|
||||
(vector-copy! (-> *launch-matrix* trans) s4-0)
|
||||
(part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13))
|
||||
(vector-copy! (-> *launch-matrix* trans) s5-0)
|
||||
(part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
(else
|
||||
(vector-copy! (-> *launch-matrix* trans) s5-0)
|
||||
(part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254))
|
||||
)
|
||||
)
|
||||
(set! (-> this l-control state points-to-draw) 9)
|
||||
(set! (-> this l-control spec) (-> *lightning-spec-id-table* 20))
|
||||
(let ((v1-176 s4-0))
|
||||
(set! (-> this l-control state meet data 0 quad) (-> v1-176 quad))
|
||||
)
|
||||
(let ((a0-98 (-> this l-control))
|
||||
(v1-178 s5-0)
|
||||
)
|
||||
(vector-copy! (-> a0-98 state meet data (+ (-> a0-98 state points-to-draw) -1)) v1-178)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defstate attack (crimson-guard)
|
||||
|
||||
@@ -233,145 +233,106 @@
|
||||
(defstate idle-close (security-wall)
|
||||
:virtual #t
|
||||
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(case message
|
||||
(('on)
|
||||
(let ((v1-2 (-> self root root-prim)))
|
||||
(set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as))
|
||||
(let ((v0-0 (the-as object (-> self root backup-collide-with))))
|
||||
(set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0))
|
||||
v0-0
|
||||
)
|
||||
(case message
|
||||
(('on)
|
||||
(let ((v1-2 (-> self root root-prim)))
|
||||
(set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as))
|
||||
(let ((v0-0 (the-as object (-> self root backup-collide-with))))
|
||||
(set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0))
|
||||
v0-0
|
||||
)
|
||||
)
|
||||
(('off)
|
||||
(let ((v1-4 (-> self root root-prim)))
|
||||
(set! (-> v1-4 prim-core collide-as) (collide-spec))
|
||||
(set! (-> v1-4 prim-core collide-with) (collide-spec))
|
||||
)
|
||||
0
|
||||
)
|
||||
(('off)
|
||||
(let ((v1-4 (-> self root root-prim)))
|
||||
(set! (-> v1-4 prim-core collide-as) (collide-spec))
|
||||
(set! (-> v1-4 prim-core collide-with) (collide-spec))
|
||||
)
|
||||
(('attack)
|
||||
(let ((v1-5 (the-as attack-info (-> block param 1))))
|
||||
(when (!= (-> v1-5 id) (-> self incoming-attack-id))
|
||||
(set! (-> self incoming-attack-id) (-> v1-5 id))
|
||||
(let ((s3-0 (as-type proc process-drawable)))
|
||||
(when s3-0
|
||||
(let ((s5-1 (process-spawn
|
||||
manipy
|
||||
:init manipy-init
|
||||
(-> (the-as process-drawable s3-0) root trans)
|
||||
(-> self entity)
|
||||
(art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer level) #f))
|
||||
#f
|
||||
0
|
||||
:name "manipy"
|
||||
:to self
|
||||
:stack-size #x20000
|
||||
)
|
||||
0
|
||||
)
|
||||
(('attack)
|
||||
(let ((v1-5 (the-as attack-info (-> block param 1))))
|
||||
(when (!= (-> v1-5 id) (-> self incoming-attack-id))
|
||||
(set! (-> self incoming-attack-id) (-> v1-5 id))
|
||||
(let ((s3-0 (as-type proc process-drawable)))
|
||||
(when s3-0
|
||||
(let ((s5-1 (process-spawn
|
||||
manipy
|
||||
:init manipy-init
|
||||
(-> (the-as process-drawable s3-0) root trans)
|
||||
(-> self entity)
|
||||
(art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer level) #f))
|
||||
#f
|
||||
0
|
||||
:name "manipy"
|
||||
:to self
|
||||
:stack-size #x20000
|
||||
)
|
||||
)
|
||||
(when s5-1
|
||||
(send-event (ppointer->process s5-1) 'anim-mode 'play1)
|
||||
(send-event (ppointer->process s5-1) 'speed 1.5)
|
||||
(send-event (ppointer->process s5-1) 'art-joint-anim "generic-ripples-idle" 0)
|
||||
(set-vector! (-> (the-as process-drawable (-> s5-1 0)) root scale) 1.0 1.0 1.0 1.0)
|
||||
(quaternion-rotate-local-x! (-> (the-as process-drawable (-> s5-1 0)) root quat) (-> self root quat) -16384.0)
|
||||
(let ((v1-43 (-> (the-as process-drawable (-> s5-1 0)) root trans)))
|
||||
(let ((a0-29 (-> (the-as process-drawable (-> s5-1 0)) root trans)))
|
||||
(let ((a1-11 *up-vector*))
|
||||
(let ((a2-7 8192.0))
|
||||
(.mov vf7 a2-7)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-11 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-29 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-43 quad) vf6)
|
||||
)
|
||||
(let ((f0-6 (vector4-dot (-> (the-as process-drawable (-> s5-1 0)) root trans) (the-as vector (-> self plane)))))
|
||||
(let ((v1-50 (-> (the-as process-drawable (-> s5-1 0)) root trans)))
|
||||
(let ((a0-33 (-> (the-as process-drawable (-> s5-1 0)) root trans)))
|
||||
(let ((a1-12 (-> self plane)))
|
||||
(let ((a2-8 (- f0-6)))
|
||||
(.mov vf7 a2-8)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-12 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-33 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-50 quad) vf6)
|
||||
)
|
||||
(let ((v1-53 (-> (the-as process-drawable (-> s5-1 0)) root trans)))
|
||||
(let ((a0-36 (-> (the-as process-drawable (-> s5-1 0)) root trans)))
|
||||
(let ((a1-13 (-> self plane)))
|
||||
(let ((a2-10 (the-as float (if (< 0.0 f0-6)
|
||||
-2048.0
|
||||
2048.0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(.mov vf7 a2-10)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-13 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-36 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-53 quad) vf6)
|
||||
)
|
||||
)
|
||||
(send-event (ppointer->process s5-1) 'trans-hook (lambda () #f))
|
||||
)
|
||||
(when s5-1
|
||||
(send-event (ppointer->process s5-1) 'anim-mode 'play1)
|
||||
(send-event (ppointer->process s5-1) 'speed 1.5)
|
||||
(send-event (ppointer->process s5-1) 'art-joint-anim "generic-ripples-idle" 0)
|
||||
(set-vector! (-> (the-as process-drawable (-> s5-1 0)) root scale) 1.0 1.0 1.0 1.0)
|
||||
(quaternion-rotate-local-x! (-> (the-as process-drawable (-> s5-1 0)) root quat) (-> self root quat) -16384.0)
|
||||
(vector+*!
|
||||
(-> (the-as process-drawable (-> s5-1 0)) root trans)
|
||||
(-> (the-as process-drawable (-> s5-1 0)) root trans)
|
||||
*up-vector*
|
||||
8192.0
|
||||
)
|
||||
(let ((f0-6 (vector4-dot (-> (the-as process-drawable (-> s5-1 0)) root trans) (the-as vector (-> self plane)))))
|
||||
(vector+*!
|
||||
(-> (the-as process-drawable (-> s5-1 0)) root trans)
|
||||
(-> (the-as process-drawable (-> s5-1 0)) root trans)
|
||||
(the-as vector (-> self plane))
|
||||
(- f0-6)
|
||||
)
|
||||
(vector+*!
|
||||
(-> (the-as process-drawable (-> s5-1 0)) root trans)
|
||||
(-> (the-as process-drawable (-> s5-1 0)) root trans)
|
||||
(the-as vector (-> self plane))
|
||||
(if (< 0.0 f0-6)
|
||||
-2048.0
|
||||
2048.0
|
||||
)
|
||||
)
|
||||
)
|
||||
(send-event (ppointer->process s5-1) 'trans-hook (lambda () #f))
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (zero? (-> self touch-count))
|
||||
(+! (-> self touch-count) 1)
|
||||
(set! (-> self flash) 0.375)
|
||||
)
|
||||
)
|
||||
(when (zero? (-> self touch-count))
|
||||
(+! (-> self touch-count) 1)
|
||||
(if (and (logtest? (-> proc mask) (process-mask target))
|
||||
(not (logtest? (process-mask projectile) (-> proc mask)))
|
||||
)
|
||||
(set! (-> self flash) 0.375)
|
||||
)
|
||||
(+! (-> self touch-count) 1)
|
||||
(if (and (logtest? (-> proc mask) (process-mask target))
|
||||
(not (logtest? (process-mask projectile) (-> proc mask)))
|
||||
)
|
||||
(play-speech self)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(('touched)
|
||||
(when (zero? (-> self touch-count))
|
||||
(+! (-> self touch-count) 1)
|
||||
(set! (-> self flash) 0.375)
|
||||
)
|
||||
(+! (-> self touch-count) 1)
|
||||
(let ((v1-84 (as-type proc process-focusable)))
|
||||
(when v1-84
|
||||
(let ((a0-45 (as-type (-> (the-as process-drawable v1-84) root) collide-shape)))
|
||||
(if (and a0-45 (logtest? (-> (the-as collide-shape a0-45) root-prim prim-core collide-as) (collide-spec jak)))
|
||||
(play-speech self)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(('touched)
|
||||
(when (zero? (-> self touch-count))
|
||||
(+! (-> self touch-count) 1)
|
||||
(set! (-> self flash) 0.375)
|
||||
)
|
||||
(+! (-> self touch-count) 1)
|
||||
(let ((v1-81 (as-type proc process-focusable)))
|
||||
(when v1-81
|
||||
(let ((a0-45 (as-type (-> (the-as process-drawable v1-81) root) collide-shape)))
|
||||
(if (and a0-45 (logtest? (-> (the-as collide-shape a0-45) root-prim prim-core collide-as) (collide-spec jak)))
|
||||
(play-speech self)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
:trans (behavior ()
|
||||
@@ -1069,96 +1030,59 @@
|
||||
(defstate idle (propa)
|
||||
:virtual #t
|
||||
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(case message
|
||||
(('attack)
|
||||
(get-penetrate-using-from-attack-event (the-as process-drawable proc) block)
|
||||
(let ((v1-2 (the-as object (-> block param 1))))
|
||||
(when (!= (-> (the-as attack-info v1-2) id) (-> self incoming-attack-id))
|
||||
(set! (-> self incoming-attack-id) (-> (the-as attack-info v1-2) id))
|
||||
(let ((s5-1 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block)))
|
||||
(if (and (not (logtest? (penetrate dark-skin) s5-1)) (zero? (propa-pu->knocked-type s5-1)))
|
||||
(set! (-> self hit-points) (- (-> self hit-points) (the int (penetrate-using->damage s5-1))))
|
||||
(+! (-> self hit-points) -10)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((< (-> self hit-points) 3)
|
||||
(setup-masks (-> self draw) 0 -1)
|
||||
(setup-masks (-> self draw) 1 0)
|
||||
(let* ((a0-9 (the-as collide-shape-prim-group (-> self root root-prim)))
|
||||
(v1-18 (-> a0-9 child 0))
|
||||
)
|
||||
(let ((a0-11 (-> a0-9 child 1)))
|
||||
(set! (-> a0-11 prim-core collide-as) (-> v1-18 prim-core collide-as))
|
||||
(set! (-> a0-11 prim-core collide-with) (-> v1-18 prim-core collide-with))
|
||||
)
|
||||
(set! (-> v1-18 prim-core collide-as) (collide-spec))
|
||||
(set! (-> v1-18 prim-core collide-with) (collide-spec))
|
||||
)
|
||||
0
|
||||
(cond
|
||||
((logtest? (-> *part-group-id-table* 224 flags) (sp-group-flag sp13))
|
||||
(let ((v1-25 (-> *launch-matrix* trans))
|
||||
(a0-12 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((a1-9 (-> self root trans)))
|
||||
(let ((a2-3 *up-vector*))
|
||||
(let ((a3-2 8192.0))
|
||||
(.mov vf7 a3-2)
|
||||
)
|
||||
(.lvf vf5 (&-> a2-3 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a1-9 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-12 quad) vf6)
|
||||
(vector-copy! v1-25 a0-12)
|
||||
(case message
|
||||
(('attack)
|
||||
(get-penetrate-using-from-attack-event (the-as process-drawable proc) block)
|
||||
(let ((v1-2 (the-as object (-> block param 1))))
|
||||
(when (!= (-> (the-as attack-info v1-2) id) (-> self incoming-attack-id))
|
||||
(set! (-> self incoming-attack-id) (-> (the-as attack-info v1-2) id))
|
||||
(let ((s5-1 (get-penetrate-using-from-attack-event (the-as process-drawable proc) block)))
|
||||
(if (and (not (logtest? (penetrate dark-skin) s5-1)) (zero? (propa-pu->knocked-type s5-1)))
|
||||
(set! (-> self hit-points) (- (-> self hit-points) (the int (penetrate-using->damage s5-1))))
|
||||
(+! (-> self hit-points) -10)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((< (-> self hit-points) 3)
|
||||
(setup-masks (-> self draw) 0 -1)
|
||||
(setup-masks (-> self draw) 1 0)
|
||||
(let* ((a0-9 (the-as collide-shape-prim-group (-> self root root-prim)))
|
||||
(v1-18 (-> a0-9 child 0))
|
||||
)
|
||||
(part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 224))
|
||||
)
|
||||
(else
|
||||
(let ((v1-40 (-> *launch-matrix* trans))
|
||||
(a0-17 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((a1-14 (-> self root trans)))
|
||||
(let ((a2-9 *up-vector*))
|
||||
(let ((a3-6 8192.0))
|
||||
(.mov vf7 a3-6)
|
||||
)
|
||||
(.lvf vf5 (&-> a2-9 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a1-14 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-17 quad) vf6)
|
||||
(vector-copy! v1-40 a0-17)
|
||||
)
|
||||
(part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 224))
|
||||
)
|
||||
(let ((a0-11 (-> a0-9 child 1)))
|
||||
(set! (-> a0-11 prim-core collide-as) (-> v1-18 prim-core collide-as))
|
||||
(set! (-> a0-11 prim-core collide-with) (-> v1-18 prim-core collide-with))
|
||||
)
|
||||
(go-virtual broken)
|
||||
(set! (-> v1-18 prim-core collide-as) (collide-spec))
|
||||
(set! (-> v1-18 prim-core collide-with) (collide-spec))
|
||||
)
|
||||
((< (-> self hit-points) 6)
|
||||
(setup-masks (-> self draw) 0 -1)
|
||||
(setup-masks (-> self draw) 2 0)
|
||||
0
|
||||
(cond
|
||||
((logtest? (-> *part-group-id-table* 224 flags) (sp-group-flag sp13))
|
||||
(vector-copy!
|
||||
(-> *launch-matrix* trans)
|
||||
(vector+*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 8192.0)
|
||||
)
|
||||
(part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 224))
|
||||
)
|
||||
(else
|
||||
(vector-copy!
|
||||
(-> *launch-matrix* trans)
|
||||
(vector+*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 8192.0)
|
||||
)
|
||||
(part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 224))
|
||||
)
|
||||
)
|
||||
)
|
||||
(go-virtual broken)
|
||||
)
|
||||
((< (-> self hit-points) 6)
|
||||
(setup-masks (-> self draw) 0 -1)
|
||||
(setup-masks (-> self draw) 2 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
:exit (behavior ()
|
||||
@@ -1537,36 +1461,14 @@
|
||||
)
|
||||
:code sleep-code
|
||||
:post (behavior ()
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(when *target*
|
||||
(let* ((a0-0 (-> *target* neck))
|
||||
(t9-0 (method-of-object a0-0 look-at!))
|
||||
(a1-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((v1-4 (-> self root trans)))
|
||||
(let ((a2-0 *up-vector*))
|
||||
(let ((a3-1 20480.0))
|
||||
(.mov vf7 a3-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a2-0 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-0 quad) vf6)
|
||||
(t9-0 a0-0 a1-0 #f self)
|
||||
(if *target*
|
||||
(look-at!
|
||||
(-> *target* neck)
|
||||
(vector+*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 20480.0)
|
||||
#f
|
||||
self
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1596,79 +1498,59 @@
|
||||
(sv-320 float)
|
||||
(sv-336 float)
|
||||
)
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(when (!= (-> self time) -1.0)
|
||||
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
||||
(new 'stack-no-clear 'vector)
|
||||
(let ((s5-0 gp-0)
|
||||
(s4-0 (-> self root trans))
|
||||
(s3-0 vector-orient-by-quat!)
|
||||
(s2-0 (new 'stack-no-clear 'vector))
|
||||
(s1-0 (new 'static 'vector :y 16384.0 :z 40960.0 :w 1.0))
|
||||
(s0-0 quaternion-rotate-local-y!)
|
||||
)
|
||||
(set! sv-272 (new 'stack-no-clear 'vector))
|
||||
(set! sv-288 (-> self root quat))
|
||||
(set! sv-304 lerp-scale)
|
||||
(set! sv-320 (-> self rotmin))
|
||||
(set! sv-336 (-> self rotmax))
|
||||
(let* ((a2-0 (sin (* 7281.778 (-> self time))))
|
||||
(a3-0 -1.0)
|
||||
(t0-0 1.0)
|
||||
(a2-1 (sv-304 sv-320 sv-336 a2-0 a3-0 t0-0))
|
||||
)
|
||||
(vector+! s5-0 s4-0 (s3-0 s2-0 s1-0 (s0-0 (the-as quaternion sv-272) sv-288 a2-1)))
|
||||
(when (!= (-> self time) -1.0)
|
||||
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
||||
(new 'stack-no-clear 'vector)
|
||||
(let ((s5-0 gp-0)
|
||||
(s4-0 (-> self root trans))
|
||||
(s3-0 vector-orient-by-quat!)
|
||||
(s2-0 (new 'stack-no-clear 'vector))
|
||||
(s1-0 (new 'static 'vector :y 16384.0 :z 40960.0 :w 1.0))
|
||||
(s0-0 quaternion-rotate-local-y!)
|
||||
)
|
||||
)
|
||||
(vector-copy! (-> *camera* slave 0 trans) gp-0)
|
||||
(let ((t9-4 forward-down->inv-matrix)
|
||||
(a0-6 (-> *camera* slave 0 tracking))
|
||||
(a1-3 (new 'stack-no-clear 'vector))
|
||||
(v1-18 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((a2-4 (-> self root trans)))
|
||||
(let ((a3-1 *up-vector*))
|
||||
(let ((t0-2 20480.0))
|
||||
(.mov vf7 t0-2)
|
||||
)
|
||||
(.lvf vf5 (&-> a3-1 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a2-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-18 quad) vf6)
|
||||
(t9-4 (-> a0-6 inv-mat) (vector-! a1-3 v1-18 gp-0) (-> *camera* local-down))
|
||||
(set! sv-272 (new 'stack-no-clear 'vector))
|
||||
(set! sv-288 (-> self root quat))
|
||||
(set! sv-304 lerp-scale)
|
||||
(set! sv-320 (-> self rotmin))
|
||||
(set! sv-336 (-> self rotmax))
|
||||
(let* ((a2-0 (sin (* 7281.778 (-> self time))))
|
||||
(a3-0 -1.0)
|
||||
(t0-0 1.0)
|
||||
(a2-1 (sv-304 sv-320 sv-336 a2-0 a3-0 t0-0))
|
||||
)
|
||||
(vector+! s5-0 s4-0 (s3-0 s2-0 s1-0 (s0-0 (the-as quaternion sv-272) sv-288 a2-1)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((gp-1 (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data 3 bone transform))))
|
||||
(if (< (vector-dot
|
||||
(-> gp-1 fvec)
|
||||
(vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans gp-1 (new 'stack-no-clear 'vector)))
|
||||
)
|
||||
0.0
|
||||
)
|
||||
(matrix*! gp-1 (matrix-rotate-y! (new 'stack-no-clear 'matrix) 32768.0) gp-1)
|
||||
(vector-copy! (-> *camera* slave 0 trans) gp-0)
|
||||
(forward-down->inv-matrix
|
||||
(-> *camera* slave 0 tracking inv-mat)
|
||||
(vector-!
|
||||
(new 'stack-no-clear 'vector)
|
||||
(vector+*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 20480.0)
|
||||
gp-0
|
||||
)
|
||||
(+! (-> self angle) (* 100.0 (rand-vu)))
|
||||
(set! (-> *part-id-table* 1180 init-specs 4 initial-valuef)
|
||||
(+ 14336.0 (* 1228.8 (cos (* 182.04445 (-> self angle)))))
|
||||
)
|
||||
(set! (-> *part-id-table* 1181 init-specs 4 initial-valuef)
|
||||
(+ 2048.0 (-> *part-id-table* 1180 init-specs 4 initial-valuef))
|
||||
)
|
||||
(spawn-from-mat (-> self part) gp-1)
|
||||
(-> *camera* local-down)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((gp-1 (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data 3 bone transform))))
|
||||
(if (< (vector-dot
|
||||
(-> gp-1 fvec)
|
||||
(vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans gp-1 (new 'stack-no-clear 'vector)))
|
||||
)
|
||||
0.0
|
||||
)
|
||||
(matrix*! gp-1 (matrix-rotate-y! (new 'stack-no-clear 'matrix) 32768.0) gp-1)
|
||||
)
|
||||
(+! (-> self angle) (* 100.0 (rand-vu)))
|
||||
(set! (-> *part-id-table* 1180 init-specs 4 initial-valuef)
|
||||
(+ 14336.0 (* 1228.8 (cos (* 182.04445 (-> self angle)))))
|
||||
)
|
||||
(set! (-> *part-id-table* 1181 init-specs 4 initial-valuef)
|
||||
(+ 2048.0 (-> *part-id-table* 1180 init-specs 4 initial-valuef))
|
||||
)
|
||||
(spawn-from-mat (-> self part) gp-1)
|
||||
)
|
||||
)
|
||||
:code (behavior ()
|
||||
(set-setting! 'mode-name 'cam-really-fixed 0.0 0)
|
||||
@@ -1718,36 +1600,14 @@
|
||||
(go-virtual idle)
|
||||
)
|
||||
:post (behavior ()
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(when *target*
|
||||
(let* ((a0-0 (-> *target* neck))
|
||||
(t9-0 (method-of-object a0-0 look-at!))
|
||||
(a1-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((v1-4 (-> self root trans)))
|
||||
(let ((a2-0 *up-vector*))
|
||||
(let ((a3-1 20480.0))
|
||||
(.mov vf7 a3-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a2-0 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-0 quad) vf6)
|
||||
(t9-0 a0-0 a1-0 #f self)
|
||||
(if *target*
|
||||
(look-at!
|
||||
(-> *target* neck)
|
||||
(vector+*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 20480.0)
|
||||
#f
|
||||
self
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1765,119 +1625,99 @@
|
||||
(remove-setting! 'mode-name)
|
||||
)
|
||||
:trans (behavior ()
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(when (time-elapsed? (-> self state-time) (seconds 1.5))
|
||||
(let ((gp-0 0)
|
||||
(s5-0 0)
|
||||
(when (time-elapsed? (-> self state-time) (seconds 1.5))
|
||||
(let ((gp-0 0)
|
||||
(s5-0 0)
|
||||
)
|
||||
(when (cpad-pressed? 0 down l-analog-down)
|
||||
(+! s5-0 1)
|
||||
(if (< (+ gp-0 -1) s5-0)
|
||||
(set! s5-0 (+ gp-0 -1))
|
||||
(sound-play "menu-up-down")
|
||||
)
|
||||
(when (cpad-pressed? 0 down l-analog-down)
|
||||
(+! s5-0 1)
|
||||
(if (< (+ gp-0 -1) s5-0)
|
||||
(set! s5-0 (+ gp-0 -1))
|
||||
(sound-play "menu-up-down")
|
||||
)
|
||||
)
|
||||
(when (cpad-pressed? 0 up l-analog-up)
|
||||
(+! s5-0 -1)
|
||||
(if (< s5-0 0)
|
||||
(set! s5-0 0)
|
||||
(sound-play "menu-up-down")
|
||||
)
|
||||
)
|
||||
(let* ((s4-2 40)
|
||||
(s3-2 36)
|
||||
(s2-0 (- 228 (* gp-0 (/ s4-2 2))))
|
||||
(v1-19 (new
|
||||
'stack
|
||||
'font-context
|
||||
*font-default-matrix*
|
||||
s3-2
|
||||
s2-0
|
||||
0.0
|
||||
(font-color default)
|
||||
(font-flags shadow kerning)
|
||||
)
|
||||
)
|
||||
(when (cpad-pressed? 0 up l-analog-up)
|
||||
(+! s5-0 -1)
|
||||
(if (< s5-0 0)
|
||||
(set! s5-0 0)
|
||||
(sound-play "menu-up-down")
|
||||
)
|
||||
)
|
||||
(let* ((s4-2 40)
|
||||
(s3-2 36)
|
||||
(s2-0 (- 228 (* gp-0 (/ s4-2 2))))
|
||||
(v1-19 (new
|
||||
'stack
|
||||
'font-context
|
||||
*font-default-matrix*
|
||||
s3-2
|
||||
s2-0
|
||||
0.0
|
||||
(font-color default)
|
||||
(font-flags shadow kerning)
|
||||
)
|
||||
)
|
||||
(set! (-> v1-19 flags) (font-flags shadow kerning middle middle-vert large))
|
||||
(set-width! v1-19 440)
|
||||
(set-height! v1-19 50)
|
||||
(set-scale! v1-19 1.0)
|
||||
(set-origin! v1-19 s3-2 40)
|
||||
(let ((a1-7 v1-19))
|
||||
(set! (-> a1-7 color) (font-color progress-old-yellow))
|
||||
)
|
||||
(set-height! v1-19 s4-2)
|
||||
(dotimes (a0-23 gp-0)
|
||||
(set-origin! v1-19 s3-2 s2-0)
|
||||
(set-scale! v1-19 (if (= a0-23 s5-0)
|
||||
0.8
|
||||
0.6
|
||||
)
|
||||
)
|
||||
(let ((a2-6 v1-19))
|
||||
(set! (-> a2-6 color) (if (= a0-23 s5-0)
|
||||
(font-color progress-old-selected)
|
||||
(font-color default)
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! s2-0 s4-2)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (!= (-> self time) -1.0)
|
||||
(let ((gp-1 (new 'stack-no-clear 'vector)))
|
||||
(new 'stack-no-clear 'vector)
|
||||
(vector+! gp-1 (-> self root trans) (vector-orient-by-quat!
|
||||
(new 'stack-no-clear 'vector)
|
||||
(new 'static 'vector :y 24166.4 :z 32768.0 :w 1.0)
|
||||
(-> self root quat)
|
||||
)
|
||||
)
|
||||
(vector-copy! (-> *camera* slave 0 trans) gp-1)
|
||||
(let ((t9-6 forward-down->inv-matrix)
|
||||
(a0-27 (-> *camera* slave 0 tracking))
|
||||
(a1-13 (new 'stack-no-clear 'vector))
|
||||
(v1-35 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((a2-9 (-> self root trans)))
|
||||
(let ((a3-4 *up-vector*))
|
||||
(let ((t0-4 24166.4))
|
||||
(.mov vf7 t0-4)
|
||||
)
|
||||
(.lvf vf5 (&-> a3-4 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a2-9 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-35 quad) vf6)
|
||||
(t9-6 (-> a0-27 inv-mat) (vector-! a1-13 v1-35 gp-1) (-> *camera* local-down))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((gp-2 (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data 3 bone transform))))
|
||||
(if (< (vector-dot
|
||||
(-> gp-2 fvec)
|
||||
(vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans gp-2 (new 'stack-no-clear 'vector)))
|
||||
)
|
||||
0.0
|
||||
)
|
||||
(matrix*! gp-2 (matrix-rotate-y! (new 'stack-no-clear 'matrix) 32768.0) gp-2)
|
||||
(set! (-> v1-19 flags) (font-flags shadow kerning middle middle-vert large))
|
||||
(set-width! v1-19 440)
|
||||
(set-height! v1-19 50)
|
||||
(set-scale! v1-19 1.0)
|
||||
(set-origin! v1-19 s3-2 40)
|
||||
(let ((a1-7 v1-19))
|
||||
(set! (-> a1-7 color) (font-color progress-old-yellow))
|
||||
)
|
||||
(spawn-from-mat (-> self part-off) gp-2)
|
||||
(set-height! v1-19 s4-2)
|
||||
(dotimes (a0-23 gp-0)
|
||||
(set-origin! v1-19 s3-2 s2-0)
|
||||
(set-scale! v1-19 (if (= a0-23 s5-0)
|
||||
0.8
|
||||
0.6
|
||||
)
|
||||
)
|
||||
(let ((a2-6 v1-19))
|
||||
(set! (-> a2-6 color) (if (= a0-23 s5-0)
|
||||
(font-color progress-old-selected)
|
||||
(font-color default)
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! s2-0 s4-2)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (!= (-> self time) -1.0)
|
||||
(let ((gp-1 (new 'stack-no-clear 'vector)))
|
||||
(new 'stack-no-clear 'vector)
|
||||
(vector+! gp-1 (-> self root trans) (vector-orient-by-quat!
|
||||
(new 'stack-no-clear 'vector)
|
||||
(new 'static 'vector :y 24166.4 :z 32768.0 :w 1.0)
|
||||
(-> self root quat)
|
||||
)
|
||||
)
|
||||
(vector-copy! (-> *camera* slave 0 trans) gp-1)
|
||||
(forward-down->inv-matrix
|
||||
(-> *camera* slave 0 tracking inv-mat)
|
||||
(vector-!
|
||||
(new 'stack-no-clear 'vector)
|
||||
(vector+*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 24166.4)
|
||||
gp-1
|
||||
)
|
||||
(-> *camera* local-down)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((gp-2 (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data 3 bone transform))))
|
||||
(if (< (vector-dot
|
||||
(-> gp-2 fvec)
|
||||
(vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans gp-2 (new 'stack-no-clear 'vector)))
|
||||
)
|
||||
0.0
|
||||
)
|
||||
(matrix*! gp-2 (matrix-rotate-y! (new 'stack-no-clear 'matrix) 32768.0) gp-2)
|
||||
)
|
||||
(spawn-from-mat (-> self part-off) gp-2)
|
||||
)
|
||||
)
|
||||
:code (behavior ()
|
||||
(set-setting! 'mode-name 'cam-really-fixed 0.0 0)
|
||||
@@ -1931,36 +1771,14 @@
|
||||
(go-virtual idle)
|
||||
)
|
||||
:post (behavior ()
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(when *target*
|
||||
(let* ((a0-0 (-> *target* neck))
|
||||
(t9-0 (method-of-object a0-0 look-at!))
|
||||
(a1-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((v1-4 (-> self root trans)))
|
||||
(let ((a2-0 *up-vector*))
|
||||
(let ((a3-1 20480.0))
|
||||
(.mov vf7 a3-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a2-0 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-0 quad) vf6)
|
||||
(t9-0 a0-0 a1-0 #f self)
|
||||
(if *target*
|
||||
(look-at!
|
||||
(-> *target* neck)
|
||||
(vector+*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 20480.0)
|
||||
#f
|
||||
self
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -835,33 +835,10 @@
|
||||
(defstate waiting-idle (jinx)
|
||||
:virtual #t
|
||||
:trans (behavior ()
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((gp-0 (-> self destination)))
|
||||
(let ((v1-0 (target-pos 0)))
|
||||
(let ((a0-1 (-> self follow-dir)))
|
||||
(let ((a1-0 (-> self follow-offset)))
|
||||
(.mov vf7 a1-0)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-1 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-0 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> gp-0 quad) vf6)
|
||||
(vector+*! (-> self destination) (target-pos 0) (-> self follow-dir) (-> self follow-offset))
|
||||
(if (< 12288.0 (vector-vector-distance (-> self destination) (-> self root trans)))
|
||||
(go-virtual traveling)
|
||||
)
|
||||
(if (< 12288.0 (vector-vector-distance (-> self destination) (-> self root trans)))
|
||||
(go-virtual traveling)
|
||||
)
|
||||
)
|
||||
)
|
||||
:code (behavior ()
|
||||
(let ((v1-2 (ja-group)))
|
||||
@@ -919,37 +896,14 @@
|
||||
(nav-enemy-method-177 self)
|
||||
)
|
||||
:trans (behavior ()
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((gp-0 (-> self destination)))
|
||||
(let ((v1-0 (target-pos 0)))
|
||||
(let ((a0-1 (-> self follow-dir)))
|
||||
(let ((a1-0 (-> self follow-offset)))
|
||||
(.mov vf7 a1-0)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-1 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-0 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> gp-0 quad) vf6)
|
||||
)
|
||||
(cond
|
||||
((< (vector-vector-distance (-> self destination) (-> self root trans)) 8192.0)
|
||||
(go-virtual waiting-idle)
|
||||
)
|
||||
((and (time-elapsed? (-> self state-time) (seconds 0.5)) (player-blocking-travel? self))
|
||||
(go-virtual traveling-blocked)
|
||||
)
|
||||
)
|
||||
(vector+*! (-> self destination) (target-pos 0) (-> self follow-dir) (-> self follow-offset))
|
||||
(cond
|
||||
((< (vector-vector-distance (-> self destination) (-> self root trans)) 8192.0)
|
||||
(go-virtual waiting-idle)
|
||||
)
|
||||
((and (time-elapsed? (-> self state-time) (seconds 0.5)) (player-blocking-travel? self))
|
||||
(go-virtual traveling-blocked)
|
||||
)
|
||||
)
|
||||
)
|
||||
:code (behavior ()
|
||||
@@ -1665,222 +1619,194 @@
|
||||
)
|
||||
|
||||
(defmethod task-manager-method-26 ((this task-manager-city-destroy-grid))
|
||||
(local-vars (v1-180 float) (v1-201 float))
|
||||
(with-pp
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(update-jinx-speech this)
|
||||
(when (nonzero? (-> this jinx))
|
||||
(let ((s5-0 (the-as jinx (handle->process (-> this jinx)))))
|
||||
(when s5-0
|
||||
(when (nonzero? (-> this actor-group))
|
||||
(dotimes (s4-0 (length (-> this actor-group 0)))
|
||||
(let ((s3-0 (-> this actor-group 0 data s4-0)))
|
||||
(when (= (-> this next-box) s4-0)
|
||||
(vector-copy! (-> this goal-pos) (-> s3-0 actor trans))
|
||||
(let ((s2-0 (-> this goal-pos-front)))
|
||||
(let ((s1-0 (-> s3-0 actor trans)))
|
||||
(let ((v1-17 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 actor quat))))
|
||||
(let ((a0-12 8192.0))
|
||||
(.mov vf7 a0-12)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-17 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> s1-0 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s2-0 quad) vf6)
|
||||
)
|
||||
(when (< (vector-vector-distance (-> s3-0 actor trans) (-> s5-0 root trans)) 40960.0)
|
||||
)
|
||||
(update-jinx-speech this)
|
||||
(when (nonzero? (-> this jinx))
|
||||
(let ((s5-0 (the-as jinx (handle->process (-> this jinx)))))
|
||||
(when s5-0
|
||||
(when (nonzero? (-> this actor-group))
|
||||
(dotimes (s4-0 (length (-> this actor-group 0)))
|
||||
(let ((s3-0 (-> this actor-group 0 data s4-0)))
|
||||
(when (= (-> this next-box) s4-0)
|
||||
(vector-copy! (-> this goal-pos) (-> s3-0 actor trans))
|
||||
(vector+*!
|
||||
(-> this goal-pos-front)
|
||||
(-> s3-0 actor trans)
|
||||
(vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 actor quat))
|
||||
8192.0
|
||||
)
|
||||
(when (< (vector-vector-distance (-> s3-0 actor trans) (-> s5-0 root trans)) 40960.0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((as-type (entity-nav-mesh-by-aid (-> s5-0 nav-mesh-aid)) entity-nav-mesh)
|
||||
)
|
||||
(else
|
||||
)
|
||||
)
|
||||
(when (= (+ (length (-> this actor-group 0)) 1) (-> this next-box))
|
||||
(+! (-> this next-box) 1)
|
||||
(deactivate s5-0)
|
||||
(let ((a0-19 (handle->process (-> this vehicle))))
|
||||
(if a0-19
|
||||
(deactivate a0-19)
|
||||
)
|
||||
)
|
||||
(let ((a0-22 (-> this arrow-h process 0)))
|
||||
(if a0-22
|
||||
(deactivate a0-22)
|
||||
)
|
||||
)
|
||||
(send-event this 'complete)
|
||||
)
|
||||
(let ((a1-6 *target*))
|
||||
(when (and a1-6 (focus-test? a1-6 pilot))
|
||||
(set-setting! 'music 'cityfi 0.0 0)
|
||||
(when (not (-> this intro-play?))
|
||||
(set-setting! 'airlock #f 0.0 0)
|
||||
(set-speech-name this "jinx102" 300 600)
|
||||
(set! (-> this intro-play?) #t)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-67 (handle->process (-> this vehicle))))
|
||||
(cond
|
||||
((as-type (entity-nav-mesh-by-aid (-> s5-0 nav-mesh-aid)) entity-nav-mesh)
|
||||
)
|
||||
(v1-67
|
||||
(logior! (-> (the-as vehicle v1-67) v-flags) (vehicle-flag persistent))
|
||||
(if (or (and (-> (the-as vehicle v1-67) next-state) (= (-> (the-as vehicle v1-67) next-state name) 'inactive))
|
||||
(focus-test? (the-as vehicle v1-67) dead)
|
||||
)
|
||||
(send-event this 'fail)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(send-event this 'fail)
|
||||
)
|
||||
)
|
||||
(when (= (+ (length (-> this actor-group 0)) 1) (-> this next-box))
|
||||
(+! (-> this next-box) 1)
|
||||
(deactivate s5-0)
|
||||
(let ((a0-20 (handle->process (-> this vehicle))))
|
||||
(if a0-20
|
||||
(deactivate a0-20)
|
||||
)
|
||||
)
|
||||
(let ((a0-23 (-> this arrow-h process 0)))
|
||||
(if a0-23
|
||||
(deactivate a0-23)
|
||||
)
|
||||
)
|
||||
(send-event this 'complete)
|
||||
)
|
||||
(let ((a1-6 *target*))
|
||||
(when (and a1-6 (focus-test? a1-6 pilot))
|
||||
(set-setting! 'music 'cityfi 0.0 0)
|
||||
(when (not (-> this intro-play?))
|
||||
(set-setting! 'airlock #f 0.0 0)
|
||||
(set-speech-name this "jinx102" 300 600)
|
||||
(set! (-> this intro-play?) #t)
|
||||
)
|
||||
(when (-> this arrow-h)
|
||||
(let ((a0-46 (-> this arrow-h process 0))
|
||||
(v1-82 *target*)
|
||||
(a2-4 (handle->process (-> this vehicle)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-67 (the-as vehicle (handle->process (-> this vehicle)))))
|
||||
(cond
|
||||
(v1-67
|
||||
(logior! (-> v1-67 v-flags) (vehicle-flag persistent))
|
||||
(if (or (and (-> v1-67 next-state) (= (-> v1-67 next-state name) 'inactive)) (focus-test? v1-67 dead))
|
||||
(send-event this 'fail)
|
||||
)
|
||||
)
|
||||
((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'wait-for-ride))
|
||||
(logclear! (-> (the-as vehicle a2-4) v-flags) (vehicle-flag persistent))
|
||||
(if (and (the-as vehicle a2-4) v1-82 (not (logtest? (focus-status pilot) (-> v1-82 focus-status))))
|
||||
(send-event a0-46 'set-position (-> (the-as vehicle a2-4) root trans))
|
||||
(send-event a0-46 'set-position (-> s5-0 root trans))
|
||||
)
|
||||
(send-event (handle->process (-> this arrow-h)) 'show)
|
||||
)
|
||||
((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'ride))
|
||||
(cond
|
||||
((and a2-4 v1-82 (not (logtest? (focus-status pilot) (-> v1-82 focus-status))))
|
||||
(send-event a0-46 'set-position (-> s5-0 root trans))
|
||||
(send-event (handle->process (-> this arrow-h)) 'show)
|
||||
)
|
||||
(else
|
||||
(send-event (handle->process (-> this arrow-h)) 'set-position (-> this goal-pos))
|
||||
(send-event (handle->process (-> this arrow-h)) 'show)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(send-event this 'fail)
|
||||
(send-event (handle->process (-> this arrow-h)) 'hide)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (-> this arrow-h)
|
||||
(let ((a0-47 (-> this arrow-h process 0))
|
||||
(v1-82 *target*)
|
||||
(a2-4 (handle->process (-> this vehicle)))
|
||||
)
|
||||
)
|
||||
(when *target*
|
||||
(if (< 819200.0 (vector-vector-distance (-> s5-0 root trans) (target-pos 0)))
|
||||
(send-event this 'fail)
|
||||
)
|
||||
(let ((s4-4 (handle->process (-> this vehicle))))
|
||||
(when s4-4
|
||||
(cond
|
||||
((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'wait-for-ride))
|
||||
(logclear! (-> (the-as vehicle a2-4) v-flags) (vehicle-flag persistent))
|
||||
(if (and (the-as vehicle a2-4) v1-82 (not (logtest? (focus-status pilot) (-> v1-82 focus-status))))
|
||||
(send-event a0-47 'set-position (-> (the-as vehicle a2-4) root trans))
|
||||
(send-event a0-47 'set-position (-> s5-0 root trans))
|
||||
)
|
||||
(send-event (handle->process (-> this arrow-h)) 'show)
|
||||
)
|
||||
((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'ride))
|
||||
(cond
|
||||
((and a2-4 v1-82 (not (logtest? (focus-status pilot) (-> v1-82 focus-status))))
|
||||
(send-event a0-47 'set-position (-> s5-0 root trans))
|
||||
(send-event (handle->process (-> this arrow-h)) 'show)
|
||||
)
|
||||
(else
|
||||
(send-event (handle->process (-> this arrow-h)) 'set-position (-> this goal-pos))
|
||||
(send-event (handle->process (-> this arrow-h)) 'show)
|
||||
(when (= (-> this next-box) (length (-> this actor-group 0)))
|
||||
(deactivate s5-0)
|
||||
(let ((a0-84 (handle->process (-> this vehicle))))
|
||||
(if a0-84
|
||||
(deactivate a0-84)
|
||||
)
|
||||
)
|
||||
(let ((a0-87 (-> this arrow-h process 0)))
|
||||
(if a0-87
|
||||
(deactivate a0-87)
|
||||
)
|
||||
)
|
||||
(send-event this 'complete)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(send-event (handle->process (-> this arrow-h)) 'hide)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when *target*
|
||||
(if (< 819200.0 (vector-vector-distance (-> s5-0 root trans) (target-pos 0)))
|
||||
(send-event this 'fail)
|
||||
)
|
||||
(let ((s4-4 (the-as vehicle (handle->process (-> this vehicle)))))
|
||||
(when s4-4
|
||||
(cond
|
||||
((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'ride))
|
||||
(when (= (-> this next-box) (length (-> this actor-group 0)))
|
||||
(deactivate s5-0)
|
||||
(let ((a0-85 (handle->process (-> this vehicle))))
|
||||
(if a0-85
|
||||
(deactivate a0-85)
|
||||
)
|
||||
)
|
||||
(let ((a0-88 (-> this arrow-h process 0)))
|
||||
(if a0-88
|
||||
(deactivate a0-88)
|
||||
)
|
||||
)
|
||||
(send-event this 'complete)
|
||||
)
|
||||
(if (and (< (vector-vector-distance (-> this goal-pos) (-> s5-0 root trans)) 163840.0)
|
||||
(begin
|
||||
(.lvf vf1 (&-> (-> s4-4 root transv) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-180 vf1)
|
||||
(let ((f0-4 v1-180)
|
||||
(f1-2 12288.0)
|
||||
)
|
||||
(< f0-4 (* f1-2 f1-2))
|
||||
(if (and (< (vector-vector-distance (-> this goal-pos) (-> s5-0 root trans)) 163840.0)
|
||||
(let ((f0-4 (vector-length-squared (-> (the-as vehicle s4-4) root transv)))
|
||||
(f1-2 12288.0)
|
||||
)
|
||||
)
|
||||
(< f0-4 (* f1-2 f1-2))
|
||||
)
|
||||
(send-event s5-0 'exit-vehicle (-> this goal-pos-front))
|
||||
)
|
||||
)
|
||||
((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'wait-for-ride))
|
||||
(let ((v1-197 (get-best-seat s4-4 (-> s4-4 root trans) (the-as vehicle-seat-flag (-> s5-0 info seat-flag)) 1)))
|
||||
(when (!= v1-197 -1)
|
||||
(.lvf vf1 (&-> (-> s4-4 root transv) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-201 vf1)
|
||||
(let ((f0-5 v1-201)
|
||||
(f1-5 32768.0)
|
||||
)
|
||||
(when (and (< f0-5 (* f1-5 f1-5))
|
||||
(let ((f0-6 (vector-vector-distance-squared (-> s4-4 root trans) (-> s5-0 root trans)))
|
||||
(f1-8 204800.0)
|
||||
)
|
||||
(< f0-6 (* f1-8 f1-8))
|
||||
)
|
||||
)
|
||||
(send-event s5-0 'board-vehicle s4-4)
|
||||
(when (and (nonzero? (-> this next-box)) (!= (-> this next-box) (length (-> this actor-group 0))))
|
||||
(let ((a1-50 (new 'stack-no-clear 'event-message-block)))
|
||||
(set! (-> a1-50 from) (process->ppointer pp))
|
||||
(set! (-> a1-50 num-params) 0)
|
||||
(set! (-> a1-50 message) 'explode)
|
||||
(let ((t9-38 send-event-function)
|
||||
(v1-228 (-> this actor-group 0 data (+ (-> this next-box) -1) actor))
|
||||
)
|
||||
(t9-38
|
||||
(if v1-228
|
||||
(-> v1-228 extra process)
|
||||
)
|
||||
a1-50
|
||||
)
|
||||
)
|
||||
(send-event s5-0 'exit-vehicle (-> this goal-pos-front))
|
||||
)
|
||||
)
|
||||
((and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'wait-for-ride))
|
||||
(let ((v1-197 (get-best-seat
|
||||
(the-as vehicle s4-4)
|
||||
(-> (the-as vehicle s4-4) root trans)
|
||||
(the-as vehicle-seat-flag (-> s5-0 info seat-flag))
|
||||
1
|
||||
)
|
||||
)
|
||||
(set-speech-name this (-> *jinx-board-vehicle-speech* *jinx-board-vehicle-speech-index*) 300 600)
|
||||
(set! *jinx-board-vehicle-speech-index*
|
||||
(mod (+ *jinx-board-vehicle-speech-index* 1) (-> *jinx-board-vehicle-speech* length))
|
||||
)
|
||||
(when (!= v1-197 -1)
|
||||
(let ((f0-5 (vector-length-squared (-> (the-as vehicle s4-4) root transv)))
|
||||
(f1-5 32768.0)
|
||||
)
|
||||
(when (and (< f0-5 (* f1-5 f1-5))
|
||||
(let ((f0-6 (vector-vector-distance-squared (-> (the-as vehicle s4-4) root trans) (-> s5-0 root trans)))
|
||||
(f1-8 204800.0)
|
||||
)
|
||||
(< f0-6 (* f1-8 f1-8))
|
||||
)
|
||||
)
|
||||
(send-event s5-0 'board-vehicle (the-as vehicle s4-4))
|
||||
(when (and (nonzero? (-> this next-box)) (!= (the-as jinx (-> this next-box)) (length (-> this actor-group 0))))
|
||||
(let ((a1-50 (new 'stack-no-clear 'event-message-block)))
|
||||
(set! (-> a1-50 from) (process->ppointer pp))
|
||||
(set! (-> a1-50 num-params) 0)
|
||||
(set! (-> a1-50 message) 'explode)
|
||||
(let ((t9-38 send-event-function)
|
||||
(v1-228 (-> this actor-group 0 data (+ (-> this next-box) -1) actor))
|
||||
)
|
||||
(t9-38
|
||||
(if v1-228
|
||||
(-> v1-228 extra process)
|
||||
)
|
||||
a1-50
|
||||
)
|
||||
)
|
||||
)
|
||||
(set-speech-name this (-> *jinx-board-vehicle-speech* *jinx-board-vehicle-speech-index*) 300 600)
|
||||
(set! *jinx-board-vehicle-speech-index*
|
||||
(mod (+ *jinx-board-vehicle-speech-index* 1) (-> *jinx-board-vehicle-speech* length))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -661,7 +661,7 @@
|
||||
)
|
||||
(vector-normalize! s4-1 1.0)
|
||||
(let ((f0-12 (fmin f30-0 (* f28-0 (seconds-per-frame)))))
|
||||
(vector-rotate-around-axis! gp-0 (the-as quaternion gp-0) f0-12 s4-1)
|
||||
(vector-rotate-around-axis! gp-0 gp-0 f0-12 s4-1)
|
||||
)
|
||||
)
|
||||
(quaternion-look-at! (-> self root quat) gp-0 *up-vector*)
|
||||
|
||||
@@ -825,7 +825,7 @@
|
||||
)
|
||||
(vector-normalize! s2-1 1.0)
|
||||
(let ((f0-23 (fmin f28-0 (* 16384.0 arg0))))
|
||||
(vector-rotate-around-axis! s4-2 (the-as quaternion s4-2) f0-23 s2-1)
|
||||
(vector-rotate-around-axis! s4-2 s4-2 f0-23 s2-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1679,44 +1679,21 @@
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod bombbot-method-196 ((this assault-bombbot) (arg0 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((gp-0 (the-as target (as-type *target* process-focusable))))
|
||||
(cond
|
||||
(gp-0
|
||||
(vector-copy! (-> this target-pos) (get-trans gp-0 3))
|
||||
(let ((v1-3 (-> this target-pos)))
|
||||
(let ((a0-4 (-> gp-0 control trans)))
|
||||
(let ((a1-4 (-> gp-0 control transv)))
|
||||
(let ((a2-0 0.0))
|
||||
(.mov vf7 a2-0)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-4 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-3 quad) vf6)
|
||||
)
|
||||
(vector-copy! (-> this start-target-pos) (-> this target-pos))
|
||||
(vector-copy! (-> this start-target-vel) (-> gp-0 control transv))
|
||||
(focus-on! (-> this focus) gp-0 this)
|
||||
)
|
||||
(else
|
||||
(clear-focused (-> this focus))
|
||||
)
|
||||
(let ((gp-0 (the-as target (as-type *target* process-focusable))))
|
||||
(cond
|
||||
(gp-0
|
||||
(vector-copy! (-> this target-pos) (get-trans gp-0 3))
|
||||
(vector+*! (-> this target-pos) (-> gp-0 control trans) (-> gp-0 control transv) 0.0)
|
||||
(vector-copy! (-> this start-target-pos) (-> this target-pos))
|
||||
(vector-copy! (-> this start-target-vel) (-> gp-0 control transv))
|
||||
(focus-on! (-> this focus) gp-0 this)
|
||||
)
|
||||
(else
|
||||
(clear-focused (-> this focus))
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod assault-bombbot-method-209 ((this assault-bombbot))
|
||||
@@ -1814,89 +1791,71 @@
|
||||
)
|
||||
)
|
||||
:trans (behavior ()
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(when (not (-> self is-final?))
|
||||
(let ((f30-0 (/ (-> self hit-points) (-> self max-hp))))
|
||||
(when (time-elapsed? (-> self stop-shoot) (seconds 6))
|
||||
(dotimes (gp-0 (-> *bombbot-bomb-hp-thresholds* length))
|
||||
(if (and (>= (-> *bombbot-bomb-hp-thresholds* gp-0) f30-0)
|
||||
(>= f30-0 (+ -0.1 (-> *bombbot-bomb-hp-thresholds* gp-0)))
|
||||
)
|
||||
(go-virtual drop-bombs)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (< (-> self next-target) (current-time))
|
||||
(let ((a1-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! a1-0 (-> self root trans))
|
||||
(set! (-> a1-0 w) 204800.0)
|
||||
(bombbot-method-196 self a1-0)
|
||||
)
|
||||
(set! (-> self next-target) (+ (current-time) (seconds 8)))
|
||||
(set! (-> self gun-type) (the-as uint 0))
|
||||
0
|
||||
)
|
||||
(let ((v1-33 (the-as process-focusable (handle->process (-> self focus handle)))))
|
||||
(when v1-33
|
||||
(when (< (current-time) (+ (-> self next-target) (seconds -2)))
|
||||
(set-time! (-> self start-target))
|
||||
(vector-copy! (-> self start-target-pos) (-> v1-33 root trans))
|
||||
(vector-copy! (-> self start-target-vel) (-> v1-33 root transv))
|
||||
(vector-! (-> self target-delta) (-> v1-33 root trans) (-> self root trans))
|
||||
)
|
||||
(let ((a2-2 (-> self target-pos)))
|
||||
(let ((a0-23 (-> self start-target-pos)))
|
||||
(let ((a1-12 (-> self start-target-vel)))
|
||||
(let ((a3-4 (* 0.0033333334 (the float (- (current-time) (-> self start-target))))))
|
||||
(.mov vf7 a3-4)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-12 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-23 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a2-2 quad) vf6)
|
||||
)
|
||||
(if (= (-> v1-33 type) target)
|
||||
(vector-copy! (-> self target-pos) (-> self start-target-pos))
|
||||
)
|
||||
(if (< (+ (-> self next-target) (seconds -1)) (current-time))
|
||||
(bombbot-method-197 self)
|
||||
(bombbot-method-204 self)
|
||||
)
|
||||
)
|
||||
)
|
||||
(bombbot-method-205 self)
|
||||
(new 'stack-no-clear 'vector)
|
||||
(let ((f0-8 (* 0.25 (+ (-> self feet 0 next-position y)
|
||||
(-> self feet 1 next-position y)
|
||||
(-> self feet 2 next-position y)
|
||||
(-> self feet 3 next-position y)
|
||||
)
|
||||
(when (not (-> self is-final?))
|
||||
(let ((f30-0 (/ (-> self hit-points) (-> self max-hp))))
|
||||
(when (time-elapsed? (-> self stop-shoot) (seconds 6))
|
||||
(dotimes (gp-0 (-> *bombbot-bomb-hp-thresholds* length))
|
||||
(if (and (>= (-> *bombbot-bomb-hp-thresholds* gp-0) f30-0)
|
||||
(>= f30-0 (+ -0.1 (-> *bombbot-bomb-hp-thresholds* gp-0)))
|
||||
)
|
||||
)
|
||||
(go-virtual drop-bombs)
|
||||
)
|
||||
)
|
||||
(if (!= (-> self nav state mesh) *default-nav-mesh*)
|
||||
(+! (-> self root trans y) (* 4.0 (seconds-per-frame) (- f0-8 (-> self root trans y))))
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (< (-> self next-target) (current-time))
|
||||
(let ((a1-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! a1-0 (-> self root trans))
|
||||
(set! (-> a1-0 w) 204800.0)
|
||||
(bombbot-method-196 self a1-0)
|
||||
)
|
||||
(set! (-> self next-target) (+ (current-time) (seconds 8)))
|
||||
(set! (-> self gun-type) (the-as uint 0))
|
||||
0
|
||||
)
|
||||
(let ((v1-33 (the-as process-focusable (handle->process (-> self focus handle)))))
|
||||
(when v1-33
|
||||
(when (< (current-time) (+ (-> self next-target) (seconds -2)))
|
||||
(set-time! (-> self start-target))
|
||||
(vector-copy! (-> self start-target-pos) (-> v1-33 root trans))
|
||||
(vector-copy! (-> self start-target-vel) (-> v1-33 root transv))
|
||||
(vector-! (-> self target-delta) (-> v1-33 root trans) (-> self root trans))
|
||||
)
|
||||
(vector+*!
|
||||
(-> self target-pos)
|
||||
(-> self start-target-pos)
|
||||
(-> self start-target-vel)
|
||||
(* 0.0033333334 (the float (- (current-time) (-> self start-target))))
|
||||
)
|
||||
(if (= (the-as process-focusable (-> v1-33 type)) target)
|
||||
(vector-copy! (-> self target-pos) (-> self start-target-pos))
|
||||
)
|
||||
(if (< (+ (-> self next-target) (seconds -1)) (current-time))
|
||||
(bombbot-method-197 self)
|
||||
(bombbot-method-204 self)
|
||||
)
|
||||
)
|
||||
(if (= (vector-length (-> self root transv)) 0.0)
|
||||
(set-time! (-> self state-time))
|
||||
)
|
||||
(bombbot-method-202 self)
|
||||
(bombbot-method-195 self)
|
||||
)
|
||||
(bombbot-method-205 self)
|
||||
(new 'stack-no-clear 'vector)
|
||||
(let ((f0-8 (* 0.25 (+ (-> self feet 0 next-position y)
|
||||
(-> self feet 1 next-position y)
|
||||
(-> self feet 2 next-position y)
|
||||
(-> self feet 3 next-position y)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (!= (-> self nav state mesh) *default-nav-mesh*)
|
||||
(+! (-> self root trans y) (* 4.0 (seconds-per-frame) (- f0-8 (-> self root trans y))))
|
||||
)
|
||||
)
|
||||
(if (= (vector-length (-> self root transv)) 0.0)
|
||||
(set-time! (-> self state-time))
|
||||
)
|
||||
(bombbot-method-202 self)
|
||||
(bombbot-method-195 self)
|
||||
)
|
||||
:post (behavior ()
|
||||
(let ((v1-0 1200))
|
||||
|
||||
@@ -1274,45 +1274,31 @@
|
||||
)
|
||||
|
||||
(defun find-nearest-nav-mesh-protect ((arg0 vector) (arg1 float))
|
||||
(local-vars (v1-15 float) (sv-64 nav-poly) (sv-68 nav-mesh) (sv-72 float) (sv-76 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(set! sv-64 (new 'stack-no-clear 'nav-poly))
|
||||
(set! sv-68 (the-as nav-mesh #f))
|
||||
(set! sv-72 arg1)
|
||||
(set! sv-76 arg0)
|
||||
(set! (-> sv-64 data 20) (the-as uint 7))
|
||||
(dotimes (gp-0 (-> *level* length))
|
||||
(let ((v1-5 (-> *level* level gp-0)))
|
||||
(when (= (-> v1-5 status) 'active)
|
||||
(when (!= (-> v1-5 name) 'lctyprot)
|
||||
(let ((s5-0 (-> v1-5 bsp nav-meshes)))
|
||||
(when (nonzero? s5-0)
|
||||
(dotimes (s4-0 (-> s5-0 length))
|
||||
(let ((s3-0 (-> s5-0 s4-0 nav-mesh)))
|
||||
(when s3-0
|
||||
(vector-! (-> sv-64 vertex 0) sv-76 (the-as vector (-> s3-0 bounds)))
|
||||
(.lvf vf1 (&-> (-> sv-64 vertex) 0 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-15 vf1)
|
||||
(let ((f0-1 v1-15)
|
||||
(f1-0 (-> s3-0 bounds r))
|
||||
)
|
||||
(when (< f0-1 (* f1-0 f1-0))
|
||||
(set! (-> sv-64 vertex1 x) (-> s3-0 nearest-y-threshold))
|
||||
(nav-mesh-method-46 s3-0 sv-64)
|
||||
(when (>= sv-72 (-> sv-64 vertex1 w))
|
||||
(set! sv-72 (-> sv-64 vertex1 w))
|
||||
(set! sv-68 s3-0)
|
||||
)
|
||||
(local-vars (sv-64 nav-poly) (sv-68 nav-mesh) (sv-72 float) (sv-76 vector))
|
||||
(set! sv-64 (new 'stack-no-clear 'nav-poly))
|
||||
(set! sv-68 (the-as nav-mesh #f))
|
||||
(set! sv-72 arg1)
|
||||
(set! sv-76 arg0)
|
||||
(set! (-> sv-64 data 20) (the-as uint 7))
|
||||
(dotimes (gp-0 (-> *level* length))
|
||||
(let ((v1-5 (-> *level* level gp-0)))
|
||||
(when (= (-> v1-5 status) 'active)
|
||||
(when (!= (-> v1-5 name) 'lctyprot)
|
||||
(let ((s5-0 (-> v1-5 bsp nav-meshes)))
|
||||
(when (nonzero? s5-0)
|
||||
(dotimes (s4-0 (-> s5-0 length))
|
||||
(let ((s3-0 (-> s5-0 s4-0 nav-mesh)))
|
||||
(when s3-0
|
||||
(vector-! (-> sv-64 vertex 0) sv-76 (the-as vector (-> s3-0 bounds)))
|
||||
(let ((f0-1 (vector-length-squared (-> sv-64 vertex 0)))
|
||||
(f1-0 (-> s3-0 bounds r))
|
||||
)
|
||||
(when (< f0-1 (* f1-0 f1-0))
|
||||
(set! (-> sv-64 vertex1 x) (-> s3-0 nearest-y-threshold))
|
||||
(nav-mesh-method-46 s3-0 sv-64)
|
||||
(when (>= sv-72 (-> sv-64 vertex1 w))
|
||||
(set! sv-72 (-> sv-64 vertex1 w))
|
||||
(set! sv-68 s3-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1324,8 +1310,8 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
sv-68
|
||||
)
|
||||
sv-68
|
||||
)
|
||||
|
||||
(defbehavior gunship-event-handler protect-gunship ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
@@ -1637,7 +1623,7 @@
|
||||
)
|
||||
(vector-rotate-around-axis!
|
||||
(-> s4-0 fvec)
|
||||
(the-as quaternion (-> s4-0 fvec))
|
||||
(-> s4-0 fvec)
|
||||
(+ 8192.0 (* 16384.0 (the float s2-0)))
|
||||
(-> s4-0 uvec)
|
||||
)
|
||||
@@ -2331,7 +2317,7 @@
|
||||
(let ((s5-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))))
|
||||
(vector-rotate-around-axis!
|
||||
(-> s5-0 fvec)
|
||||
(the-as quaternion (-> s5-0 fvec))
|
||||
(-> s5-0 fvec)
|
||||
(+ 8192.0 (* 16384.0 (the float arg0)))
|
||||
(-> s5-0 uvec)
|
||||
)
|
||||
@@ -3248,7 +3234,7 @@
|
||||
(seek! (-> self current-laser-rotate-speed) (-> self laser-rotate-speed) (* 3640.889 (seconds-per-frame)))
|
||||
(vector-rotate-around-axis!
|
||||
(-> self base-laser-dir)
|
||||
(the-as quaternion (-> self base-laser-dir))
|
||||
(-> self base-laser-dir)
|
||||
(* (-> self current-laser-rotate-speed) (seconds-per-frame))
|
||||
*up-vector*
|
||||
)
|
||||
@@ -3327,7 +3313,7 @@
|
||||
((time-elapsed? (-> self state-time) (seconds 3))
|
||||
(dotimes (s3-1 s4-0)
|
||||
(fire-laser self gp-4 s5-0)
|
||||
(vector-rotate-around-axis! s5-0 (the-as quaternion s5-0) (/ 65536.0 (the float s4-0)) *up-vector*)
|
||||
(vector-rotate-around-axis! s5-0 s5-0 (/ 65536.0 (the float s4-0)) *up-vector*)
|
||||
)
|
||||
)
|
||||
((time-elapsed? (-> self state-time) (seconds 1.5))
|
||||
|
||||
@@ -1143,57 +1143,35 @@
|
||||
)
|
||||
|
||||
(defmethod projectile-method-25 ((this cty-sniper-turret-shot))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let* ((gp-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0))
|
||||
(f30-0 (vector-length s5-1))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((gp-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0))
|
||||
(f30-0 (vector-length s5-1))
|
||||
)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-4 a1-0))
|
||||
(let ((a0-2 s5-1))
|
||||
(let ((a2-1 0.8))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-2 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s4-0 quad) vf6)
|
||||
(let ((f28-0 (-> *part-id-table* 4844 init-specs 4 initial-valuef)))
|
||||
(set! (-> *part-id-table* 4844 init-specs 4 initial-valuef) (vector-length s5-1))
|
||||
(draw-beam (-> *part-id-table* 4844) a1-0 s5-1 #f)
|
||||
(set! (-> *part-id-table* 4844 init-specs 4 initial-valuef) f28-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 4845) s4-0)
|
||||
(launch-particles (-> *part-id-table* 4846) s4-0)
|
||||
)
|
||||
(let ((s4-1 (new 'stack-no-clear 'matrix))
|
||||
(f28-1 (/ f30-0 (meters 16)))
|
||||
(f30-1 (-> *part-id-table* 4847 init-specs 3 initial-valuef))
|
||||
)
|
||||
(-> *part-id-table* 4847 init-specs 4 initial-valuef)
|
||||
(forward-up->inv-matrix s4-1 s5-1 *up-vector*)
|
||||
(vector-copy! (-> s4-1 trans) gp-0)
|
||||
(set! (-> *part-id-table* 4847 init-specs 3 initial-valuef) (* f28-1 f30-1))
|
||||
(launch-particles (-> *part-id-table* 4847) s4-1 :origin-is-matrix #t)
|
||||
(set! (-> *part-id-table* 4847 init-specs 3 initial-valuef) f30-1)
|
||||
(let ((s4-1 (vector+*! (new 'stack-no-clear 'vector) a1-0 s5-1 0.8)))
|
||||
(let ((f28-0 (-> *part-id-table* 4844 init-specs 4 initial-valuef)))
|
||||
(set! (-> *part-id-table* 4844 init-specs 4 initial-valuef) (vector-length s5-1))
|
||||
(draw-beam (-> *part-id-table* 4844) a1-0 s5-1 #f)
|
||||
(set! (-> *part-id-table* 4844 init-specs 4 initial-valuef) f28-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 4845) s4-1)
|
||||
(launch-particles (-> *part-id-table* 4846) s4-1)
|
||||
)
|
||||
(let ((s4-2 (new 'stack-no-clear 'matrix))
|
||||
(f28-1 (/ f30-0 (meters 16)))
|
||||
(f30-1 (-> *part-id-table* 4847 init-specs 3 initial-valuef))
|
||||
)
|
||||
(-> *part-id-table* 4847 init-specs 4 initial-valuef)
|
||||
(forward-up->inv-matrix s4-2 s5-1 *up-vector*)
|
||||
(vector-copy! (-> s4-2 trans) gp-0)
|
||||
(set! (-> *part-id-table* 4847 init-specs 3 initial-valuef) (* f28-1 f30-1))
|
||||
(launch-particles (-> *part-id-table* 4847) s4-2 :origin-is-matrix #t)
|
||||
(set! (-> *part-id-table* 4847 init-specs 3 initial-valuef) f30-1)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod projectile-method-26 ((this cty-sniper-turret-shot))
|
||||
|
||||
@@ -608,131 +608,111 @@
|
||||
|
||||
(defmethod move-above-ground! ((this citizen) (arg0 vector) (arg1 move-above-ground-params))
|
||||
"Move the enemy. May keep the enemy snapped to the ground depending on flags."
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let ((gp-0 (-> this root)))
|
||||
(set! (-> arg1 on-ground?) #f)
|
||||
(set! (-> arg1 do-move?) #t)
|
||||
(vector-copy! (-> arg1 old-gspot-pos) (-> gp-0 gspot-pos))
|
||||
(vector-copy! (-> arg1 old-gspot-normal) (-> gp-0 gspot-normal))
|
||||
(set! (-> gp-0 trans-old-old-old quad) (-> gp-0 trans-old-old quad))
|
||||
(set! (-> gp-0 trans-old-old quad) (-> gp-0 trans-old quad))
|
||||
(set! (-> gp-0 trans-old quad) (-> gp-0 trans quad))
|
||||
(set! (-> gp-0 prev-status) (-> gp-0 status))
|
||||
(vector-v+! (-> gp-0 trans) (-> gp-0 trans) arg0)
|
||||
(vector-copy! (-> arg1 new-pos) (-> gp-0 trans))
|
||||
(when (not (logtest? (logxor (-> this traffic-id) (the-as int (-> this probe-counter))) 7))
|
||||
(let ((s2-0 (new 'stack-no-clear 'collide-query)))
|
||||
(logclear! (-> gp-0 status) (collide-status on-ground))
|
||||
(when (enemy-above-ground?
|
||||
this
|
||||
s2-0
|
||||
(vector+*! (new 'stack-no-clear 'vector) (-> gp-0 trans) (-> gp-0 transv) 0.15)
|
||||
(-> arg1 gnd-collide-with)
|
||||
16384.0
|
||||
81920.0
|
||||
1024.0
|
||||
)
|
||||
(vector-copy! (-> gp-0 gspot-pos) (-> gp-0 trans))
|
||||
(set! (-> gp-0 gspot-pos y) (-> s2-0 best-other-tri intersect y))
|
||||
(vector-copy! (-> gp-0 gspot-normal) (-> s2-0 best-other-tri normal))
|
||||
(logior! (-> gp-0 status) (collide-status on-ground))
|
||||
(set! (-> gp-0 ground-pat) (-> s2-0 best-other-tri pat))
|
||||
)
|
||||
)
|
||||
(set! (-> this gnd-height) (-> gp-0 gspot-pos y))
|
||||
(set! (-> gp-0 gspot-pos y) (-> arg1 old-gspot-pos y))
|
||||
)
|
||||
(let ((f0-5 (- (-> this gnd-height) (-> gp-0 gspot-pos y))))
|
||||
(cond
|
||||
((< 0.0 f0-5)
|
||||
(+! (-> gp-0 gspot-pos y) (* 10.0 (seconds-per-frame) f0-5))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((gp-0 (-> this root)))
|
||||
(set! (-> arg1 on-ground?) #f)
|
||||
(set! (-> arg1 do-move?) #t)
|
||||
(vector-copy! (-> arg1 old-gspot-pos) (-> gp-0 gspot-pos))
|
||||
(vector-copy! (-> arg1 old-gspot-normal) (-> gp-0 gspot-normal))
|
||||
(set! (-> gp-0 trans-old-old-old quad) (-> gp-0 trans-old-old quad))
|
||||
(set! (-> gp-0 trans-old-old quad) (-> gp-0 trans-old quad))
|
||||
(set! (-> gp-0 trans-old quad) (-> gp-0 trans quad))
|
||||
(set! (-> gp-0 prev-status) (-> gp-0 status))
|
||||
(vector-v+! (-> gp-0 trans) (-> gp-0 trans) arg0)
|
||||
(vector-copy! (-> arg1 new-pos) (-> gp-0 trans))
|
||||
(when (not (logtest? (logxor (-> this traffic-id) (the-as int (-> this probe-counter))) 7))
|
||||
(let ((s2-0 (new 'stack-no-clear 'collide-query)))
|
||||
(logclear! (-> gp-0 status) (collide-status on-ground))
|
||||
(let* ((a0-10 this)
|
||||
(t9-1 (method-of-object a0-10 enemy-above-ground?))
|
||||
(a1-2 s2-0)
|
||||
(a2-2 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((v1-15 (-> gp-0 trans)))
|
||||
(let ((a3-0 (-> gp-0 transv)))
|
||||
(let ((t0-1 0.15))
|
||||
(.mov vf7 t0-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a3-0 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-15 quad))
|
||||
(else
|
||||
(+! (-> gp-0 gspot-pos y) (* 10.0 (seconds-per-frame) f0-5))
|
||||
(if (< (-> gp-0 gspot-pos y) (-> this gnd-height))
|
||||
(set! (-> gp-0 gspot-pos y) (-> this gnd-height))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a2-2 quad) vf6)
|
||||
(when (t9-1 a0-10 a1-2 a2-2 (-> arg1 gnd-collide-with) 16384.0 81920.0 1024.0)
|
||||
(vector-copy! (-> gp-0 gspot-pos) (-> gp-0 trans))
|
||||
(set! (-> gp-0 gspot-pos y) (-> s2-0 best-other-tri intersect y))
|
||||
(vector-copy! (-> gp-0 gspot-normal) (-> s2-0 best-other-tri normal))
|
||||
(logior! (-> gp-0 status) (collide-status on-ground))
|
||||
(set! (-> gp-0 ground-pat) (-> s2-0 best-other-tri pat))
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> this gnd-height) (-> gp-0 gspot-pos y))
|
||||
(set! (-> gp-0 gspot-pos y) (-> arg1 old-gspot-pos y))
|
||||
)
|
||||
(let ((f0-5 (- (-> this gnd-height) (-> gp-0 gspot-pos y))))
|
||||
(cond
|
||||
((< 0.0 f0-5)
|
||||
(+! (-> gp-0 gspot-pos y) (* 10.0 (seconds-per-frame) f0-5))
|
||||
)
|
||||
(else
|
||||
(+! (-> gp-0 gspot-pos y) (* 10.0 (seconds-per-frame) f0-5))
|
||||
(if (< (-> gp-0 gspot-pos y) (-> this gnd-height))
|
||||
(set! (-> gp-0 gspot-pos y) (-> this gnd-height))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> arg1 on-ground?) #t)
|
||||
(set! (-> arg1 pat) (-> gp-0 ground-pat))
|
||||
(when (>= (-> gp-0 gspot-pos y) (-> arg1 new-pos y))
|
||||
(set! (-> arg1 new-pos y) (-> gp-0 gspot-pos y))
|
||||
(set! (-> gp-0 ground-impact-vel) (- (vector-dot arg0 (-> gp-0 dynam gravity-normal))))
|
||||
(set! (-> arg0 y) 0.0)
|
||||
)
|
||||
(vector-copy! (-> gp-0 trans) (-> arg1 new-pos))
|
||||
(when (-> arg1 do-move?)
|
||||
(cond
|
||||
((-> arg1 on-ground?)
|
||||
(let ((a1-3 (-> gp-0 gspot-pos))
|
||||
(a0-18 (-> gp-0 gspot-normal))
|
||||
(v1-42 (-> arg1 pat))
|
||||
)
|
||||
(vector-copy! (-> gp-0 ground-touch-point) a1-3)
|
||||
(vector-copy! (-> gp-0 poly-normal) a0-18)
|
||||
(vector-copy! (-> gp-0 surface-normal) a0-18)
|
||||
(vector-copy! (-> gp-0 local-normal) a0-18)
|
||||
(vector-copy! (-> gp-0 ground-poly-normal) a0-18)
|
||||
(set! (-> gp-0 poly-pat) v1-42)
|
||||
(set! (-> gp-0 cur-pat) v1-42)
|
||||
(set! (-> gp-0 ground-pat) v1-42)
|
||||
)
|
||||
(logior! (-> gp-0 status) (collide-status on-surface on-ground touch-surface))
|
||||
)
|
||||
(set! (-> arg1 on-ground?) #t)
|
||||
(set! (-> arg1 pat) (-> gp-0 ground-pat))
|
||||
(when (>= (-> gp-0 gspot-pos y) (-> arg1 new-pos y))
|
||||
(set! (-> arg1 new-pos y) (-> gp-0 gspot-pos y))
|
||||
(set! (-> gp-0 ground-impact-vel) (- (vector-dot arg0 (-> gp-0 dynam gravity-normal))))
|
||||
(set! (-> arg0 y) 0.0)
|
||||
)
|
||||
(vector-copy! (-> gp-0 trans) (-> arg1 new-pos))
|
||||
(when (-> arg1 do-move?)
|
||||
(cond
|
||||
((-> arg1 on-ground?)
|
||||
(let ((a1-3 (-> gp-0 gspot-pos))
|
||||
(a0-18 (-> gp-0 gspot-normal))
|
||||
(v1-42 (-> arg1 pat))
|
||||
)
|
||||
(vector-copy! (-> gp-0 ground-touch-point) a1-3)
|
||||
(vector-copy! (-> gp-0 poly-normal) a0-18)
|
||||
(vector-copy! (-> gp-0 surface-normal) a0-18)
|
||||
(vector-copy! (-> gp-0 local-normal) a0-18)
|
||||
(vector-copy! (-> gp-0 ground-poly-normal) a0-18)
|
||||
(set! (-> gp-0 poly-pat) v1-42)
|
||||
(set! (-> gp-0 cur-pat) v1-42)
|
||||
(set! (-> gp-0 ground-pat) v1-42)
|
||||
)
|
||||
(else
|
||||
(logclear! (-> gp-0 status) (collide-status
|
||||
on-surface
|
||||
on-ground
|
||||
touch-surface
|
||||
touch-wall
|
||||
touch-ceiling
|
||||
touch-actor
|
||||
on-special-surface
|
||||
touch-edge
|
||||
blocked
|
||||
on-water
|
||||
impact-surface
|
||||
touch-background
|
||||
stuck
|
||||
glance
|
||||
)
|
||||
)
|
||||
(when (not (logtest? (-> gp-0 root-prim prim-core action) (collide-action no-normal-reset)))
|
||||
(let ((v1-52 (-> gp-0 dynam gravity-normal)))
|
||||
(vector-copy! (-> gp-0 local-normal) v1-52)
|
||||
(vector-copy! (-> gp-0 surface-normal) v1-52)
|
||||
(vector-copy! (-> gp-0 poly-normal) v1-52)
|
||||
)
|
||||
(set! (-> gp-0 coverage) 0.0)
|
||||
(set! (-> gp-0 touch-angle) 0.0)
|
||||
(logior! (-> gp-0 status) (collide-status on-surface on-ground touch-surface))
|
||||
)
|
||||
(else
|
||||
(logclear! (-> gp-0 status) (collide-status
|
||||
on-surface
|
||||
on-ground
|
||||
touch-surface
|
||||
touch-wall
|
||||
touch-ceiling
|
||||
touch-actor
|
||||
on-special-surface
|
||||
touch-edge
|
||||
blocked
|
||||
on-water
|
||||
impact-surface
|
||||
touch-background
|
||||
stuck
|
||||
glance
|
||||
)
|
||||
)
|
||||
(when (not (logtest? (-> gp-0 root-prim prim-core action) (collide-action no-normal-reset)))
|
||||
(let ((v1-52 (-> gp-0 dynam gravity-normal)))
|
||||
(vector-copy! (-> gp-0 local-normal) v1-52)
|
||||
(vector-copy! (-> gp-0 surface-normal) v1-52)
|
||||
(vector-copy! (-> gp-0 poly-normal) v1-52)
|
||||
)
|
||||
(set! (-> gp-0 coverage) 0.0)
|
||||
(set! (-> gp-0 touch-angle) 0.0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod normalize-heading! ((this citizen) (arg0 nav-control))
|
||||
@@ -1142,99 +1122,76 @@
|
||||
|
||||
(defun iter-seg-clear-path ((arg0 iter-seg) (arg1 nav-segment))
|
||||
(with-pp
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s2-0 (-> arg0 self))
|
||||
(a0-1 (-> arg1 branch src-node))
|
||||
(s4-0 (new 'stack-no-clear 'vector))
|
||||
(let ((s2-0 (-> arg0 self))
|
||||
(a0-1 (-> arg1 branch src-node))
|
||||
(s4-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-copy! s4-0 (-> a0-1 position))
|
||||
(set! (-> s4-0 w) 1.0)
|
||||
(let ((a0-4 (-> arg1 branch dest-node))
|
||||
(s3-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-copy! s4-0 (-> a0-1 position))
|
||||
(vector-copy! s3-0 (-> a0-4 position))
|
||||
(set! (-> s3-0 w) 1.0)
|
||||
(set! (-> s4-0 y) 0.0)
|
||||
(set! (-> s3-0 y) 0.0)
|
||||
(set! (-> s4-0 w) 1.0)
|
||||
(let ((a0-4 (-> arg1 branch dest-node))
|
||||
(s3-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-copy! s3-0 (-> a0-4 position))
|
||||
(set! (-> s3-0 w) 1.0)
|
||||
(set! (-> s4-0 y) 0.0)
|
||||
(set! (-> s3-0 y) 0.0)
|
||||
(set! (-> s4-0 w) 1.0)
|
||||
(set! (-> s3-0 w) 1.0)
|
||||
(when *citizen-debug*
|
||||
)
|
||||
(when #t
|
||||
(cond
|
||||
((< 0.0 (vector4-dot (the-as vector (-> arg0 cp-plane)) s3-0))
|
||||
(let ((s0-1 (vector-! (new 'stack-no-clear 'vector) s3-0 s4-0))
|
||||
(s1-1 (vector-! (new 'stack-no-clear 'vector) (-> s2-0 root trans) s4-0))
|
||||
)
|
||||
(set! (-> s1-1 y) 0.0)
|
||||
(vector-rotate90-around-y! s0-1 s0-1)
|
||||
(vector-normalize! s0-1 1.0)
|
||||
(let ((a1-3 s1-1))
|
||||
(let ((v1-17 s1-1))
|
||||
(let ((a0-12 s0-1))
|
||||
(let ((a2-2 (- (vector-dot s0-1 s1-1))))
|
||||
(.mov vf7 a2-2)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-12 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-17 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-3 quad) vf6)
|
||||
(set! (-> s3-0 w) 1.0)
|
||||
(when *citizen-debug*
|
||||
)
|
||||
(when #t
|
||||
(cond
|
||||
((< 0.0 (vector4-dot (the-as vector (-> arg0 cp-plane)) s3-0))
|
||||
(let ((s0-1 (vector-! (new 'stack-no-clear 'vector) s3-0 s4-0))
|
||||
(s1-1 (vector-! (new 'stack-no-clear 'vector) (-> s2-0 root trans) s4-0))
|
||||
)
|
||||
(vector+! s1-1 s1-1 s4-0)
|
||||
(cond
|
||||
((< 0.0 (vector-dot (the-as vector (-> arg0 cp-plane)) (vector-! (new 'stack-no-clear 'vector) s3-0 s1-1)))
|
||||
(vector-vector-xz-distance s3-0 (-> s2-0 cp-sphere))
|
||||
(let ((s1-3 (vector-! (new 'stack-no-clear 'vector) s3-0 (the-as vector (-> s2-0 cp-sphere))))
|
||||
(s0-2 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-copy! s0-2 (-> s2-0 cp-vec))
|
||||
(set! (-> s0-2 y) 0.0)
|
||||
(vector-normalize! s0-2 1.0)
|
||||
(set! (-> s1-3 y) 0.0)
|
||||
(let ((f30-0 (vector-dot s0-2 s1-3)))
|
||||
(if (and *cty-faction-manager* (not (logtest? (cty-faction-manager-method-9
|
||||
*cty-faction-manager*
|
||||
(the-as int (-> arg1 branch clock-type))
|
||||
(-> pp level name)
|
||||
)
|
||||
1
|
||||
(set! (-> s1-1 y) 0.0)
|
||||
(vector-rotate90-around-y! s0-1 s0-1)
|
||||
(vector-normalize! s0-1 1.0)
|
||||
(vector+*! s1-1 s1-1 s0-1 (- (vector-dot s0-1 s1-1)))
|
||||
(vector+! s1-1 s1-1 s4-0)
|
||||
(cond
|
||||
((< 0.0 (vector-dot (the-as vector (-> arg0 cp-plane)) (vector-! (new 'stack-no-clear 'vector) s3-0 s1-1)))
|
||||
(vector-vector-xz-distance s3-0 (-> s2-0 cp-sphere))
|
||||
(let ((s1-3 (vector-! (new 'stack-no-clear 'vector) s3-0 (the-as vector (-> s2-0 cp-sphere))))
|
||||
(s0-2 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-copy! s0-2 (-> s2-0 cp-vec))
|
||||
(set! (-> s0-2 y) 0.0)
|
||||
(vector-normalize! s0-2 1.0)
|
||||
(set! (-> s1-3 y) 0.0)
|
||||
(let ((f30-0 (vector-dot s0-2 s1-3)))
|
||||
(if (and *cty-faction-manager* (not (logtest? (cty-faction-manager-method-9
|
||||
*cty-faction-manager*
|
||||
(the-as int (-> arg1 branch clock-type))
|
||||
(-> pp level name)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! f30-0 (+ -409600.0 f30-0))
|
||||
)
|
||||
(when (< (-> arg0 score) f30-0)
|
||||
(set! (-> arg0 score) f30-0)
|
||||
(set! (-> arg0 seg) arg1)
|
||||
1
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! f30-0 (+ -409600.0 f30-0))
|
||||
)
|
||||
(when (< (-> arg0 score) f30-0)
|
||||
(set! (-> arg0 score) f30-0)
|
||||
(set! (-> arg0 seg) arg1)
|
||||
)
|
||||
)
|
||||
(if *citizen-debug*
|
||||
(add-debug-line #t (bucket-id debug-no-zbuf1) s4-0 s3-0 *color-black* #f *color-white*)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(if *citizen-debug*
|
||||
(add-debug-line #t (bucket-id debug-no-zbuf1) s1-1 s3-0 *color-red* #f (the-as rgba -1))
|
||||
)
|
||||
)
|
||||
(if *citizen-debug*
|
||||
(add-debug-line #t (bucket-id debug-no-zbuf1) s4-0 s3-0 *color-black* #f *color-white*)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(if *citizen-debug*
|
||||
(add-debug-line #t (bucket-id debug-no-zbuf1) s1-1 s3-0 *color-red* #f (the-as rgba -1))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
#f
|
||||
)
|
||||
)
|
||||
(else
|
||||
#f
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1542,70 +1542,18 @@
|
||||
)
|
||||
|
||||
(defun do-spline2 ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let* ((f1-1 (* arg5 arg5))
|
||||
(f0-2 (* arg5 f1-1))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((f1-1 (* arg5 arg5))
|
||||
(f0-2 (* arg5 f1-1))
|
||||
)
|
||||
(let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2))
|
||||
(f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5)))
|
||||
(f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1)))
|
||||
)
|
||||
(vector-float*! arg0 arg1 f2-3)
|
||||
(let ((t2-0 arg0))
|
||||
(let ((v1-10 arg0))
|
||||
(let ((t1-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2)))
|
||||
(let ((a1-1 f3-7))
|
||||
(.mov vf7 a1-1)
|
||||
)
|
||||
(.lvf vf5 (&-> t1-3 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-10 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> t2-0 quad) vf6)
|
||||
(let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2))
|
||||
(f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5)))
|
||||
(f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1)))
|
||||
)
|
||||
(let ((a2-1 arg0))
|
||||
(let ((v1-11 arg0))
|
||||
(let ((a1-3 (vector+! (new 'stack-no-clear 'vector) arg3 arg4)))
|
||||
(let ((t0-1 f1-3))
|
||||
(.mov vf7 t0-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-3 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-11 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a2-1 quad) vf6)
|
||||
)
|
||||
)
|
||||
(let ((v0-0 arg0))
|
||||
(let ((v1-12 arg0))
|
||||
(let ((a0-1 arg3))
|
||||
(let ((a1-4 f0-2))
|
||||
(.mov vf7 a1-4)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-1 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-12 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v0-0 quad) vf6)
|
||||
v0-0
|
||||
)
|
||||
(vector-float*! arg0 arg1 f2-3)
|
||||
(vector+*! arg0 arg0 (vector+! (new 'stack-no-clear 'vector) arg1 arg2) f3-7)
|
||||
(vector+*! arg0 arg0 (vector+! (new 'stack-no-clear 'vector) arg3 arg4) f1-3)
|
||||
)
|
||||
(vector+*! arg0 arg0 arg3 f0-2)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -235,125 +235,57 @@
|
||||
(sv-304 vector)
|
||||
(sv-320 vector)
|
||||
)
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(set! sv-240 arg0)
|
||||
(let ((s0-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-1 (-> this root trans)))
|
||||
(let ((a0-1 *y-vector*))
|
||||
(let ((a1-2 8192.0))
|
||||
(.mov vf7 a1-2)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-1 quad))
|
||||
(set! sv-240 arg0)
|
||||
(let ((s0-1 (vector+*! (new 'stack-no-clear 'vector) (-> this root trans) *y-vector* 8192.0)))
|
||||
(set! sv-320 (new 'stack-no-clear 'vector))
|
||||
(set! sv-304 (new 'stack-no-clear 'vector))
|
||||
(let ((s1-0 (new 'stack-no-clear 'vector))
|
||||
(s2-0 (new 'stack-no-clear 'vector))
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-1 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s0-0 quad) vf6)
|
||||
(set! sv-320 (new 'stack-no-clear 'vector))
|
||||
(set! sv-304 (new 'stack-no-clear 'vector))
|
||||
(let ((s1-0 (new 'stack-no-clear 'vector))
|
||||
(s2-0 (new 'stack-no-clear 'vector))
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
(-> this node-list data 4 bone transform)
|
||||
(let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))
|
||||
(s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))
|
||||
)
|
||||
(-> this node-list data 4 bone transform)
|
||||
(let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))
|
||||
(s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))
|
||||
)
|
||||
(vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))
|
||||
(vector-copy! s0-0 (-> this root trans))
|
||||
(cond
|
||||
((logtest? (enemy-flag drawn-mirrored) (-> this enemy-flags))
|
||||
(let ((a1-6 s0-0))
|
||||
(let ((v1-13 s0-0))
|
||||
(let ((a0-9 s4-0))
|
||||
(let ((a2-1 4096.0))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-9 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-13 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-6 quad) vf6)
|
||||
(vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))
|
||||
(vector-copy! s0-1 (-> this root trans))
|
||||
(if (logtest? (enemy-flag drawn-mirrored) (-> this enemy-flags))
|
||||
(vector+*! s0-1 s0-1 s4-0 4096.0)
|
||||
(vector+*! s0-1 s0-1 s4-0 2048.0)
|
||||
)
|
||||
(vector+*! s0-1 s0-1 s3-0 8540.16)
|
||||
(vector-normalize! (vector-! sv-320 sv-240 s0-1) 1.0)
|
||||
(set! sv-288 (new 'stack-no-clear 'vector))
|
||||
(let ((v1-19 (-> sv-240 quad)))
|
||||
(set! (-> sv-288 quad) v1-19)
|
||||
)
|
||||
(set! sv-256 vector-rotate90-around-y!)
|
||||
(set! sv-272 (new 'stack-no-clear 'vector))
|
||||
(let* ((a1-15 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) sv-288 s0-1) -2998.272))
|
||||
(v0-5 (sv-256 sv-272 a1-15))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(let ((a1-7 s0-0))
|
||||
(let ((v1-14 s0-0))
|
||||
(let ((a0-10 s4-0))
|
||||
(let ((a2-3 2048.0))
|
||||
(.mov vf7 a2-3)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-10 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-14 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-7 quad) vf6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a1-8 s0-0))
|
||||
(let ((v1-15 s0-0))
|
||||
(let ((a0-11 s3-0))
|
||||
(let ((a2-5 8540.16))
|
||||
(.mov vf7 a2-5)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-11 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-15 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-8 quad) vf6)
|
||||
)
|
||||
(vector-normalize! (vector-! sv-320 sv-240 s0-0) 1.0)
|
||||
(set! sv-288 (new 'stack-no-clear 'vector))
|
||||
(let ((v1-19 (-> sv-240 quad)))
|
||||
(set! (-> sv-288 quad) v1-19)
|
||||
)
|
||||
(set! sv-256 vector-rotate90-around-y!)
|
||||
(set! sv-272 (new 'stack-no-clear 'vector))
|
||||
(let* ((a1-13 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) sv-288 s0-0) -2998.272))
|
||||
(v0-5 (sv-256 sv-272 a1-13))
|
||||
)
|
||||
(vector+! sv-288 sv-288 v0-5)
|
||||
)
|
||||
(vector-normalize! (vector-! sv-320 sv-288 s0-0) 1.0)
|
||||
(vector-z-quaternion! sv-304 (-> this root quat))
|
||||
(rot-zxy-from-vector! s2-0 sv-304)
|
||||
(rot-zxy-from-vector! s1-0 sv-320)
|
||||
(set! (-> s5-0 x) (fmax -14563.556 (fmin 14563.556 (deg- (-> s1-0 x) (-> s2-0 x)))))
|
||||
(set! (-> s5-0 y) (fmax -14563.556 (fmin 14563.556 (deg- (-> s1-0 y) (-> s2-0 y)))))
|
||||
(set! (-> s5-0 z) 0.0)
|
||||
(let ((s2-1 (new 'stack-no-clear 'quaternion)))
|
||||
(let ((s1-1 (new 'stack-no-clear 'quaternion)))
|
||||
(quaternion-vector-angle! s2-1 s4-0 (-> s5-0 x))
|
||||
(quaternion-vector-angle! s1-1 s3-0 (-> s5-0 y))
|
||||
(quaternion*! s2-1 s1-1 s2-1)
|
||||
)
|
||||
(quaternion-slerp! (-> this joint quat) (-> this joint quat) s2-1 (* 5.0 (seconds-per-frame)))
|
||||
(vector+! sv-288 sv-288 v0-5)
|
||||
)
|
||||
(vector-normalize! (vector-! sv-320 sv-288 s0-1) 1.0)
|
||||
(vector-z-quaternion! sv-304 (-> this root quat))
|
||||
(rot-zxy-from-vector! s2-0 sv-304)
|
||||
(rot-zxy-from-vector! s1-0 sv-320)
|
||||
(set! (-> s5-0 x) (fmax -14563.556 (fmin 14563.556 (deg- (-> s1-0 x) (-> s2-0 x)))))
|
||||
(set! (-> s5-0 y) (fmax -14563.556 (fmin 14563.556 (deg- (-> s1-0 y) (-> s2-0 y)))))
|
||||
(set! (-> s5-0 z) 0.0)
|
||||
(let ((s2-1 (new 'stack-no-clear 'quaternion)))
|
||||
(let ((s1-1 (new 'stack-no-clear 'quaternion)))
|
||||
(quaternion-vector-angle! s2-1 s4-0 (-> s5-0 x))
|
||||
(quaternion-vector-angle! s1-1 s3-0 (-> s5-0 y))
|
||||
(quaternion*! s2-1 s1-1 s2-1)
|
||||
)
|
||||
(quaternion-slerp! (-> this joint quat) (-> this joint quat) s2-1 (* 5.0 (seconds-per-frame)))
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod crimson-guard-method-260 ((this crimson-guard))
|
||||
@@ -860,116 +792,81 @@
|
||||
)
|
||||
|
||||
(defmethod crimson-guard-method-258 ((this crimson-guard) (arg0 vector) (arg1 vector) (arg2 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0 (new 'stack-no-clear 'collide-query)))
|
||||
(let ((f0-0 1228.8)
|
||||
(f30-0 6144.0)
|
||||
)
|
||||
(vector-copy! (-> s5-0 start-pos) arg0)
|
||||
(vector-! (-> s5-0 move-dist) arg1 arg0)
|
||||
(let ((v1-4 s5-0))
|
||||
(set! (-> v1-4 radius) f0-0)
|
||||
(set! (-> v1-4 collide-with) (collide-spec backgnd))
|
||||
(set! (-> v1-4 ignore-process0) this)
|
||||
(set! (-> v1-4 ignore-process1) (handle->process (-> this focus handle)))
|
||||
(set! (-> v1-4 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-4 action-mask) (collide-action solid))
|
||||
(let ((s5-0 (new 'stack-no-clear 'collide-query)))
|
||||
(let ((f0-0 1228.8)
|
||||
(f30-0 6144.0)
|
||||
)
|
||||
(let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s5-0)))
|
||||
(cond
|
||||
((>= f0-1 0.0)
|
||||
(vector-float*! (-> s5-0 move-dist) (-> s5-0 move-dist) f0-1)
|
||||
(cond
|
||||
((< (vector-dot
|
||||
(-> s5-0 best-other-tri normal)
|
||||
(vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> s5-0 best-other-tri)))
|
||||
)
|
||||
0.0
|
||||
(vector-copy! (-> s5-0 start-pos) arg0)
|
||||
(vector-! (-> s5-0 move-dist) arg1 arg0)
|
||||
(let ((v1-4 s5-0))
|
||||
(set! (-> v1-4 radius) f0-0)
|
||||
(set! (-> v1-4 collide-with) (collide-spec backgnd))
|
||||
(set! (-> v1-4 ignore-process0) this)
|
||||
(set! (-> v1-4 ignore-process1) (handle->process (-> this focus handle)))
|
||||
(set! (-> v1-4 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-4 action-mask) (collide-action solid))
|
||||
)
|
||||
(let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s5-0)))
|
||||
(cond
|
||||
((>= f0-1 0.0)
|
||||
(vector-float*! (-> s5-0 move-dist) (-> s5-0 move-dist) f0-1)
|
||||
(cond
|
||||
((< (vector-dot
|
||||
(-> s5-0 best-other-tri normal)
|
||||
(vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> s5-0 best-other-tri)))
|
||||
)
|
||||
(return 1)
|
||||
)
|
||||
(else
|
||||
0.0
|
||||
)
|
||||
(return 1)
|
||||
)
|
||||
(else
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(vector-! (-> s5-0 move-dist) arg1 arg0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(vector-copy! (-> s5-0 start-pos) arg0)
|
||||
(vector+*! (-> s5-0 start-pos) arg0 (-> s5-0 move-dist) -0.1)
|
||||
(vector+*! (-> s5-0 move-dist) (-> s5-0 move-dist) (-> s5-0 move-dist) 0.1)
|
||||
(let ((v1-17 s5-0))
|
||||
(set! (-> v1-17 radius) f30-0)
|
||||
(set! (-> v1-17 collide-with) (collide-spec civilian enemy hit-by-player-list hit-by-others-list))
|
||||
(set! (-> v1-17 ignore-process0) this)
|
||||
(set! (-> v1-17 ignore-process1) (handle->process (-> this focus handle)))
|
||||
(set! (-> v1-17 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-17 action-mask) (collide-action solid))
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((< (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0)
|
||||
0
|
||||
)
|
||||
(else
|
||||
(let ((v1-20 (as-type (-> s5-0 best-other-tri collide-ptr) collide-shape-prim)))
|
||||
(cond
|
||||
((and v1-20 (< (vector-dot
|
||||
(-> s5-0 best-other-tri normal)
|
||||
(vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> s5-0 best-other-tri)))
|
||||
)
|
||||
0.0
|
||||
)
|
||||
)
|
||||
(let ((v1-22 (-> (the-as collide-shape-prim v1-20) cshape process)))
|
||||
(if (and v1-22 (= (-> v1-22 type) target))
|
||||
1
|
||||
2
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(vector-! (-> s5-0 move-dist) arg1 arg0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(vector-copy! (-> s5-0 start-pos) arg0)
|
||||
(let ((a0-19 (-> s5-0 start-pos)))
|
||||
(let ((v1-15 (-> s5-0 move-dist)))
|
||||
(let ((a1-10 -0.1))
|
||||
(.mov vf7 a1-10)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-15 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> arg0 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-19 quad) vf6)
|
||||
)
|
||||
(let ((a1-11 (-> s5-0 move-dist)))
|
||||
(let ((v1-16 (-> s5-0 move-dist)))
|
||||
(let ((a0-20 (-> s5-0 move-dist)))
|
||||
(let ((a2-4 0.1))
|
||||
(.mov vf7 a2-4)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-20 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-16 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-11 quad) vf6)
|
||||
)
|
||||
(let ((v1-17 s5-0))
|
||||
(set! (-> v1-17 radius) f30-0)
|
||||
(set! (-> v1-17 collide-with) (collide-spec civilian enemy hit-by-player-list hit-by-others-list))
|
||||
(set! (-> v1-17 ignore-process0) this)
|
||||
(set! (-> v1-17 ignore-process1) (handle->process (-> this focus handle)))
|
||||
(set! (-> v1-17 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-17 action-mask) (collide-action solid))
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((< (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0)
|
||||
0
|
||||
)
|
||||
(else
|
||||
(let ((v1-20 (as-type (-> s5-0 best-other-tri collide-ptr) collide-shape-prim)))
|
||||
(cond
|
||||
((and v1-20 (< (vector-dot
|
||||
(-> s5-0 best-other-tri normal)
|
||||
(vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> s5-0 best-other-tri)))
|
||||
)
|
||||
0.0
|
||||
)
|
||||
)
|
||||
(let ((v1-22 (-> (the-as collide-shape-prim v1-20) cshape process)))
|
||||
(if (and v1-22 (= (-> v1-22 type) target))
|
||||
1
|
||||
2
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
0
|
||||
)
|
||||
0
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1063,7 +960,7 @@
|
||||
(vector-normalize-copy! s4-2 s5-2 1.0)
|
||||
(quaternion-vector-angle! s0-0 s4-2 (rnd-float-range this -32768.0 32768.0))
|
||||
(vector-orient-by-quat! s3-1 *y-vector* s0-0)
|
||||
(vector-rotate-around-axis! s5-2 (the-as quaternion s5-2) (rnd-float-range this -910.2222 910.2222) s3-1)
|
||||
(vector-rotate-around-axis! s5-2 s5-2 (rnd-float-range this -910.2222 910.2222) s3-1)
|
||||
)
|
||||
)
|
||||
(vector+! (-> this target-pos-predict-miss) (-> this root trans) s5-2)
|
||||
@@ -1269,70 +1166,18 @@
|
||||
)
|
||||
|
||||
(defun do-spline ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let* ((f1-1 (* arg5 arg5))
|
||||
(f0-2 (* arg5 f1-1))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((f1-1 (* arg5 arg5))
|
||||
(f0-2 (* arg5 f1-1))
|
||||
)
|
||||
(let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2))
|
||||
(f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5)))
|
||||
(f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1)))
|
||||
)
|
||||
(vector-float*! arg0 arg1 f2-3)
|
||||
(let ((t2-0 arg0))
|
||||
(let ((v1-10 arg0))
|
||||
(let ((t1-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2)))
|
||||
(let ((a1-1 f3-7))
|
||||
(.mov vf7 a1-1)
|
||||
)
|
||||
(.lvf vf5 (&-> t1-3 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-10 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> t2-0 quad) vf6)
|
||||
(let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2))
|
||||
(f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5)))
|
||||
(f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1)))
|
||||
)
|
||||
(let ((a2-1 arg0))
|
||||
(let ((v1-11 arg0))
|
||||
(let ((a1-3 (vector+! (new 'stack-no-clear 'vector) arg3 arg4)))
|
||||
(let ((t0-1 f1-3))
|
||||
(.mov vf7 t0-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-3 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-11 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a2-1 quad) vf6)
|
||||
)
|
||||
)
|
||||
(let ((v0-0 arg0))
|
||||
(let ((v1-12 arg0))
|
||||
(let ((a0-1 arg3))
|
||||
(let ((a1-4 f0-2))
|
||||
(.mov vf7 a1-4)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-1 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-12 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v0-0 quad) vf6)
|
||||
v0-0
|
||||
)
|
||||
(vector-float*! arg0 arg1 f2-3)
|
||||
(vector+*! arg0 arg0 (vector+! (new 'stack-no-clear 'vector) arg1 arg2) f3-7)
|
||||
(vector+*! arg0 arg0 (vector+! (new 'stack-no-clear 'vector) arg3 arg4) f1-3)
|
||||
)
|
||||
(vector+*! arg0 arg0 arg3 f0-2)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1435,12 +1280,10 @@
|
||||
(sv-816 nav-poly)
|
||||
(sv-832 vector)
|
||||
)
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))
|
||||
@@ -1454,32 +1297,18 @@
|
||||
(s0-0 (new 'stack 'collide-query))
|
||||
)
|
||||
(vector-rotate-around-y! sv-768 s4-0 (* 182.04445 (the float (+ (* 23 s2-0) -70))))
|
||||
(let ((v1-10 s1-0))
|
||||
(let ((a0-6 (-> this root trans)))
|
||||
(let ((a1-5 sv-768))
|
||||
(let ((a2-2 1.0))
|
||||
(.mov vf7 a2-2)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-5 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-6 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-10 quad) vf6)
|
||||
)
|
||||
(vector+*! s1-0 (-> this root trans) sv-768 1.0)
|
||||
(if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0)
|
||||
(set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y))
|
||||
)
|
||||
(let ((v1-14 (-> this nav))
|
||||
(let ((v1-15 (-> this nav))
|
||||
(a0-8 s1-0)
|
||||
(a1-7 (new 'stack-no-clear 'nav-poly))
|
||||
)
|
||||
(vector-! (-> a1-7 vertex 0) a0-8 (the-as vector (-> v1-14 state mesh bounds)))
|
||||
(set! (-> a1-7 vertex1 x) (-> v1-14 nearest-y-threshold))
|
||||
(vector-! (-> a1-7 vertex 0) a0-8 (the-as vector (-> v1-15 state mesh bounds)))
|
||||
(set! (-> a1-7 vertex1 x) (-> v1-15 nearest-y-threshold))
|
||||
(set! (-> a1-7 data 20) (the-as uint 2))
|
||||
(set! sv-816 (nav-mesh-method-45 (-> v1-14 state mesh) a1-7))
|
||||
(set! sv-816 (nav-mesh-method-45 (-> v1-15 state mesh) a1-7))
|
||||
)
|
||||
(when sv-816
|
||||
(let* ((v1-18 s4-0)
|
||||
@@ -1508,23 +1337,23 @@
|
||||
(let ((a3-3 (new 'stack-no-clear 'vector)))
|
||||
(set! sv-800 (-> this nav))
|
||||
(set! sv-832 sv-784)
|
||||
(let* ((v1-29 s1-0)
|
||||
(let* ((v1-30 s1-0)
|
||||
(a0-18 (-> sv-800 state mesh))
|
||||
(t9-7 (method-of-object a0-18 project-point-onto-plane-of-poly-local))
|
||||
(a2-7 sv-832)
|
||||
(t0-2 (vector-! (new 'stack-no-clear 'vector) v1-29 (the-as vector (-> sv-800 state mesh bounds))))
|
||||
(a2-6 sv-832)
|
||||
(t0-2 (vector-! (new 'stack-no-clear 'vector) v1-30 (the-as vector (-> sv-800 state mesh bounds))))
|
||||
)
|
||||
(t9-7 a0-18 sv-816 a2-7 a3-3 t0-2)
|
||||
(t9-7 a0-18 sv-816 a2-6 a3-3 t0-2)
|
||||
)
|
||||
)
|
||||
(let ((v1-30 sv-832))
|
||||
(let ((v1-31 sv-832))
|
||||
(let ((a0-21 (-> sv-800 state mesh bounds)))
|
||||
(.mov.vf.w vf6 vf0)
|
||||
(.lvf vf4 (&-> sv-832 quad))
|
||||
(.lvf vf5 (&-> a0-21 quad))
|
||||
)
|
||||
(.add.vf.xyz vf6 vf4 vf5)
|
||||
(.svf (&-> v1-30 quad) vf6)
|
||||
(.svf (&-> v1-31 quad) vf6)
|
||||
)
|
||||
0
|
||||
(set! (-> s1-0 y) (-> sv-784 y))
|
||||
|
||||
@@ -989,53 +989,38 @@
|
||||
)
|
||||
|
||||
(defmethod metalhead-grunt-method-228 ((this metalhead-grunt) (arg0 float))
|
||||
(local-vars (v1-5 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((gp-0 (get-focus! this)))
|
||||
(when gp-0
|
||||
(let ((v1-3 (get-trans gp-0 0))
|
||||
(s4-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-! s4-0 v1-3 (-> this root trans))
|
||||
(.lvf vf1 (&-> s4-0 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-5 vf1)
|
||||
(let* ((f30-0 v1-5)
|
||||
(f0-0 arg0)
|
||||
(f28-0 (* f0-0 f0-0))
|
||||
(f0-2 12288.0)
|
||||
)
|
||||
(when (or (>= (* f0-2 f0-2) f30-0) (>= f28-0 f30-0))
|
||||
(let ((f26-0 (quaternion-y-angle (-> this root quat)))
|
||||
(f0-7 (atan (-> s4-0 x) (-> s4-0 z)))
|
||||
(f1-0 1228.8)
|
||||
)
|
||||
(cond
|
||||
((and (< (* f1-0 f1-0) f30-0) (>= f28-0 f30-0) (>= 8192.0 (fabs (deg- f26-0 f0-7))))
|
||||
(go (method-of-object this attack))
|
||||
)
|
||||
((let ((f0-10 12288.0))
|
||||
(< f30-0 (* f0-10 f0-10))
|
||||
)
|
||||
(go (method-of-object this spin-attack))
|
||||
)
|
||||
(let ((gp-0 (get-focus! this)))
|
||||
(when gp-0
|
||||
(let ((v1-3 (get-trans gp-0 0))
|
||||
(s4-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-! s4-0 v1-3 (-> this root trans))
|
||||
(let* ((f30-0 (vector-length-squared s4-0))
|
||||
(f0-0 arg0)
|
||||
(f28-0 (* f0-0 f0-0))
|
||||
(f0-2 12288.0)
|
||||
)
|
||||
(when (or (>= (* f0-2 f0-2) f30-0) (>= f28-0 f30-0))
|
||||
(let ((f26-0 (quaternion-y-angle (-> this root quat)))
|
||||
(f0-7 (atan (-> s4-0 x) (-> s4-0 z)))
|
||||
(f1-0 1228.8)
|
||||
)
|
||||
(cond
|
||||
((and (< (* f1-0 f1-0) f30-0) (>= f28-0 f30-0) (>= 8192.0 (fabs (deg- f26-0 f0-7))))
|
||||
(go (method-of-object this attack))
|
||||
)
|
||||
((let ((f0-10 12288.0))
|
||||
(< f30-0 (* f0-10 f0-10))
|
||||
)
|
||||
(go (method-of-object this spin-attack))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
gp-0
|
||||
)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -718,37 +718,23 @@
|
||||
(let ((s0-0 (new 'stack-no-clear 'vector))
|
||||
(s1-1 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((a0-20 s2-0))
|
||||
(let ((v1-34 s2-0))
|
||||
(let ((a1-6 (-> s3-0 root transv)))
|
||||
(let ((a2-2 f0-6))
|
||||
(.mov vf7 a2-2)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-6 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-34 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-20 quad) vf6)
|
||||
)
|
||||
(vector+*! s2-0 s2-0 (-> s3-0 root transv) f0-6)
|
||||
(vector-normalize! sv-272 1.0)
|
||||
(vector-flatten! sv-288 *up-vector* sv-272)
|
||||
(vector-normalize! sv-288 1.0)
|
||||
(vector-cross! s0-0 sv-272 sv-288)
|
||||
(vector-normalize! s0-0 1.0)
|
||||
(let ((a2-5 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) sv-272 (-> this shoot-angle))))
|
||||
(vector-orient-by-quat! sv-288 sv-288 a2-5)
|
||||
(let ((a2-4 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) sv-272 (-> this shoot-angle))))
|
||||
(vector-orient-by-quat! sv-288 sv-288 a2-4)
|
||||
)
|
||||
(let* ((t9-9 quaternion-vector-angle!)
|
||||
(a0-28 (new 'stack-no-clear 'quaternion))
|
||||
(a2-6 (-> this shoot-angle))
|
||||
(a2-7 (t9-9 a0-28 sv-272 a2-6))
|
||||
(a0-29 (new 'stack-no-clear 'quaternion))
|
||||
(a2-5 (-> this shoot-angle))
|
||||
(a2-6 (t9-9 a0-29 sv-272 a2-5))
|
||||
)
|
||||
(vector-orient-by-quat! s0-0 s0-0 a2-7)
|
||||
(vector-orient-by-quat! s0-0 s0-0 a2-6)
|
||||
)
|
||||
(let ((a0-30 s1-1))
|
||||
(let ((a0-31 s1-1))
|
||||
(let ((v1-36 s2-0))
|
||||
(let ((a1-17 (-> this miss-amount)))
|
||||
(.mov vf7 a1-17)
|
||||
@@ -759,19 +745,9 @@
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-30 quad) vf6)
|
||||
)
|
||||
(let ((v1-37 s2-0))
|
||||
(let ((a0-31 (* arg1 (-> this miss-amount))))
|
||||
(.mov vf7 a0-31)
|
||||
)
|
||||
(.lvf vf5 (&-> s0-0 quad))
|
||||
(.lvf vf4 (&-> s1-1 quad))
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-37 quad) vf6)
|
||||
(.svf (&-> a0-31 quad) vf6)
|
||||
)
|
||||
(vector+*! s2-0 s1-1 s0-0 (* arg1 (-> this miss-amount)))
|
||||
)
|
||||
)
|
||||
(vector-! (-> s5-0 vel) s2-0 (-> s5-0 pos))
|
||||
|
||||
@@ -930,162 +930,138 @@
|
||||
)
|
||||
|
||||
(defmethod update-danger-from-target ((this traffic-engine))
|
||||
(local-vars (v1-20 float) (v1-32 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0 *target*))
|
||||
(when s5-0
|
||||
(let ((v1-1 (-> this danger-sphere-array)))
|
||||
(set! (-> v1-1 0 handle) (process->handle s5-0))
|
||||
(let ((a0-4 (-> s5-0 focus-status))
|
||||
(f0-0 0.0)
|
||||
(f1-0 0.0)
|
||||
(f3-0 1.0)
|
||||
(f2-0 0.0)
|
||||
)
|
||||
(cond
|
||||
((logtest? (focus-status mech dark shooting) a0-4)
|
||||
(set! f0-0 245760.0)
|
||||
(set! f1-0 163840.0)
|
||||
(set! f2-0 1.0)
|
||||
(set! f3-0 0.0)
|
||||
)
|
||||
((logtest? (focus-status gun) a0-4)
|
||||
(set! f0-0 102400.0)
|
||||
(set! f1-0 61440.0)
|
||||
(set! f2-0 0.5)
|
||||
(set! f3-0 0.5)
|
||||
)
|
||||
((logtest? (focus-status flut board pilot) a0-4)
|
||||
(set! f0-0 40960.0)
|
||||
(set! f1-0 24576.0)
|
||||
(set! f2-0 0.5)
|
||||
)
|
||||
((logtest? a0-4 (focus-status dangerous))
|
||||
(set! f0-0 61440.0)
|
||||
(set! f1-0 40960.0)
|
||||
(set! f3-0 0.0)
|
||||
(set! f2-0 0.5)
|
||||
)
|
||||
(else
|
||||
(set! f3-0 1.5)
|
||||
)
|
||||
(let ((s5-0 *target*))
|
||||
(when s5-0
|
||||
(let ((v1-1 (-> this danger-sphere-array)))
|
||||
(set! (-> v1-1 0 handle) (process->handle s5-0))
|
||||
(let ((a0-4 (-> s5-0 focus-status))
|
||||
(f0-0 0.0)
|
||||
(f1-0 0.0)
|
||||
(f3-0 1.0)
|
||||
(f2-0 0.0)
|
||||
)
|
||||
(set! (-> v1-1 0 decay-rate) (/ f3-0 10))
|
||||
(when (< (-> v1-1 0 danger-level) f2-0)
|
||||
(set! (-> v1-1 0 danger-level) f2-0)
|
||||
(set! (-> v1-1 0 sphere r) f1-0)
|
||||
(set! (-> v1-1 0 notify-radius) f0-0)
|
||||
(cond
|
||||
((logtest? (focus-status mech dark shooting) a0-4)
|
||||
(set! f0-0 245760.0)
|
||||
(set! f1-0 163840.0)
|
||||
(set! f2-0 1.0)
|
||||
(set! f3-0 0.0)
|
||||
)
|
||||
((logtest? (focus-status gun) a0-4)
|
||||
(set! f0-0 102400.0)
|
||||
(set! f1-0 61440.0)
|
||||
(set! f2-0 0.5)
|
||||
(set! f3-0 0.5)
|
||||
)
|
||||
((logtest? (focus-status flut board pilot) a0-4)
|
||||
(set! f0-0 40960.0)
|
||||
(set! f1-0 24576.0)
|
||||
(set! f2-0 0.5)
|
||||
)
|
||||
((logtest? a0-4 (focus-status dangerous))
|
||||
(set! f0-0 61440.0)
|
||||
(set! f1-0 40960.0)
|
||||
(set! f3-0 0.0)
|
||||
(set! f2-0 0.5)
|
||||
)
|
||||
(else
|
||||
(set! f3-0 1.5)
|
||||
)
|
||||
)
|
||||
(let ((f0-1 (-> v1-1 0 sphere r)))
|
||||
(set! (-> v1-1 0 sphere quad) (-> s5-0 control trans quad))
|
||||
(set! (-> v1-1 0 sphere r) f0-1)
|
||||
)
|
||||
(vector-copy! (-> v1-1 0 velocity) (-> s5-0 control transv))
|
||||
(let ((f0-3 (- (-> v1-1 0 danger-level) (* (-> v1-1 0 decay-rate) (seconds-per-frame)))))
|
||||
(set! (-> v1-1 0 danger-level) (fmax 0.0 f0-3))
|
||||
(set! (-> v1-1 0 decay-rate) (/ f3-0 10))
|
||||
(when (< (-> v1-1 0 danger-level) f2-0)
|
||||
(set! (-> v1-1 0 danger-level) f2-0)
|
||||
(set! (-> v1-1 0 sphere r) f1-0)
|
||||
(set! (-> v1-1 0 notify-radius) f0-0)
|
||||
)
|
||||
)
|
||||
(let ((s3-0 (-> s5-0 focus-status))
|
||||
(f30-0 0.0)
|
||||
(s4-0 (new 'stack-no-clear 'inline-array 'traffic-suppression-box 2))
|
||||
)
|
||||
(vector-copy! (-> s4-0 0 bbox max) (-> s5-0 control transv))
|
||||
(vector-z-quaternion! (the-as vector (-> s4-0 1)) (get-quat s5-0 3))
|
||||
(set! (-> s4-0 1 data 16) (the-as uint 3))
|
||||
(cond
|
||||
((logtest? (focus-status shooting) s3-0)
|
||||
(vector-float*! (the-as vector (-> s4-0 0)) (the-as vector (-> s4-0 1)) 409600.0)
|
||||
(set! f30-0 4096.0)
|
||||
(set! (-> s4-0 1 data 16) (the-as uint 0))
|
||||
0
|
||||
)
|
||||
((and (logtest? (focus-status gun) s3-0)
|
||||
(not (and (logtest? (focus-status pilot) s3-0) (let* ((v1-19 (-> s4-0 0 bbox max))
|
||||
(f0-6 40960.0)
|
||||
(f0-8 (* f0-6 f0-6))
|
||||
)
|
||||
(.lvf vf1 (&-> v1-19 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-20 vf1)
|
||||
(< f0-8 v1-20)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(vector-float*! (the-as vector (-> s4-0 0)) (the-as vector (-> s4-0 1)) 163840.0)
|
||||
(set! f30-0 8192.0)
|
||||
(set! (-> s4-0 1 data 16) (the-as uint 1))
|
||||
)
|
||||
((logtest? (focus-status dangerous flut board pilot) s3-0)
|
||||
(vector-float*! (the-as vector (-> s4-0 0)) (-> s4-0 0 bbox max) 2.0)
|
||||
(let* ((v1-31 (-> s4-0 0))
|
||||
(f0-11 20480.0)
|
||||
(f0-13 (* f0-11 f0-11))
|
||||
)
|
||||
(.lvf vf1 (&-> v1-31 bbox min quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-32 vf1)
|
||||
(if (< f0-13 v1-32)
|
||||
(set! f30-0 20480.0)
|
||||
)
|
||||
)
|
||||
(set! (-> s4-0 1 data 16) (the-as uint (cond
|
||||
((logtest? (focus-status pilot) s3-0)
|
||||
3
|
||||
)
|
||||
((logtest? (focus-status flut board) s3-0)
|
||||
2
|
||||
)
|
||||
((logtest? s3-0 (focus-status dangerous))
|
||||
4
|
||||
)
|
||||
(else
|
||||
5
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((f0-1 (-> v1-1 0 sphere r)))
|
||||
(set! (-> v1-1 0 sphere quad) (-> s5-0 control trans quad))
|
||||
(set! (-> v1-1 0 sphere r) f0-1)
|
||||
)
|
||||
(vector-copy! (-> v1-1 0 velocity) (-> s5-0 control transv))
|
||||
(let ((f0-3 (- (-> v1-1 0 danger-level) (* (-> v1-1 0 decay-rate) (seconds-per-frame)))))
|
||||
(set! (-> v1-1 0 danger-level) (fmax 0.0 f0-3))
|
||||
)
|
||||
)
|
||||
(let ((s3-0 (-> s5-0 focus-status))
|
||||
(f30-0 0.0)
|
||||
(s4-0 (new 'stack-no-clear 'inline-array 'traffic-suppression-box 2))
|
||||
)
|
||||
(when (< 0.0 f30-0)
|
||||
(let ((s3-1 (new 'stack-no-clear 'array 'collide-shape 40))
|
||||
(s2-1 (new 'stack 'traffic-danger-info))
|
||||
)
|
||||
(set! (-> s2-1 sphere quad) (-> s5-0 control trans quad))
|
||||
(set! (-> s2-1 danger-type) (-> s4-0 1 data 16))
|
||||
(set! (-> s2-1 sphere r) f30-0)
|
||||
(vector-copy! (-> s2-1 velocity) (-> s4-0 0 bbox min))
|
||||
(let ((gp-1 (fill-actor-list-for-sphere
|
||||
(-> this object-hash)
|
||||
(-> s2-1 sphere)
|
||||
(-> s2-1 velocity)
|
||||
(-> s2-1 sphere r)
|
||||
s3-1
|
||||
40
|
||||
-1
|
||||
)
|
||||
(vector-copy! (-> s4-0 0 bbox max) (-> s5-0 control transv))
|
||||
(vector-z-quaternion! (the-as vector (-> s4-0 1)) (get-quat s5-0 3))
|
||||
(set! (-> s4-0 1 data 16) (the-as uint 3))
|
||||
(cond
|
||||
((logtest? (focus-status shooting) s3-0)
|
||||
(vector-float*! (the-as vector (-> s4-0 0)) (the-as vector (-> s4-0 1)) 409600.0)
|
||||
(set! f30-0 4096.0)
|
||||
(set! (-> s4-0 1 data 16) (the-as uint 0))
|
||||
0
|
||||
)
|
||||
((and (logtest? (focus-status gun) s3-0)
|
||||
(not (and (logtest? (focus-status pilot) s3-0) (let ((v1-19 (-> s4-0 0 bbox max))
|
||||
(f0-6 40960.0)
|
||||
)
|
||||
(< (* f0-6 f0-6) (vector-length-squared v1-19))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(vector-float*! (the-as vector (-> s4-0 0)) (the-as vector (-> s4-0 1)) 163840.0)
|
||||
(set! f30-0 8192.0)
|
||||
(set! (-> s4-0 1 data 16) (the-as uint 1))
|
||||
)
|
||||
((logtest? (focus-status dangerous flut board pilot) s3-0)
|
||||
(vector-float*! (the-as vector (-> s4-0 0)) (-> s4-0 0 bbox max) 2.0)
|
||||
(let ((v1-31 (-> s4-0 0))
|
||||
(f0-11 20480.0)
|
||||
)
|
||||
(if (< (* f0-11 f0-11) (vector-length-squared (the-as vector v1-31)))
|
||||
(set! f30-0 20480.0)
|
||||
)
|
||||
)
|
||||
(set! (-> s4-0 1 data 16) (the-as uint (cond
|
||||
((logtest? (focus-status pilot) s3-0)
|
||||
3
|
||||
)
|
||||
((logtest? (focus-status flut board) s3-0)
|
||||
2
|
||||
)
|
||||
((logtest? s3-0 (focus-status dangerous))
|
||||
4
|
||||
)
|
||||
(else
|
||||
5
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (< 0.0 f30-0)
|
||||
(let ((s3-1 (new 'stack-no-clear 'array 'collide-shape 40))
|
||||
(s2-1 (new 'stack 'traffic-danger-info))
|
||||
)
|
||||
(set! (-> s2-1 sphere quad) (-> s5-0 control trans quad))
|
||||
(set! (-> s2-1 danger-type) (-> s4-0 1 data 16))
|
||||
(set! (-> s2-1 sphere r) f30-0)
|
||||
(vector-copy! (-> s2-1 velocity) (-> s4-0 0 bbox min))
|
||||
(let ((gp-1 (fill-actor-list-for-sphere
|
||||
(-> this object-hash)
|
||||
(-> s2-1 sphere)
|
||||
(-> s2-1 velocity)
|
||||
(-> s2-1 sphere r)
|
||||
s3-1
|
||||
40
|
||||
-1
|
||||
)
|
||||
)
|
||||
(dotimes (s5-1 gp-1)
|
||||
(let ((a0-52 (as-type (-> s3-1 s5-1) citizen)))
|
||||
(if a0-52
|
||||
(send-event (the-as process-tree a0-52) 'clear-path s2-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(dotimes (s5-1 gp-1)
|
||||
(let ((a0-52 (as-type (-> s3-1 s5-1) citizen)))
|
||||
(if a0-52
|
||||
(send-event (the-as process-tree a0-52) 'clear-path s2-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1093,9 +1069,9 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod update-danger ((this traffic-engine))
|
||||
|
||||
@@ -96,61 +96,38 @@
|
||||
)
|
||||
|
||||
(defmethod vehicle-controller-method-20 ((this vehicle-controller) (arg0 vector) (arg1 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(set! (-> this max-turn-speed) (sqrtf (* (fmax 16384.0 arg1) (-> this turn-accel))))
|
||||
(let ((v1-1 (new 'stack-no-clear 'inline-array 'vector 2)))
|
||||
(vector-! (-> v1-1 1) (-> this turn-exit-point) arg0)
|
||||
(vector-copy! (-> v1-1 0) (-> this turn-exit-dir))
|
||||
(set! (-> v1-1 0 x) (-> this turn-exit-dir z))
|
||||
(set! (-> v1-1 0 z) (- (-> this turn-exit-dir x)))
|
||||
(logior! (-> this flags) (vehicle-controller-flag left-turn))
|
||||
(when (< 0.0 (vector-dot (-> v1-1 1) (-> v1-1 0)))
|
||||
(logclear! (-> this flags) (vehicle-controller-flag left-turn))
|
||||
(vector-float*! (-> v1-1 0) (-> v1-1 0) -1.0)
|
||||
)
|
||||
(let ((a1-6 (-> this dest-circle)))
|
||||
(let ((a0-12 (-> this turn-exit-point)))
|
||||
(let ((v1-2 (-> v1-1 0)))
|
||||
(let ((a3-3 arg1))
|
||||
(.mov vf7 a3-3)
|
||||
)
|
||||
(.lvf vf5 (&-> v1-2 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-12 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-6 quad) vf6)
|
||||
)
|
||||
(set! (-> this max-turn-speed) (sqrtf (* (fmax 16384.0 arg1) (-> this turn-accel))))
|
||||
(let ((v1-1 (new 'stack-no-clear 'inline-array 'vector 2)))
|
||||
(vector-! (-> v1-1 1) (-> this turn-exit-point) arg0)
|
||||
(vector-copy! (-> v1-1 0) (-> this turn-exit-dir))
|
||||
(set! (-> v1-1 0 x) (-> this turn-exit-dir z))
|
||||
(set! (-> v1-1 0 z) (- (-> this turn-exit-dir x)))
|
||||
(logior! (-> this flags) (vehicle-controller-flag left-turn))
|
||||
(when (< 0.0 (vector-dot (-> v1-1 1) (-> v1-1 0)))
|
||||
(logclear! (-> this flags) (vehicle-controller-flag left-turn))
|
||||
(vector-float*! (-> v1-1 0) (-> v1-1 0) -1.0)
|
||||
)
|
||||
(set! (-> this dest-circle w) arg1)
|
||||
0
|
||||
(vehicle-controller-method-16 this (-> this path-prev-point) (-> this turn-enter-point))
|
||||
(vector-copy! (-> this target-point) (-> this turn-enter-point))
|
||||
(vector-! (-> this turn-enter-dir) (-> this turn-enter-point) (-> this path-prev-point))
|
||||
(set! (-> this turn-enter-dir y) 0.0)
|
||||
(vector-normalize! (-> this turn-enter-dir) 1.0)
|
||||
(let ((f0-12 (cos 8192.0))
|
||||
(f30-0 (vector-dot (-> this turn-enter-dir) (-> this turn-exit-dir)))
|
||||
)
|
||||
(set! (-> this max-turn-speed)
|
||||
(* (-> this max-turn-speed) (+ 1.0 (fmax 0.0 (/ (- f30-0 f0-12) (- 1.0 f0-12)))))
|
||||
)
|
||||
(if (>= f30-0 (cos 1820.4445))
|
||||
(set! (-> this max-turn-speed) 409600.0)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
(vector+*! (-> this dest-circle) (-> this turn-exit-point) (-> v1-1 0) arg1)
|
||||
)
|
||||
(set! (-> this dest-circle w) arg1)
|
||||
0
|
||||
(vehicle-controller-method-16 this (-> this path-prev-point) (-> this turn-enter-point))
|
||||
(vector-copy! (-> this target-point) (-> this turn-enter-point))
|
||||
(vector-! (-> this turn-enter-dir) (-> this turn-enter-point) (-> this path-prev-point))
|
||||
(set! (-> this turn-enter-dir y) 0.0)
|
||||
(vector-normalize! (-> this turn-enter-dir) 1.0)
|
||||
(let ((f0-12 (cos 8192.0))
|
||||
(f30-0 (vector-dot (-> this turn-enter-dir) (-> this turn-exit-dir)))
|
||||
)
|
||||
(set! (-> this max-turn-speed)
|
||||
(* (-> this max-turn-speed) (+ 1.0 (fmax 0.0 (/ (- f30-0 f0-12) (- 1.0 f0-12)))))
|
||||
)
|
||||
(if (>= f30-0 (cos 1820.4445))
|
||||
(set! (-> this max-turn-speed) 409600.0)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod vehicle-controller-method-19 ((this vehicle-controller) (arg0 vector) (arg1 object) (arg2 vector) (arg3 vector))
|
||||
@@ -255,74 +232,37 @@
|
||||
)
|
||||
|
||||
(defmethod vehicle-controller-method-16 ((this vehicle-controller) (arg0 vector) (arg1 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s4-0 (new 'stack-no-clear 'inline-array 'vector 2)))
|
||||
(vector-! (-> s4-0 0) (-> this dest-circle) arg0)
|
||||
(set! (-> s4-0 0 y) 0.0)
|
||||
(let* ((v1-1 (-> s4-0 0))
|
||||
(f30-0 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))))
|
||||
(f28-0 (-> this dest-circle w))
|
||||
)
|
||||
(vector-xz-normalize! (-> s4-0 0) 1.0)
|
||||
(set! (-> s4-0 1 x) (-> s4-0 0 z))
|
||||
(set! (-> s4-0 1 y) 0.0)
|
||||
(set! (-> s4-0 1 z) (- (-> s4-0 0 x)))
|
||||
(if (logtest? (-> this flags) (vehicle-controller-flag left-turn))
|
||||
(vector-float*! (-> s4-0 1) (-> s4-0 1) -1.0)
|
||||
)
|
||||
(let* ((f0-10 f30-0)
|
||||
(f0-12 (* f0-10 f0-10))
|
||||
(f1-3 f28-0)
|
||||
(f1-6 (sqrtf (- f0-12 (* f1-3 f1-3))))
|
||||
(f0-15 (/ (* f28-0 f1-6) f30-0))
|
||||
)
|
||||
(let ((f1-9 (/ (* f1-6 f1-6) f30-0)))
|
||||
(vector-copy! arg1 arg0)
|
||||
(let ((a1-5 arg1))
|
||||
(let ((v1-12 arg1))
|
||||
(let ((a0-5 (-> s4-0 0)))
|
||||
(let ((a2-1 f1-9))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-5 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-12 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-5 quad) vf6)
|
||||
)
|
||||
)
|
||||
(let ((a0-6 arg1))
|
||||
(let ((v1-13 arg1))
|
||||
(let ((a1-6 (-> s4-0 1)))
|
||||
(let ((a2-2 f0-15))
|
||||
(.mov vf7 a2-2)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-6 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-13 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a0-6 quad) vf6)
|
||||
)
|
||||
(let ((s4-0 (new 'stack-no-clear 'inline-array 'vector 2)))
|
||||
(vector-! (-> s4-0 0) (-> this dest-circle) arg0)
|
||||
(set! (-> s4-0 0 y) 0.0)
|
||||
(let* ((v1-1 (-> s4-0 0))
|
||||
(f30-0 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))))
|
||||
(f28-0 (-> this dest-circle w))
|
||||
)
|
||||
(vector-xz-normalize! (-> s4-0 0) 1.0)
|
||||
(set! (-> s4-0 1 x) (-> s4-0 0 z))
|
||||
(set! (-> s4-0 1 y) 0.0)
|
||||
(set! (-> s4-0 1 z) (- (-> s4-0 0 x)))
|
||||
(if (logtest? (-> this flags) (vehicle-controller-flag left-turn))
|
||||
(vector-float*! (-> s4-0 1) (-> s4-0 1) -1.0)
|
||||
)
|
||||
(let* ((f0-10 f30-0)
|
||||
(f0-12 (* f0-10 f0-10))
|
||||
(f1-3 f28-0)
|
||||
(f1-6 (sqrtf (- f0-12 (* f1-3 f1-3))))
|
||||
(f0-15 (/ (* f28-0 f1-6) f30-0))
|
||||
)
|
||||
(let ((f1-9 (/ (* f1-6 f1-6) f30-0)))
|
||||
(vector-copy! arg1 arg0)
|
||||
(vector+*! arg1 arg1 (-> s4-0 0) f1-9)
|
||||
)
|
||||
(vector+*! arg1 arg1 (-> s4-0 1) f0-15)
|
||||
)
|
||||
)
|
||||
(set! (-> arg1 y) (-> this turn-exit-point y))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
(set! (-> arg1 y) (-> this turn-exit-point y))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod vehicle-controller-method-10 ((this vehicle-controller) (arg0 nav-branch))
|
||||
|
||||
@@ -327,100 +327,63 @@
|
||||
)
|
||||
|
||||
(defun vehicle-draw-thruster ((arg0 vehicle-particle-common-info) (arg1 vehicle-draw-thruster-params))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0 (new 'stack-no-clear 'vehicle-thruster-work)))
|
||||
(vector-copy! (-> s5-0 vec2) (-> arg1 trans))
|
||||
(quaternion-copy! (-> s5-0 quat1) (-> arg1 quat))
|
||||
(quaternion-rotate-local-x! (-> s5-0 quat1) (-> s5-0 quat1) 32768.0)
|
||||
(quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1))
|
||||
(vector-copy! (-> s5-0 vec4) (-> s5-0 vec0))
|
||||
(let ((f0-0 (rand-vu-float-range 1.0 1.33)))
|
||||
(set! (-> s5-0 float0) (* f0-0 (-> arg1 length) (-> arg1 thrust)))
|
||||
(set! (-> s5-0 float1) (fmin (* (-> arg1 width) f0-0) (/ (-> s5-0 float0) 2)))
|
||||
)
|
||||
(let ((a1-5 (-> s5-0 vec3)))
|
||||
(let ((v1-4 (-> arg1 trans)))
|
||||
(let ((a0-9 (-> s5-0 vec4)))
|
||||
(let ((a2-2 (/ (-> s5-0 float0) 4)))
|
||||
(.mov vf7 a2-2)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-9 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-5 quad) vf6)
|
||||
)
|
||||
(quad-copy! (the-as pointer (-> s5-0 glow)) (the-as pointer (-> arg0 thruster-glow-template)) 4)
|
||||
(let* ((v1-5 (-> s5-0 glow))
|
||||
(a1-7 (-> s5-0 vec3))
|
||||
(f0-5 (-> v1-5 position w))
|
||||
)
|
||||
(vector-copy! (-> v1-5 position) a1-7)
|
||||
(set! (-> v1-5 position w) f0-5)
|
||||
)
|
||||
0
|
||||
(set! (-> s5-0 glow color y) (rand-vu-float-range 0.0 64.0))
|
||||
(set! (-> s5-0 glow color w) (* (-> arg1 fog-fade) (+ (* 16.0 (-> arg1 thrust)) (* 4.0 (rand-vu)))))
|
||||
(let ((f0-13 (* 4.0 (-> s5-0 float1))))
|
||||
(set! (-> s5-0 glow position w) f0-13)
|
||||
(set! (-> s5-0 glow size-y) f0-13)
|
||||
(set! (-> s5-0 glow size-probe) (/ f0-13 40))
|
||||
)
|
||||
(add! *simple-sprite-system* (-> s5-0 glow))
|
||||
(let ((v1-15 (-> s5-0 vec3)))
|
||||
(let ((a0-14 (-> arg1 trans)))
|
||||
(let ((a1-11 (-> s5-0 vec4)))
|
||||
(let ((a2-5 (/ (-> s5-0 float0) 2)))
|
||||
(.mov vf7 a2-5)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-11 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-14 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-15 quad) vf6)
|
||||
)
|
||||
(set! (-> arg0 part-thruster-x initial-valuef) (-> s5-0 float1))
|
||||
(set! (-> arg0 part-spec2 initial-valuef) (-> s5-0 float0))
|
||||
(vector-copy! (-> s5-0 vec1) (-> s5-0 vec3))
|
||||
(launch-particles
|
||||
:system (-> arg0 sp-system3d)
|
||||
(-> arg0 part-thruster)
|
||||
(the-as matrix (-> s5-0 quat0))
|
||||
:origin-is-matrix #t
|
||||
)
|
||||
(quaternion-rotate-local-z! (-> s5-0 quat1) (-> s5-0 quat1) 10922.667)
|
||||
(quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1))
|
||||
(vector-copy! (-> s5-0 vec1) (-> s5-0 vec3))
|
||||
(launch-particles
|
||||
:system (-> arg0 sp-system3d)
|
||||
(-> arg0 part-thruster)
|
||||
(the-as matrix (-> s5-0 quat0))
|
||||
:origin-is-matrix #t
|
||||
)
|
||||
(quaternion-rotate-local-z! (-> s5-0 quat1) (-> s5-0 quat1) 10922.667)
|
||||
(quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1))
|
||||
(vector-copy! (-> s5-0 vec1) (-> s5-0 vec3))
|
||||
(launch-particles
|
||||
:system (-> arg0 sp-system3d)
|
||||
(-> arg0 part-thruster)
|
||||
(the-as matrix (-> s5-0 quat0))
|
||||
:origin-is-matrix #t
|
||||
)
|
||||
(let ((s5-0 (new 'stack-no-clear 'vehicle-thruster-work)))
|
||||
(vector-copy! (-> s5-0 vec2) (-> arg1 trans))
|
||||
(quaternion-copy! (-> s5-0 quat1) (-> arg1 quat))
|
||||
(quaternion-rotate-local-x! (-> s5-0 quat1) (-> s5-0 quat1) 32768.0)
|
||||
(quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1))
|
||||
(vector-copy! (-> s5-0 vec4) (-> s5-0 vec0))
|
||||
(let ((f0-0 (rand-vu-float-range 1.0 1.33)))
|
||||
(set! (-> s5-0 float0) (* f0-0 (-> arg1 length) (-> arg1 thrust)))
|
||||
(set! (-> s5-0 float1) (fmin (* (-> arg1 width) f0-0) (/ (-> s5-0 float0) 2)))
|
||||
)
|
||||
(vector+*! (-> s5-0 vec3) (-> arg1 trans) (-> s5-0 vec4) (/ (-> s5-0 float0) 4))
|
||||
(quad-copy! (the-as pointer (-> s5-0 glow)) (the-as pointer (-> arg0 thruster-glow-template)) 4)
|
||||
(let* ((v1-5 (-> s5-0 glow))
|
||||
(a1-8 (-> s5-0 vec3))
|
||||
(f0-5 (-> v1-5 position w))
|
||||
)
|
||||
(vector-copy! (-> v1-5 position) a1-8)
|
||||
(set! (-> v1-5 position w) f0-5)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
(set! (-> s5-0 glow color y) (rand-vu-float-range 0.0 64.0))
|
||||
(set! (-> s5-0 glow color w) (* (-> arg1 fog-fade) (+ (* 16.0 (-> arg1 thrust)) (* 4.0 (rand-vu)))))
|
||||
(let ((f0-13 (* 4.0 (-> s5-0 float1))))
|
||||
(set! (-> s5-0 glow position w) f0-13)
|
||||
(set! (-> s5-0 glow size-y) f0-13)
|
||||
(set! (-> s5-0 glow size-probe) (/ f0-13 40))
|
||||
)
|
||||
(add! *simple-sprite-system* (-> s5-0 glow))
|
||||
(vector+*! (-> s5-0 vec3) (-> arg1 trans) (-> s5-0 vec4) (/ (-> s5-0 float0) 2))
|
||||
(set! (-> arg0 part-thruster-x initial-valuef) (-> s5-0 float1))
|
||||
(set! (-> arg0 part-spec2 initial-valuef) (-> s5-0 float0))
|
||||
(vector-copy! (-> s5-0 vec1) (-> s5-0 vec3))
|
||||
(launch-particles
|
||||
:system (-> arg0 sp-system3d)
|
||||
(-> arg0 part-thruster)
|
||||
(the-as matrix (-> s5-0 quat0))
|
||||
:origin-is-matrix #t
|
||||
)
|
||||
(quaternion-rotate-local-z! (-> s5-0 quat1) (-> s5-0 quat1) 10922.667)
|
||||
(quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1))
|
||||
(vector-copy! (-> s5-0 vec1) (-> s5-0 vec3))
|
||||
(launch-particles
|
||||
:system (-> arg0 sp-system3d)
|
||||
(-> arg0 part-thruster)
|
||||
(the-as matrix (-> s5-0 quat0))
|
||||
:origin-is-matrix #t
|
||||
)
|
||||
(quaternion-rotate-local-z! (-> s5-0 quat1) (-> s5-0 quat1) 10922.667)
|
||||
(quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1))
|
||||
(vector-copy! (-> s5-0 vec1) (-> s5-0 vec3))
|
||||
(launch-particles
|
||||
:system (-> arg0 sp-system3d)
|
||||
(-> arg0 part-thruster)
|
||||
(the-as matrix (-> s5-0 quat0))
|
||||
:origin-is-matrix #t
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -248,92 +248,69 @@
|
||||
)
|
||||
|
||||
(defbehavior vehicle-explode-post vehicle ()
|
||||
(local-vars (v1-42 float) (v1-47 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(set! (-> self camera-dist2) (vector-vector-distance-squared (-> self root trans) (camera-pos)))
|
||||
(set! (-> self player-dist2) (vector-vector-distance-squared (-> self root trans) (target-pos 0)))
|
||||
(cond
|
||||
((logtest? (-> self draw status) (draw-control-status on-screen))
|
||||
(set! (-> self offscreen-time) (the-as uint (current-time)))
|
||||
)
|
||||
(else
|
||||
(let ((v1-7 (new 'stack-no-clear 'array 'uint32 1)))
|
||||
(set! (-> v1-7 0) (the-as uint (current-time)))
|
||||
(if (or (>= (- (-> v1-7 0) (-> self offscreen-time)) (the-as uint 1500))
|
||||
(let ((f0-2 409600.0))
|
||||
(< (* f0-2 f0-2) (-> self camera-dist2))
|
||||
(set! (-> self camera-dist2) (vector-vector-distance-squared (-> self root trans) (camera-pos)))
|
||||
(set! (-> self player-dist2) (vector-vector-distance-squared (-> self root trans) (target-pos 0)))
|
||||
(cond
|
||||
((logtest? (-> self draw status) (draw-control-status on-screen))
|
||||
(set! (-> self offscreen-time) (the-as uint (current-time)))
|
||||
)
|
||||
(else
|
||||
(let ((v1-7 (new 'stack-no-clear 'array 'uint32 1)))
|
||||
(set! (-> v1-7 0) (the-as uint (current-time)))
|
||||
(if (or (>= (- (-> v1-7 0) (-> self offscreen-time)) (the-as uint 1500))
|
||||
(let ((f0-2 409600.0))
|
||||
(< (* f0-2 f0-2) (-> self camera-dist2))
|
||||
)
|
||||
)
|
||||
(go-virtual die)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((f0-5 819200.0))
|
||||
(if (< (* f0-5 f0-5) (-> self camera-dist2))
|
||||
(go-virtual die)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((logtest? (-> self rbody flags) (rigid-body-flag enable-physics))
|
||||
(vehicle-method-117 self)
|
||||
(when (and (logtest? (-> self v-flags) (vehicle-flag disturbed)) (logtest? (-> self v-flags) (vehicle-flag impact)))
|
||||
(let* ((f0-9 (* 0.0033333334 (the float (- (current-time) (-> self disturbed-time)))))
|
||||
(f0-12 (* f0-9 f0-9 (-> self camera-dist2)))
|
||||
(f1-5 0.000016276043)
|
||||
(f0-13 (* f0-12 (* f1-5 f1-5)))
|
||||
)
|
||||
(if (and (< (vector-length-squared (-> self rbody ang-velocity)) f0-13)
|
||||
(let ((f1-9 (vector-length-squared (-> self rbody lin-velocity)))
|
||||
(f2-0 614.4)
|
||||
)
|
||||
(< f1-9 (* f0-13 (* f2-0 f2-0)))
|
||||
)
|
||||
)
|
||||
(go-virtual die)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((f0-5 819200.0))
|
||||
(if (< (* f0-5 f0-5) (-> self camera-dist2))
|
||||
(go-virtual die)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((logtest? (-> self rbody flags) (rigid-body-flag enable-physics))
|
||||
(vehicle-method-117 self)
|
||||
(when (and (logtest? (-> self v-flags) (vehicle-flag disturbed)) (logtest? (-> self v-flags) (vehicle-flag impact)))
|
||||
(let* ((f0-9 (* 0.0033333334 (the float (- (current-time) (-> self disturbed-time)))))
|
||||
(f0-12 (* f0-9 f0-9 (-> self camera-dist2)))
|
||||
(f1-5 0.000016276043)
|
||||
(f0-13 (* f0-12 (* f1-5 f1-5)))
|
||||
)
|
||||
(.lvf vf1 (&-> (-> self rbody ang-velocity) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-42 vf1)
|
||||
(if (and (< v1-42 f0-13) (begin
|
||||
(.lvf vf1 (&-> (-> self rbody lin-velocity) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-47 vf1)
|
||||
(let ((f1-9 v1-47)
|
||||
(f2-0 614.4)
|
||||
)
|
||||
(< f1-9 (* f0-13 (* f2-0 f2-0)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(logclear! (-> self v-flags) (vehicle-flag disturbed))
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (not (vehicle-method-102 self))
|
||||
(disable-physics! self)
|
||||
(let ((gp-2 (-> self rbody)))
|
||||
(logclear! (-> gp-2 flags) (rigid-body-flag enable-physics active))
|
||||
(vehicle-method-142 self)
|
||||
(set! (-> gp-2 force quad) (the-as uint128 0))
|
||||
(set! (-> gp-2 torque quad) (the-as uint128 0))
|
||||
)
|
||||
0
|
||||
(logior! (-> self v-flags) (vehicle-flag nav-spheres))
|
||||
(vehicle-method-140 self)
|
||||
(logclear! (-> self v-flags) (vehicle-flag disturbed))
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(rigid-body-object-method-30 self)
|
||||
)
|
||||
(when (not (vehicle-method-102 self))
|
||||
(disable-physics! self)
|
||||
(let ((gp-2 (-> self rbody)))
|
||||
(logclear! (-> gp-2 flags) (rigid-body-flag enable-physics active))
|
||||
(vehicle-method-142 self)
|
||||
(set! (-> gp-2 force quad) (the-as uint128 0))
|
||||
(set! (-> gp-2 torque quad) (the-as uint128 0))
|
||||
)
|
||||
0
|
||||
(logior! (-> self v-flags) (vehicle-flag nav-spheres))
|
||||
(vehicle-method-140 self)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(rigid-body-object-method-30 self)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defstate explode (vehicle)
|
||||
|
||||
@@ -1122,48 +1122,25 @@
|
||||
)
|
||||
|
||||
(defmethod vehicle-method-103 ((this vehicle))
|
||||
(local-vars (v1-8 float) (v1-13 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(when (time-elapsed? (-> this disturbed-time) (seconds 2))
|
||||
(let* ((f0-0 (-> this camera-dist2))
|
||||
(f1-0 0.000024414063)
|
||||
(f0-1 (* f0-0 (* f1-0 f1-0)))
|
||||
)
|
||||
(.lvf vf1 (&-> (-> this rbody ang-velocity) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-8 vf1)
|
||||
(when (and (< v1-8 f0-1) (begin
|
||||
(.lvf vf1 (&-> (-> this rbody lin-velocity) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-13 vf1)
|
||||
(let ((f1-4 v1-13)
|
||||
(f2-0 614.4)
|
||||
)
|
||||
(< f1-4 (* f0-1 (* f2-0 f2-0)))
|
||||
)
|
||||
)
|
||||
(when (time-elapsed? (-> this disturbed-time) (seconds 2))
|
||||
(let* ((f0-0 (-> this camera-dist2))
|
||||
(f1-0 0.000024414063)
|
||||
(f0-1 (* f0-0 (* f1-0 f1-0)))
|
||||
)
|
||||
(when (and (< (vector-length-squared (-> this rbody ang-velocity)) f0-1)
|
||||
(let ((f1-4 (vector-length-squared (-> this rbody lin-velocity)))
|
||||
(f2-0 614.4)
|
||||
)
|
||||
(< f1-4 (* f0-1 (* f2-0 f2-0)))
|
||||
)
|
||||
(logclear! (-> this v-flags) (vehicle-flag disturbed))
|
||||
(vehicle-method-142 this)
|
||||
)
|
||||
)
|
||||
(logclear! (-> this v-flags) (vehicle-flag disturbed))
|
||||
(vehicle-method-142 this)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod vehicle-method-79 ((this vehicle))
|
||||
|
||||
@@ -39,137 +39,122 @@
|
||||
)
|
||||
|
||||
(defmethod on-impact ((this vehicle) (arg0 rigid-body-impact))
|
||||
(local-vars (v1-79 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
(logior! (-> this v-flags) (vehicle-flag impact))
|
||||
(vector-copy! (-> this impact-pos) (-> arg0 point))
|
||||
(let ((s4-0 (new 'stack-no-clear 'matrix)))
|
||||
(matrix-inverse-of-rot-trans! (the-as matrix (-> s4-0 rvec)) (-> this rbody matrix))
|
||||
(vector-matrix*! (-> this impact-local-pos) (-> this impact-pos) (the-as matrix (-> s4-0 rvec)))
|
||||
)
|
||||
(set! (-> this prev-impact-time) (-> this impact-time))
|
||||
(set! (-> this impact-time) (the-as uint (current-time)))
|
||||
(set! (-> this impact-pat) (the-as uint (-> arg0 pat)))
|
||||
(set! (-> this impact-proc) (the-as handle #f))
|
||||
(let ((a0-5 (-> arg0 process)))
|
||||
(if a0-5
|
||||
(set! (-> this impact-proc) (process->handle a0-5))
|
||||
)
|
||||
)
|
||||
(let ((s4-1 (-> this info))
|
||||
(f0-0 1.0)
|
||||
)
|
||||
(let ((v1-14 (-> arg0 prim-id)))
|
||||
(if (logtest? v1-14 512)
|
||||
(set! f0-0 (* 1.5 f0-0))
|
||||
)
|
||||
(if (logtest? v1-14 1024)
|
||||
(set! f0-0 (* 2.0 f0-0))
|
||||
)
|
||||
(if (logtest? v1-14 2048)
|
||||
(set! f0-0 (* 4.0 f0-0))
|
||||
)
|
||||
(if (logtest? v1-14 256)
|
||||
(set! f0-0 (/ 1.0 f0-0))
|
||||
)
|
||||
)
|
||||
(let ((f30-0 (* (-> arg0 impulse) f0-0 (-> s4-1 info inv-mass) (-> s4-1 damage inv-toughness-factor))))
|
||||
(set! (-> this crash-impulse) (-> arg0 impulse))
|
||||
(cond
|
||||
((< f30-0 (-> s4-1 damage hit-threshold))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(logior! (-> this v-flags) (vehicle-flag impact))
|
||||
(vector-copy! (-> this impact-pos) (-> arg0 point))
|
||||
(let ((s4-0 (new 'stack-no-clear 'matrix)))
|
||||
(matrix-inverse-of-rot-trans! (the-as matrix (-> s4-0 rvec)) (-> this rbody matrix))
|
||||
(vector-matrix*! (-> this impact-local-pos) (-> this impact-pos) (the-as matrix (-> s4-0 rvec)))
|
||||
)
|
||||
(set! (-> this prev-impact-time) (-> this impact-time))
|
||||
(set! (-> this impact-time) (the-as uint (current-time)))
|
||||
(set! (-> this impact-pat) (the-as uint (-> arg0 pat)))
|
||||
(set! (-> this impact-proc) (the-as handle #f))
|
||||
(let ((a0-5 (-> arg0 process)))
|
||||
(if a0-5
|
||||
(set! (-> this impact-proc) (process->handle a0-5))
|
||||
((>= f30-0 (-> s4-1 damage hit-deadly))
|
||||
(when (logtest? (vehicle-flag player-driving) (-> this v-flags))
|
||||
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 1))
|
||||
0
|
||||
)
|
||||
(apply-damage this (* 2.0 (-> s4-1 damage hit-points)) arg0)
|
||||
(vehicle-method-74 this 2 (seconds 1))
|
||||
)
|
||||
((>= f30-0 (-> s4-1 damage hit-big))
|
||||
(when (logtest? (vehicle-flag player-driving) (-> this v-flags))
|
||||
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5))
|
||||
0
|
||||
)
|
||||
(apply-damage this (* 10.0 (-> s4-1 damage impact-damage-factor)) arg0)
|
||||
(vehicle-method-74 this 1 (seconds 0.25))
|
||||
)
|
||||
((>= f30-0 (-> s4-1 damage hit-small))
|
||||
(when (logtest? (vehicle-flag player-driving) (-> this v-flags))
|
||||
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.25))
|
||||
0
|
||||
)
|
||||
(apply-damage this (* 5.0 (-> s4-1 damage impact-damage-factor)) arg0)
|
||||
(vehicle-method-74 this 1 (seconds 0.25))
|
||||
)
|
||||
(else
|
||||
(let* ((f0-14 0.0)
|
||||
(f1-10 40.0)
|
||||
(f2-0 16384000.0)
|
||||
(f0-15 (fmax f0-14 (* f1-10 (/ 1.0 f2-0) (- f30-0 (-> s4-1 damage hit-threshold)))))
|
||||
)
|
||||
(apply-damage this (* f0-15 (-> s4-1 damage impact-damage-factor)) arg0)
|
||||
)
|
||||
(when (< 32768.0 f30-0)
|
||||
(if (logtest? (vehicle-flag player-driving) (-> this v-flags))
|
||||
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s4-1 (-> this info))
|
||||
(f0-0 1.0)
|
||||
)
|
||||
(let ((v1-14 (-> arg0 prim-id)))
|
||||
(if (logtest? v1-14 512)
|
||||
(set! f0-0 (* 1.5 f0-0))
|
||||
)
|
||||
(if (logtest? v1-14 1024)
|
||||
(set! f0-0 (* 2.0 f0-0))
|
||||
)
|
||||
(if (logtest? v1-14 2048)
|
||||
(set! f0-0 (* 4.0 f0-0))
|
||||
)
|
||||
(if (logtest? v1-14 256)
|
||||
(set! f0-0 (/ 1.0 f0-0))
|
||||
)
|
||||
)
|
||||
(let ((f30-0 (* (-> arg0 impulse) f0-0 (-> s4-1 info inv-mass) (-> s4-1 damage inv-toughness-factor))))
|
||||
(set! (-> this crash-impulse) (-> arg0 impulse))
|
||||
(let* ((f0-18 1.0)
|
||||
(f1-14 61440.0)
|
||||
(f28-0 (fmin f0-18 (* f30-0 (/ 1.0 f1-14))))
|
||||
)
|
||||
(cond
|
||||
((< f30-0 (-> s4-1 damage hit-threshold))
|
||||
)
|
||||
((>= f30-0 (-> s4-1 damage hit-deadly))
|
||||
(when (logtest? (vehicle-flag player-driving) (-> this v-flags))
|
||||
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 1))
|
||||
0
|
||||
)
|
||||
(apply-damage this (* 2.0 (-> s4-1 damage hit-points)) arg0)
|
||||
(vehicle-method-74 this 2 (seconds 1))
|
||||
)
|
||||
((>= f30-0 (-> s4-1 damage hit-big))
|
||||
(when (logtest? (vehicle-flag player-driving) (-> this v-flags))
|
||||
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5))
|
||||
0
|
||||
)
|
||||
(apply-damage this (* 10.0 (-> s4-1 damage impact-damage-factor)) arg0)
|
||||
(vehicle-method-74 this 1 (seconds 0.25))
|
||||
)
|
||||
((>= f30-0 (-> s4-1 damage hit-small))
|
||||
(when (logtest? (vehicle-flag player-driving) (-> this v-flags))
|
||||
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.25))
|
||||
(sound-play-by-name
|
||||
(-> this info sound impact-sound)
|
||||
(new-sound-id)
|
||||
(the int (* 1024.0 f28-0))
|
||||
0
|
||||
0
|
||||
(sound-group)
|
||||
#t
|
||||
)
|
||||
(apply-damage this (* 5.0 (-> s4-1 damage impact-damage-factor)) arg0)
|
||||
(vehicle-method-74 this 1 (seconds 0.25))
|
||||
(logclear! (-> this v-flags) (vehicle-flag turbo-boost))
|
||||
)
|
||||
(else
|
||||
(let* ((f0-14 0.0)
|
||||
(f1-10 40.0)
|
||||
(f2-0 16384000.0)
|
||||
(f0-15 (fmax f0-14 (* f1-10 (/ 1.0 f2-0) (- f30-0 (-> s4-1 damage hit-threshold)))))
|
||||
)
|
||||
(apply-damage this (* f0-15 (-> s4-1 damage impact-damage-factor)) arg0)
|
||||
)
|
||||
(when (< 32768.0 f30-0)
|
||||
(if (logtest? (vehicle-flag player-driving) (-> this v-flags))
|
||||
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let* ((f0-18 1.0)
|
||||
(f1-14 61440.0)
|
||||
(f28-0 (fmin f0-18 (* f30-0 (/ 1.0 f1-14))))
|
||||
)
|
||||
(cond
|
||||
((>= f30-0 (-> s4-1 damage hit-small))
|
||||
(sound-play-by-name
|
||||
(-> this info sound impact-sound)
|
||||
(new-sound-id)
|
||||
(the int (* 1024.0 f28-0))
|
||||
0
|
||||
0
|
||||
(sound-group)
|
||||
#t
|
||||
)
|
||||
(logclear! (-> this v-flags) (vehicle-flag turbo-boost))
|
||||
((< 0.1 f28-0)
|
||||
(sound-play-by-name
|
||||
(-> this info sound glance-sound)
|
||||
(new-sound-id)
|
||||
(the int (* 1024.0 f28-0))
|
||||
0
|
||||
0
|
||||
(sound-group)
|
||||
#t
|
||||
)
|
||||
((< 0.1 f28-0)
|
||||
(sound-play-by-name
|
||||
(-> this info sound glance-sound)
|
||||
(new-sound-id)
|
||||
(the int (* 1024.0 f28-0))
|
||||
0
|
||||
0
|
||||
(sound-group)
|
||||
#t
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-39 (new 'stack-no-clear 'vector)))
|
||||
(vector+float*!
|
||||
a0-39
|
||||
(-> arg0 velocity)
|
||||
(-> arg0 normal)
|
||||
(- (vector-dot (-> arg0 velocity) (-> arg0 normal)))
|
||||
)
|
||||
(.lvf vf1 (&-> a0-39 quad))
|
||||
)
|
||||
(let ((a0-39 (new 'stack-no-clear 'vector)))
|
||||
(vector+float*!
|
||||
a0-39
|
||||
(-> arg0 velocity)
|
||||
(-> arg0 normal)
|
||||
(- (vector-dot (-> arg0 velocity) (-> arg0 normal)))
|
||||
)
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-79 vf1)
|
||||
(let ((f0-30 v1-79)
|
||||
(let ((f0-30 (vector-length-squared a0-39))
|
||||
(f1-18 12288.0)
|
||||
)
|
||||
(when (< (* f1-18 f1-18) f0-30)
|
||||
@@ -179,12 +164,12 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (>= 0.0 (-> this hit-points))
|
||||
(vehicle-method-74 this 2 (seconds 1))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
(if (>= 0.0 (-> this hit-points))
|
||||
(vehicle-method-74 this 2 (seconds 1))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod vehicle-method-92 ((this vehicle) (arg0 vehicle-controls))
|
||||
|
||||
@@ -77,151 +77,112 @@
|
||||
:virtual #t
|
||||
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
||||
(local-vars (v0-0 object))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(case message
|
||||
(('on)
|
||||
(let ((v1-2 (-> self root root-prim)))
|
||||
(set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as))
|
||||
(set! v0-0 (-> self root backup-collide-with))
|
||||
(set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0))
|
||||
)
|
||||
v0-0
|
||||
(case message
|
||||
(('on)
|
||||
(let ((v1-2 (-> self root root-prim)))
|
||||
(set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as))
|
||||
(set! v0-0 (-> self root backup-collide-with))
|
||||
(set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0))
|
||||
)
|
||||
(('off)
|
||||
(let ((v1-4 (-> self root root-prim)))
|
||||
(set! (-> v1-4 prim-core collide-as) (collide-spec))
|
||||
(set! (-> v1-4 prim-core collide-with) (collide-spec))
|
||||
)
|
||||
0
|
||||
v0-0
|
||||
)
|
||||
(('off)
|
||||
(let ((v1-4 (-> self root root-prim)))
|
||||
(set! (-> v1-4 prim-core collide-as) (collide-spec))
|
||||
(set! (-> v1-4 prim-core collide-with) (collide-spec))
|
||||
)
|
||||
(('attack)
|
||||
(let ((v1-5 (the-as attack-info (-> block param 1))))
|
||||
(when (!= (-> v1-5 id) (-> self incoming-attack-id))
|
||||
(set! (-> self incoming-attack-id) (-> v1-5 id))
|
||||
(let ((s4-0 (as-type proc process-drawable)))
|
||||
(when s4-0
|
||||
(let ((gp-1 (process-spawn
|
||||
manipy
|
||||
:init manipy-init
|
||||
(-> (the-as process-drawable s4-0) root trans)
|
||||
(-> self entity)
|
||||
(art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer level) #f))
|
||||
#f
|
||||
0
|
||||
:name "manipy"
|
||||
:to self
|
||||
:stack-size #x20000
|
||||
)
|
||||
0
|
||||
)
|
||||
(('attack)
|
||||
(let ((v1-5 (the-as attack-info (-> block param 1))))
|
||||
(when (!= (-> v1-5 id) (-> self incoming-attack-id))
|
||||
(set! (-> self incoming-attack-id) (-> v1-5 id))
|
||||
(let ((s4-0 (as-type proc process-drawable)))
|
||||
(when s4-0
|
||||
(let ((gp-1 (process-spawn
|
||||
manipy
|
||||
:init manipy-init
|
||||
(-> (the-as process-drawable s4-0) root trans)
|
||||
(-> self entity)
|
||||
(art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer level) #f))
|
||||
#f
|
||||
0
|
||||
:name "manipy"
|
||||
:to self
|
||||
:stack-size #x20000
|
||||
)
|
||||
)
|
||||
(when gp-1
|
||||
(send-event (ppointer->process gp-1) 'anim-mode 'play1)
|
||||
(send-event (ppointer->process gp-1) 'speed 1.5)
|
||||
(send-event (ppointer->process gp-1) 'art-joint-anim "generic-ripples-idle" 0)
|
||||
(set-vector! (-> (the-as process-drawable (-> gp-1 0)) root scale) 1.0 1.0 1.0 1.0)
|
||||
(quaternion-rotate-local-x! (-> (the-as process-drawable (-> gp-1 0)) root quat) (-> self root quat) -16384.0)
|
||||
(let ((v1-43 (-> (the-as process-drawable (-> gp-1 0)) root trans)))
|
||||
(let ((a0-22 (-> (the-as process-drawable (-> gp-1 0)) root trans)))
|
||||
(let ((a1-17 *up-vector*))
|
||||
(let ((a2-8 8192.0))
|
||||
(.mov vf7 a2-8)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-17 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-22 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-43 quad) vf6)
|
||||
)
|
||||
(let ((f0-6 (vector4-dot (-> (the-as process-drawable (-> gp-1 0)) root trans) (the-as vector (-> self plane)))))
|
||||
(let ((v1-50 (-> (the-as process-drawable (-> gp-1 0)) root trans)))
|
||||
(let ((a0-26 (-> (the-as process-drawable (-> gp-1 0)) root trans)))
|
||||
(let ((a1-18 (-> self plane)))
|
||||
(let ((a2-9 (- f0-6)))
|
||||
(.mov vf7 a2-9)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-18 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-26 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-50 quad) vf6)
|
||||
)
|
||||
(let ((v1-53 (-> (the-as process-drawable (-> gp-1 0)) root trans)))
|
||||
(let ((a0-29 (-> (the-as process-drawable (-> gp-1 0)) root trans)))
|
||||
(let ((a1-19 (-> self plane)))
|
||||
(let ((a2-11 (the-as float (if (< 0.0 f0-6)
|
||||
-2048.0
|
||||
2048.0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(.mov vf7 a2-11)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-19 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-29 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-53 quad) vf6)
|
||||
)
|
||||
)
|
||||
(send-event (ppointer->process gp-1) 'trans-hook (lambda () #f))
|
||||
)
|
||||
(when gp-1
|
||||
(send-event (ppointer->process gp-1) 'anim-mode 'play1)
|
||||
(send-event (ppointer->process gp-1) 'speed 1.5)
|
||||
(send-event (ppointer->process gp-1) 'art-joint-anim "generic-ripples-idle" 0)
|
||||
(set-vector! (-> (the-as process-drawable (-> gp-1 0)) root scale) 1.0 1.0 1.0 1.0)
|
||||
(quaternion-rotate-local-x! (-> (the-as process-drawable (-> gp-1 0)) root quat) (-> self root quat) -16384.0)
|
||||
(vector+*!
|
||||
(-> (the-as process-drawable (-> gp-1 0)) root trans)
|
||||
(-> (the-as process-drawable (-> gp-1 0)) root trans)
|
||||
*up-vector*
|
||||
8192.0
|
||||
)
|
||||
(let ((f0-6 (vector4-dot (-> (the-as process-drawable (-> gp-1 0)) root trans) (the-as vector (-> self plane)))))
|
||||
(vector+*!
|
||||
(-> (the-as process-drawable (-> gp-1 0)) root trans)
|
||||
(-> (the-as process-drawable (-> gp-1 0)) root trans)
|
||||
(the-as vector (-> self plane))
|
||||
(- f0-6)
|
||||
)
|
||||
(vector+*!
|
||||
(-> (the-as process-drawable (-> gp-1 0)) root trans)
|
||||
(-> (the-as process-drawable (-> gp-1 0)) root trans)
|
||||
(the-as vector (-> self plane))
|
||||
(if (< 0.0 f0-6)
|
||||
-2048.0
|
||||
2048.0
|
||||
)
|
||||
)
|
||||
)
|
||||
(send-event (ppointer->process gp-1) 'trans-hook (lambda () #f))
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (zero? (-> self touch-count))
|
||||
(+! (-> self touch-count) 1)
|
||||
(set! (-> self flash) 0.375)
|
||||
)
|
||||
(set! v0-0 (+ (-> self touch-count) 1))
|
||||
(set! (-> self touch-count) (the-as int v0-0))
|
||||
v0-0
|
||||
)
|
||||
(when (zero? (-> self touch-count))
|
||||
(+! (-> self touch-count) 1)
|
||||
(set! (-> self flash) 0.375)
|
||||
)
|
||||
(set! v0-0 (+ (-> self touch-count) 1))
|
||||
(set! (-> self touch-count) (the-as int v0-0))
|
||||
v0-0
|
||||
)
|
||||
)
|
||||
(('touched)
|
||||
(when (zero? (-> self touch-count))
|
||||
(+! (-> self touch-count) 1)
|
||||
(set! (-> self flash) 0.375)
|
||||
)
|
||||
)
|
||||
(('touched)
|
||||
(when (zero? (-> self touch-count))
|
||||
(+! (-> self touch-count) 1)
|
||||
(let ((v1-75 (as-type proc process-focusable)))
|
||||
(when v1-75
|
||||
(let ((gp-4 (as-type (-> (the-as process-drawable v1-75) root) collide-shape)))
|
||||
(when gp-4
|
||||
(if (logtest? (-> (the-as collide-shape gp-4) root-prim prim-core collide-as) (collide-spec jak))
|
||||
(on-jak-touch self)
|
||||
)
|
||||
(when (logtest? (-> (the-as collide-shape gp-4) root-prim prim-core collide-as) (collide-spec vehicle-sphere))
|
||||
(when (not (-> self breach))
|
||||
(sound-play "barrier-cross")
|
||||
(set! v0-0 #t)
|
||||
(set! (-> self breach) (the-as symbol v0-0))
|
||||
v0-0
|
||||
)
|
||||
(set! (-> self flash) 0.375)
|
||||
)
|
||||
(+! (-> self touch-count) 1)
|
||||
(let ((v1-78 (as-type proc process-focusable)))
|
||||
(when v1-78
|
||||
(let ((gp-4 (as-type (-> (the-as process-drawable v1-78) root) collide-shape)))
|
||||
(when gp-4
|
||||
(if (logtest? (-> (the-as collide-shape gp-4) root-prim prim-core collide-as) (collide-spec jak))
|
||||
(on-jak-touch self)
|
||||
)
|
||||
(when (logtest? (-> (the-as collide-shape gp-4) root-prim prim-core collide-as) (collide-spec vehicle-sphere))
|
||||
(when (not (-> self breach))
|
||||
(sound-play "barrier-cross")
|
||||
(set! v0-0 #t)
|
||||
(set! (-> self breach) (the-as symbol v0-0))
|
||||
v0-0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
:trans (behavior ()
|
||||
|
||||
@@ -46,59 +46,37 @@
|
||||
)
|
||||
|
||||
(defmethod projectile-method-25 ((this comb-sentry-shot))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let* ((gp-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0))
|
||||
(f30-0 (vector-length s5-1))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((gp-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0))
|
||||
(f30-0 (vector-length s5-1))
|
||||
)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-4 a1-0))
|
||||
(let ((a0-2 s5-1))
|
||||
(let ((a2-1 0.8))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-2 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s4-0 quad) vf6)
|
||||
(let ((f28-0 (-> *part-id-table* 4236 init-specs 4 initial-valuef)))
|
||||
(set! (-> *part-id-table* 4236 init-specs 4 initial-valuef) (vector-length s5-1))
|
||||
(draw-beam (-> *part-id-table* 4236) a1-0 s5-1 #f)
|
||||
(set! (-> *part-id-table* 4236 init-specs 4 initial-valuef) f28-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 4237) s4-0)
|
||||
(launch-particles (-> *part-id-table* 4238) s4-0)
|
||||
)
|
||||
(let ((s4-1 (new 'stack-no-clear 'matrix))
|
||||
(f26-0 (/ f30-0 (meters 9)))
|
||||
(f30-1 (-> *part-id-table* 4239 init-specs 3 initial-valuef))
|
||||
(f28-1 (-> *part-id-table* 4239 init-specs 4 initial-valuef))
|
||||
)
|
||||
(forward-up->inv-matrix s4-1 s5-1 *up-vector*)
|
||||
(vector-copy! (-> s4-1 trans) gp-0)
|
||||
(set! (-> *part-id-table* 4239 init-specs 3 initial-valuef) (* f26-0 f30-1))
|
||||
(set! (-> *part-id-table* 4239 init-specs 4 initial-valuef) (* f26-0 f28-1))
|
||||
(launch-particles (-> *part-id-table* 4239) s4-1 :origin-is-matrix #t)
|
||||
(set! (-> *part-id-table* 4239 init-specs 3 initial-valuef) f30-1)
|
||||
(set! (-> *part-id-table* 4239 init-specs 4 initial-valuef) f28-1)
|
||||
(let ((s4-1 (vector+*! (new 'stack-no-clear 'vector) a1-0 s5-1 0.8)))
|
||||
(let ((f28-0 (-> *part-id-table* 4236 init-specs 4 initial-valuef)))
|
||||
(set! (-> *part-id-table* 4236 init-specs 4 initial-valuef) (vector-length s5-1))
|
||||
(draw-beam (-> *part-id-table* 4236) a1-0 s5-1 #f)
|
||||
(set! (-> *part-id-table* 4236 init-specs 4 initial-valuef) f28-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 4237) s4-1)
|
||||
(launch-particles (-> *part-id-table* 4238) s4-1)
|
||||
)
|
||||
(let ((s4-2 (new 'stack-no-clear 'matrix))
|
||||
(f26-0 (/ f30-0 (meters 9)))
|
||||
(f30-1 (-> *part-id-table* 4239 init-specs 3 initial-valuef))
|
||||
(f28-1 (-> *part-id-table* 4239 init-specs 4 initial-valuef))
|
||||
)
|
||||
(forward-up->inv-matrix s4-2 s5-1 *up-vector*)
|
||||
(vector-copy! (-> s4-2 trans) gp-0)
|
||||
(set! (-> *part-id-table* 4239 init-specs 3 initial-valuef) (* f26-0 f30-1))
|
||||
(set! (-> *part-id-table* 4239 init-specs 4 initial-valuef) (* f26-0 f28-1))
|
||||
(launch-particles (-> *part-id-table* 4239) s4-2 :origin-is-matrix #t)
|
||||
(set! (-> *part-id-table* 4239 init-specs 3 initial-valuef) f30-1)
|
||||
(set! (-> *part-id-table* 4239 init-specs 4 initial-valuef) f28-1)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod projectile-method-26 ((this comb-sentry-shot))
|
||||
@@ -440,123 +418,107 @@
|
||||
)
|
||||
|
||||
(defmethod sentry-post ((this comb-sentry))
|
||||
(local-vars (v1-25 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(if (and (= (-> this player-vehicle) #f) *target* (focus-test? *target* pilot-riding))
|
||||
(set! (-> this player-vehicle) (-> *target* pilot vehicle))
|
||||
)
|
||||
(set! (-> this should-attack) #f)
|
||||
(let ((s5-0 (the-as process-focusable (handle->process (-> this player-vehicle)))))
|
||||
(when s5-0
|
||||
(if (and (not (focus-test? s5-0 dead))
|
||||
(not (focus-test? s5-0 ignore))
|
||||
(let ((f0-0 (vector-vector-distance-squared (-> s5-0 root trans) (-> this root trans)))
|
||||
(f1-0 409600.0)
|
||||
)
|
||||
(< f0-0 (* f1-0 f1-0))
|
||||
)
|
||||
(if (and (= (-> this player-vehicle) #f) *target* (focus-test? *target* pilot-riding))
|
||||
(set! (-> this player-vehicle) (-> *target* pilot vehicle))
|
||||
)
|
||||
(set! (-> this should-attack) #f)
|
||||
(let ((s5-0 (the-as process-focusable (handle->process (-> this player-vehicle)))))
|
||||
(when s5-0
|
||||
(if (and (not (focus-test? s5-0 dead))
|
||||
(not (focus-test? s5-0 ignore))
|
||||
(let ((f0-0 (vector-vector-distance-squared (-> s5-0 root trans) (-> this root trans)))
|
||||
(f1-0 409600.0)
|
||||
)
|
||||
(< f0-0 (* f1-0 f1-0))
|
||||
)
|
||||
(set! (-> this should-attack) #t)
|
||||
)
|
||||
(let ((v1-23 (new 'stack-no-clear 'matrix)))
|
||||
(vector-copy! (-> v1-23 rvec) (-> s5-0 root trans))
|
||||
(vector-copy! (-> v1-23 uvec) (-> s5-0 root transv))
|
||||
(vector+float*! (-> this target-pos) (-> v1-23 rvec) (-> v1-23 uvec) 0.1)
|
||||
(vector-copy! (-> v1-23 fvec) (-> s5-0 node-list data 0 bone transform fvec))
|
||||
(vector-! (-> v1-23 trans) (-> this root trans) (-> v1-23 rvec))
|
||||
(set! (-> this target-dist) (vector-dot (-> v1-23 fvec) (-> v1-23 trans)))
|
||||
(let* ((v1-24 (-> v1-23 trans))
|
||||
(f0-4 409600.0)
|
||||
(f0-6 (* f0-4 f0-4))
|
||||
)
|
||||
(.lvf vf1 (&-> v1-24 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-25 vf1)
|
||||
(if (< f0-6 v1-25)
|
||||
(set! (-> this target-dist) 4096000.0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> this should-attack) #t)
|
||||
)
|
||||
(let ((v1-23 (new 'stack-no-clear 'matrix)))
|
||||
(vector-copy! (-> v1-23 rvec) (-> s5-0 root trans))
|
||||
(vector-copy! (-> v1-23 uvec) (-> s5-0 root transv))
|
||||
(vector+float*! (-> this target-pos) (-> v1-23 rvec) (-> v1-23 uvec) 0.1)
|
||||
(vector-copy! (-> v1-23 fvec) (-> s5-0 node-list data 0 bone transform fvec))
|
||||
(vector-! (-> v1-23 trans) (-> this root trans) (-> v1-23 rvec))
|
||||
(set! (-> this target-dist) (vector-dot (-> v1-23 fvec) (-> v1-23 trans)))
|
||||
(let ((v1-24 (-> v1-23 trans))
|
||||
(f0-4 409600.0)
|
||||
)
|
||||
(if (< (* f0-4 f0-4) (vector-length-squared v1-24))
|
||||
(set! (-> this target-dist) 4096000.0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (not (-> this should-attack))
|
||||
(set-time! (-> this in-range-time))
|
||||
)
|
||||
(set! (-> this path-dt) (* 0.00024414062 (- 163840.0 (-> this target-dist))))
|
||||
(set! (-> this path-dt) (fmax -8.0 (fmin 8.0 (-> this path-dt))))
|
||||
(+! (-> this path-t) (* (-> this path-dt) (seconds-per-frame)))
|
||||
(set! (-> this path-t) (fmax 0.0 (fmin (-> this path-t) (get-num-segments (-> this path)))))
|
||||
(if (= (-> this path-t) (get-num-segments (-> this path)))
|
||||
(go-explode this)
|
||||
)
|
||||
(get-point-in-path! (-> this path) (-> this root trans) (-> this path-t) 'interp)
|
||||
(let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 5)))
|
||||
(vector-! (-> s5-1 0) (-> this target-pos) (-> this root trans))
|
||||
(vector-normalize! (-> s5-1 0) 1.0)
|
||||
(vector-copy! (-> s5-1 1) (-> this up-dir))
|
||||
(set! (-> s5-1 4 x) (vector-dot (-> s5-1 0) (-> s5-1 1)))
|
||||
(vector+float*! (-> s5-1 1) (-> s5-1 1) (-> s5-1 0) (- (-> s5-1 4 x)))
|
||||
(vector-normalize! (-> s5-1 1) 1.0)
|
||||
(vector-copy! (-> this up-dir) (-> s5-1 1))
|
||||
(forward-up-nopitch->quaternion (the-as quaternion (-> s5-1 2)) (-> s5-1 0) (-> s5-1 1))
|
||||
(+! (-> this angle) (* (-> this spin) (seconds-per-frame)))
|
||||
(set! (-> this angle) (the float (sar (shl (the int (-> this angle)) 48) 48)))
|
||||
(quaternion-axis-angle! (the-as quaternion (-> s5-1 3)) 0.0 0.0 1.0 (-> this angle))
|
||||
(quaternion*! (the-as quaternion (-> s5-1 2)) (the-as quaternion (-> s5-1 2)) (the-as quaternion (-> s5-1 3)))
|
||||
(quaternion-copy! (-> this root quat) (the-as quaternion (-> s5-1 2)))
|
||||
)
|
||||
(cond
|
||||
((-> this shooting)
|
||||
(seek! (-> this spin) 131072.0 (* 262144.0 (seconds-per-frame)))
|
||||
(when (time-elapsed? (-> this shot-time) (seconds 0.2))
|
||||
(set-time! (-> this shot-time))
|
||||
(fire-shot this)
|
||||
)
|
||||
(when (or (time-elapsed? (-> this attack-time) (seconds 1)) (not (-> this should-attack)))
|
||||
(set-time! (-> this attack-time))
|
||||
(set! (-> this shooting) #f)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(seek! (-> this spin) 32768.0 (* 65536.0 (seconds-per-frame)))
|
||||
(when (and (time-elapsed? (-> this attack-time) (seconds 3))
|
||||
(time-elapsed? (-> this in-range-time) (seconds 4))
|
||||
(-> this should-attack)
|
||||
)
|
||||
(set-time! (-> this attack-time))
|
||||
(set! (-> this shooting) #t)
|
||||
)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((-> this should-attack)
|
||||
(if (zero? (-> this hum-id))
|
||||
(set! (-> this hum-id) (new-sound-id))
|
||||
)
|
||||
(sound-play "sentry-engine" :id (-> this hum-id))
|
||||
)
|
||||
(else
|
||||
(when (nonzero? (-> this hum-id))
|
||||
(sound-stop (-> this hum-id))
|
||||
(set! (-> this hum-id) (new 'static 'sound-id))
|
||||
0
|
||||
)
|
||||
)
|
||||
)
|
||||
(transform-post)
|
||||
(draw-glow-sprites this)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
(if (not (-> this should-attack))
|
||||
(set-time! (-> this in-range-time))
|
||||
)
|
||||
(set! (-> this path-dt) (* 0.00024414062 (- 163840.0 (-> this target-dist))))
|
||||
(set! (-> this path-dt) (fmax -8.0 (fmin 8.0 (-> this path-dt))))
|
||||
(+! (-> this path-t) (* (-> this path-dt) (seconds-per-frame)))
|
||||
(set! (-> this path-t) (fmax 0.0 (fmin (-> this path-t) (get-num-segments (-> this path)))))
|
||||
(if (= (-> this path-t) (get-num-segments (-> this path)))
|
||||
(go-explode this)
|
||||
)
|
||||
(get-point-in-path! (-> this path) (-> this root trans) (-> this path-t) 'interp)
|
||||
(let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 5)))
|
||||
(vector-! (-> s5-1 0) (-> this target-pos) (-> this root trans))
|
||||
(vector-normalize! (-> s5-1 0) 1.0)
|
||||
(vector-copy! (-> s5-1 1) (-> this up-dir))
|
||||
(set! (-> s5-1 4 x) (vector-dot (-> s5-1 0) (-> s5-1 1)))
|
||||
(vector+float*! (-> s5-1 1) (-> s5-1 1) (-> s5-1 0) (- (-> s5-1 4 x)))
|
||||
(vector-normalize! (-> s5-1 1) 1.0)
|
||||
(vector-copy! (-> this up-dir) (-> s5-1 1))
|
||||
(forward-up-nopitch->quaternion (the-as quaternion (-> s5-1 2)) (-> s5-1 0) (-> s5-1 1))
|
||||
(+! (-> this angle) (* (-> this spin) (seconds-per-frame)))
|
||||
(set! (-> this angle) (the float (sar (shl (the int (-> this angle)) 48) 48)))
|
||||
(quaternion-axis-angle! (the-as quaternion (-> s5-1 3)) 0.0 0.0 1.0 (-> this angle))
|
||||
(quaternion*! (the-as quaternion (-> s5-1 2)) (the-as quaternion (-> s5-1 2)) (the-as quaternion (-> s5-1 3)))
|
||||
(quaternion-copy! (-> this root quat) (the-as quaternion (-> s5-1 2)))
|
||||
)
|
||||
(cond
|
||||
((-> this shooting)
|
||||
(seek! (-> this spin) 131072.0 (* 262144.0 (seconds-per-frame)))
|
||||
(when (time-elapsed? (-> this shot-time) (seconds 0.2))
|
||||
(set-time! (-> this shot-time))
|
||||
(fire-shot this)
|
||||
)
|
||||
(when (or (time-elapsed? (-> this attack-time) (seconds 1)) (not (-> this should-attack)))
|
||||
(set-time! (-> this attack-time))
|
||||
(set! (-> this shooting) #f)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(seek! (-> this spin) 32768.0 (* 65536.0 (seconds-per-frame)))
|
||||
(when (and (time-elapsed? (-> this attack-time) (seconds 3))
|
||||
(time-elapsed? (-> this in-range-time) (seconds 4))
|
||||
(-> this should-attack)
|
||||
)
|
||||
(set-time! (-> this attack-time))
|
||||
(set! (-> this shooting) #t)
|
||||
)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((-> this should-attack)
|
||||
(if (zero? (-> this hum-id))
|
||||
(set! (-> this hum-id) (new-sound-id))
|
||||
)
|
||||
(sound-play "sentry-engine" :id (-> this hum-id))
|
||||
)
|
||||
(else
|
||||
(when (nonzero? (-> this hum-id))
|
||||
(sound-stop (-> this hum-id))
|
||||
(set! (-> this hum-id) (new 'static 'sound-id))
|
||||
0
|
||||
)
|
||||
)
|
||||
)
|
||||
(transform-post)
|
||||
(draw-glow-sprites this)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod go-explode ((this comb-sentry))
|
||||
|
||||
+269
-364
@@ -120,55 +120,40 @@
|
||||
)
|
||||
|
||||
(defun sled-find-mesh-dir ((arg0 vector) (arg1 vector) (arg2 collide-tri-result))
|
||||
(local-vars (a0-8 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s4-0 (new 'stack-no-clear 'h-sled-stack-var0)))
|
||||
(vector-! (-> s4-0 vec 0) (-> arg2 vertex 2) (-> arg2 vertex 1))
|
||||
(vector-! (-> s4-0 vec 1) (-> arg2 vertex 0) (-> arg2 vertex 2))
|
||||
(vector-! (-> s4-0 vec 2) (-> arg2 vertex 1) (-> arg2 vertex 0))
|
||||
(set! (-> s4-0 byte0) -1)
|
||||
(set! (-> s4-0 float1) -1.0)
|
||||
(dotimes (v1-5 3)
|
||||
(.lvf vf1 (&-> (-> s4-0 vec v1-5) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov a0-8 vf1)
|
||||
(set! (-> s4-0 float0) a0-8)
|
||||
(when (< (-> s4-0 float1) (-> s4-0 float0))
|
||||
(set! (-> s4-0 float1) (-> s4-0 float0))
|
||||
(set! (-> s4-0 byte0) v1-5)
|
||||
)
|
||||
(let ((s4-0 (new 'stack-no-clear 'h-sled-stack-var0)))
|
||||
(vector-! (-> s4-0 vec 0) (-> arg2 vertex 2) (-> arg2 vertex 1))
|
||||
(vector-! (-> s4-0 vec 1) (-> arg2 vertex 0) (-> arg2 vertex 2))
|
||||
(vector-! (-> s4-0 vec 2) (-> arg2 vertex 1) (-> arg2 vertex 0))
|
||||
(set! (-> s4-0 byte0) -1)
|
||||
(set! (-> s4-0 float1) -1.0)
|
||||
(dotimes (v1-5 3)
|
||||
(set! (-> s4-0 float0) (vector-length-squared (-> s4-0 vec v1-5)))
|
||||
(when (< (-> s4-0 float1) (-> s4-0 float0))
|
||||
(set! (-> s4-0 float1) (-> s4-0 float0))
|
||||
(set! (-> s4-0 byte0) v1-5)
|
||||
)
|
||||
(if (< (-> s4-0 byte0) 2)
|
||||
(vector-copy! (-> s4-0 vec (-> s4-0 byte0)) (-> s4-0 vec 2))
|
||||
)
|
||||
(dotimes (s3-0 2)
|
||||
(let ((s2-0 (-> s4-0 vec1 s3-0)))
|
||||
(vector-normalize-copy! s2-0 (-> s4-0 vec s3-0) 1.0)
|
||||
(let ((f0-5 (vector-dot s2-0 arg1)))
|
||||
(when (< f0-5 0.0)
|
||||
(vector-float*! s2-0 s2-0 -1.0)
|
||||
(set! f0-5 (* -1.0 f0-5))
|
||||
)
|
||||
(if (>= f0-5 0.866)
|
||||
(vector-copy! arg0 s2-0)
|
||||
)
|
||||
)
|
||||
(if (< (-> s4-0 byte0) 2)
|
||||
(vector-copy! (-> s4-0 vec (-> s4-0 byte0)) (-> s4-0 vec 2))
|
||||
)
|
||||
(dotimes (s3-0 2)
|
||||
(let ((s2-0 (-> s4-0 vec1 s3-0)))
|
||||
(vector-normalize-copy! s2-0 (-> s4-0 vec s3-0) 1.0)
|
||||
(let ((f0-5 (vector-dot s2-0 arg1)))
|
||||
(when (< f0-5 0.0)
|
||||
(vector-float*! s2-0 s2-0 -1.0)
|
||||
(set! f0-5 (* -1.0 f0-5))
|
||||
)
|
||||
(if (>= f0-5 0.866)
|
||||
(vector-copy! arg0 s2-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(deftype sled-shot (projectile)
|
||||
@@ -194,53 +179,31 @@
|
||||
)
|
||||
|
||||
(defmethod projectile-method-25 ((this sled-shot))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let* ((gp-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0))
|
||||
(f30-0 (vector-length s5-1))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((gp-0 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0))
|
||||
(f30-0 (vector-length s5-1))
|
||||
)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(let ((v1-4 a1-0))
|
||||
(let ((a0-2 s5-1))
|
||||
(let ((a2-1 0.8))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-2 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-4 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> s4-0 quad) vf6)
|
||||
(let ((f28-0 (-> *part-id-table* 4231 init-specs 4 initial-valuef)))
|
||||
(set! (-> *part-id-table* 4231 init-specs 4 initial-valuef) (vector-length s5-1))
|
||||
(draw-beam (-> *part-id-table* 4231) a1-0 s5-1 #f)
|
||||
(set! (-> *part-id-table* 4231 init-specs 4 initial-valuef) f28-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 4232) s4-0)
|
||||
)
|
||||
(let ((s4-1 (new 'stack-no-clear 'matrix)))
|
||||
(/ f30-0 (meters 9))
|
||||
(-> *part-id-table* 4233 init-specs 3 initial-valuef)
|
||||
(-> *part-id-table* 4233 init-specs 4 initial-valuef)
|
||||
(forward-up->inv-matrix s4-1 s5-1 *up-vector*)
|
||||
(vector-copy! (-> s4-1 trans) gp-0)
|
||||
(launch-particles (-> *part-id-table* 4233) s4-1 :origin-is-matrix #t)
|
||||
(let ((s4-1 (vector+*! (new 'stack-no-clear 'vector) a1-0 s5-1 0.8)))
|
||||
(let ((f28-0 (-> *part-id-table* 4231 init-specs 4 initial-valuef)))
|
||||
(set! (-> *part-id-table* 4231 init-specs 4 initial-valuef) (vector-length s5-1))
|
||||
(draw-beam (-> *part-id-table* 4231) a1-0 s5-1 #f)
|
||||
(set! (-> *part-id-table* 4231 init-specs 4 initial-valuef) f28-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 4232) s4-1)
|
||||
)
|
||||
(let ((s4-2 (new 'stack-no-clear 'matrix)))
|
||||
(/ f30-0 (meters 9))
|
||||
(-> *part-id-table* 4233 init-specs 3 initial-valuef)
|
||||
(-> *part-id-table* 4233 init-specs 4 initial-valuef)
|
||||
(forward-up->inv-matrix s4-2 s5-1 *up-vector*)
|
||||
(vector-copy! (-> s4-2 trans) gp-0)
|
||||
(launch-particles (-> *part-id-table* 4233) s4-2 :origin-is-matrix #t)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod projectile-method-26 ((this sled-shot))
|
||||
@@ -1275,56 +1238,41 @@
|
||||
)
|
||||
|
||||
(defmethod vehicle-method-77 ((this h-sled))
|
||||
(local-vars (v1-10 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag sounds particles) (-> this v-flags))))
|
||||
(let ((v1-3 (-> this rbody)))
|
||||
(cond
|
||||
((logtest? (vehicle-flag overturned) (-> this v-flags))
|
||||
(if (and (not (logtest? (-> this v-flags) (vehicle-flag in-air))) (< 0.0 (-> v1-3 matrix uvec y)))
|
||||
(set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag overturned))))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(when (and (logtest? (-> this v-flags) (vehicle-flag in-air))
|
||||
(not (logtest? (-> this v-flags) (vehicle-flag dead)))
|
||||
(< (-> v1-3 matrix uvec y) 0.0)
|
||||
(let ((v1-9 (-> v1-3 ang-velocity))
|
||||
(f1-2 4.0)
|
||||
)
|
||||
(.lvf vf1 (&-> v1-9 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-10 vf1)
|
||||
(< v1-10 (* f1-2 f1-2))
|
||||
)
|
||||
(set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag sounds particles) (-> this v-flags))))
|
||||
(let ((v1-3 (-> this rbody)))
|
||||
(cond
|
||||
((logtest? (vehicle-flag overturned) (-> this v-flags))
|
||||
(if (and (not (logtest? (-> this v-flags) (vehicle-flag in-air))) (< 0.0 (-> v1-3 matrix uvec y)))
|
||||
(set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag overturned))))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(when (and (logtest? (-> this v-flags) (vehicle-flag in-air))
|
||||
(not (logtest? (-> this v-flags) (vehicle-flag dead)))
|
||||
(< (-> v1-3 matrix uvec y) 0.0)
|
||||
(let ((v1-9 (-> v1-3 ang-velocity))
|
||||
(f1-2 4.0)
|
||||
)
|
||||
(< (vector-length-squared v1-9) (* f1-2 f1-2))
|
||||
)
|
||||
(set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag overturned) (-> this v-flags))))
|
||||
(set-time! (-> this overturned-time))
|
||||
)
|
||||
)
|
||||
(set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag overturned) (-> this v-flags))))
|
||||
(set-time! (-> this overturned-time))
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (logtest? (vehicle-flag player-driving) (-> this v-flags))
|
||||
(when (and (logtest? (-> this controls flags) (vehicle-controls-flag vcf1))
|
||||
(time-elapsed? (-> this shoot-time) (the-as time-frame (-> this shoot-delay)))
|
||||
)
|
||||
(set-time! (-> this shoot-time))
|
||||
(fire-shot this)
|
||||
)
|
||||
(set! (-> *game-info* health-bar-vehicle) (-> this hit-points))
|
||||
)
|
||||
((method-of-type vehicle vehicle-method-77) this)
|
||||
(none)
|
||||
)
|
||||
(when (logtest? (vehicle-flag player-driving) (-> this v-flags))
|
||||
(when (and (logtest? (-> this controls flags) (vehicle-controls-flag vcf1))
|
||||
(time-elapsed? (-> this shoot-time) (the-as time-frame (-> this shoot-delay)))
|
||||
)
|
||||
(set-time! (-> this shoot-time))
|
||||
(fire-shot this)
|
||||
)
|
||||
(set! (-> *game-info* health-bar-vehicle) (-> this hit-points))
|
||||
)
|
||||
((method-of-type vehicle vehicle-method-77) this)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod vehicle-method-106 ((this h-sled))
|
||||
@@ -1439,191 +1387,165 @@
|
||||
)
|
||||
|
||||
(defmethod vehicle-method-97 ((this h-sled) (arg0 float) (arg1 vehicle-physics-work))
|
||||
(local-vars (v1-59 float) (v1-63 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s3-0 (-> this rbody)))
|
||||
(mem-copy! (the-as pointer (-> (the-as h-sled-physics-work arg1) mat)) (the-as pointer (-> s3-0 matrix)) 64)
|
||||
(logior! (-> this v-flags) (vehicle-flag in-air))
|
||||
(logclear! (-> this v-flags) (vehicle-flag on-ground on-flight-level))
|
||||
(vector-reset! (-> this sum-ground-normal))
|
||||
(let ((f30-0 (-> this info handling ground-probe-distance))
|
||||
(s2-0 (new 'stack-no-clear 'collide-query))
|
||||
(let ((s3-0 (-> this rbody)))
|
||||
(mem-copy! (the-as pointer (-> (the-as h-sled-physics-work arg1) mat)) (the-as pointer (-> s3-0 matrix)) 64)
|
||||
(logior! (-> this v-flags) (vehicle-flag in-air))
|
||||
(logclear! (-> this v-flags) (vehicle-flag on-ground on-flight-level))
|
||||
(vector-reset! (-> this sum-ground-normal))
|
||||
(let ((f30-0 (-> this info handling ground-probe-distance))
|
||||
(s2-0 (new 'stack-no-clear 'collide-query))
|
||||
)
|
||||
(set! (-> (the-as h-sled-physics-work arg1) speed-factor)
|
||||
(fmax 0.0 (fmin 0.9 (* 0.000008138021 (+ -40960.0 (vector-length (-> s3-0 lin-velocity))))))
|
||||
)
|
||||
(set! (-> (the-as h-sled-physics-work arg1) speed-factor)
|
||||
(fmax 0.0 (fmin 0.9 (* 0.000008138021 (+ -40960.0 (vector-length (-> s3-0 lin-velocity))))))
|
||||
(vector-float*!
|
||||
(-> (the-as h-sled-physics-work arg1) lift-dir)
|
||||
(-> (the-as h-sled-physics-work arg1) mat uvec)
|
||||
-1.0
|
||||
)
|
||||
(vector-float*! (-> s2-0 move-dist) (-> (the-as h-sled-physics-work arg1) lift-dir) (the-as float f30-0))
|
||||
(let ((v1-15 s2-0))
|
||||
(set! (-> v1-15 radius) 409.6)
|
||||
(set! (-> v1-15 collide-with) (collide-spec
|
||||
backgnd
|
||||
bot
|
||||
obstacle
|
||||
hit-by-player-list
|
||||
hit-by-others-list
|
||||
player-list
|
||||
water
|
||||
collectable
|
||||
blocking-plane
|
||||
pusher
|
||||
vehicle-mesh-probeable
|
||||
shield
|
||||
vehicle-sphere-no-probe
|
||||
)
|
||||
)
|
||||
(vector-float*!
|
||||
(-> (the-as h-sled-physics-work arg1) lift-dir)
|
||||
(-> (the-as h-sled-physics-work arg1) mat uvec)
|
||||
-1.0
|
||||
)
|
||||
(vector-float*! (-> s2-0 move-dist) (-> (the-as h-sled-physics-work arg1) lift-dir) (the-as float f30-0))
|
||||
(let ((v1-15 s2-0))
|
||||
(set! (-> v1-15 radius) 409.6)
|
||||
(set! (-> v1-15 collide-with) (collide-spec
|
||||
backgnd
|
||||
bot
|
||||
obstacle
|
||||
hit-by-player-list
|
||||
hit-by-others-list
|
||||
player-list
|
||||
water
|
||||
collectable
|
||||
blocking-plane
|
||||
pusher
|
||||
vehicle-mesh-probeable
|
||||
shield
|
||||
vehicle-sphere-no-probe
|
||||
)
|
||||
)
|
||||
(set! (-> v1-15 ignore-process0) #f)
|
||||
(set! (-> v1-15 ignore-process1) #f)
|
||||
(set! (-> v1-15 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1))
|
||||
(set! (-> v1-15 action-mask) (collide-action solid))
|
||||
)
|
||||
(dotimes (s1-0 (-> this info physics-model lift-thruster-count))
|
||||
(let ((v1-18 (-> this info physics-model lift-thruster-array s1-0))
|
||||
(s0-0 (-> (the-as h-sled-physics-work arg1) probe-work-array s1-0))
|
||||
)
|
||||
(vector-copy! (-> s0-0 local-pos) (-> v1-18 local-pos))
|
||||
(vector-copy! (-> s0-0 local-normal) (-> v1-18 rot))
|
||||
(vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> (the-as h-sled-physics-work arg1) mat))
|
||||
(vector-copy! (-> s0-0 probe-pos) (-> s0-0 world-pos))
|
||||
(rigid-body-control-method-23 s3-0 (-> s0-0 probe-pos) (-> s0-0 velocity))
|
||||
(vector-reset! (-> s0-0 ground-normal))
|
||||
(vector-reset! (-> s0-0 u-dir))
|
||||
(when (logtest? (-> this v-flags) (vehicle-flag enable-collision))
|
||||
(vector-copy! (-> s2-0 start-pos) (-> s0-0 probe-pos))
|
||||
(set! (-> s0-0 probe-uu) (probe-using-line-sphere *collide-cache* s2-0))
|
||||
(cond
|
||||
((and (>= (-> s0-0 probe-uu) 0.0) (!= (-> s2-0 best-other-tri pat mode) 1))
|
||||
(logclear! (-> this v-flags) (vehicle-flag in-air))
|
||||
(logior! (-> this v-flags) (vehicle-flag on-ground))
|
||||
(vector-copy! (-> s0-0 ground-normal) (-> s2-0 best-other-tri normal))
|
||||
(vector+! (-> this sum-ground-normal) (-> this sum-ground-normal) (-> s0-0 ground-normal))
|
||||
(sled-find-mesh-dir (-> s0-0 u-dir) (-> this path-dir) (-> s2-0 best-other-tri))
|
||||
)
|
||||
(else
|
||||
(set! (-> s0-0 probe-uu) 1.0)
|
||||
)
|
||||
)
|
||||
(vector+float*!
|
||||
(-> s0-0 ground-pos)
|
||||
(-> s0-0 probe-pos)
|
||||
(-> (the-as h-sled-physics-work arg1) lift-dir)
|
||||
(the-as float f30-0)
|
||||
)
|
||||
0
|
||||
(set! (-> v1-15 ignore-process0) #f)
|
||||
(set! (-> v1-15 ignore-process1) #f)
|
||||
(set! (-> v1-15 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1))
|
||||
(set! (-> v1-15 action-mask) (collide-action solid))
|
||||
)
|
||||
(dotimes (s1-0 (-> this info physics-model lift-thruster-count))
|
||||
(let ((v1-18 (-> this info physics-model lift-thruster-array s1-0))
|
||||
(s0-0 (-> (the-as h-sled-physics-work arg1) probe-work-array s1-0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(vector-copy! (-> this prev-tunnel-dir) (-> this tunnel-dir))
|
||||
(vector-reset! (-> this tunnel-dir))
|
||||
(dotimes (v1-55 (-> this info physics-model lift-thruster-count))
|
||||
(let ((a2-5 (-> (the-as h-sled-physics-work arg1) probe-work-array v1-55)))
|
||||
(vector+! (-> this tunnel-dir) (-> this tunnel-dir) (-> a2-5 u-dir))
|
||||
)
|
||||
)
|
||||
(let ((f0-9 0.0))
|
||||
(.lvf vf1 (&-> (-> this tunnel-dir) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-59 vf1)
|
||||
(if (< f0-9 v1-59)
|
||||
(vector-normalize! (-> this tunnel-dir) 1.0)
|
||||
(vector-copy! (-> this tunnel-dir) (-> this path-dir))
|
||||
)
|
||||
)
|
||||
(let ((f0-10 0.0))
|
||||
(.lvf vf1 (&-> (-> this sum-ground-normal) quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-63 vf1)
|
||||
(when (< f0-10 v1-63)
|
||||
(vector-copy! (-> this normal-dir) (-> this sum-ground-normal))
|
||||
(vector-normalize! (-> this normal-dir) 1.0)
|
||||
(vector-float*! (-> this gravity-dir) (-> this normal-dir) -1.0)
|
||||
(vector-cross! (-> this side-dir) (-> this normal-dir) (-> this tunnel-dir))
|
||||
(vector-normalize! (-> this side-dir) 1.0)
|
||||
)
|
||||
)
|
||||
(when (logtest? (-> this v-flags) (vehicle-flag on-ground))
|
||||
(let ((s2-1 (new 'stack-no-clear 'inline-array 'vector 1)))
|
||||
(matrix-from-two-vectors! (the-as matrix (-> s2-1 0)) (-> this prev-tunnel-dir) (-> this tunnel-dir))
|
||||
(vector-rotate*! (-> s3-0 lin-momentum) (-> s3-0 lin-momentum) (the-as matrix (-> s2-1 0)))
|
||||
)
|
||||
(init-velocities! (-> this rbody))
|
||||
)
|
||||
(dotimes (s2-2 (-> this info physics-model lift-thruster-count))
|
||||
(let ((v1-78 (-> (the-as h-sled-physics-work arg1) probe-work-array s2-2)))
|
||||
(vector-copy! (-> (the-as h-sled-physics-work arg1) world-pos) (-> v1-78 world-pos))
|
||||
(vector-copy! (-> (the-as h-sled-physics-work arg1) velocity) (-> v1-78 velocity))
|
||||
(let ((s1-1 (new 'stack-no-clear 'vector)))
|
||||
(when (< (-> v1-78 probe-uu) 1.0)
|
||||
(set! (-> s1-1 x) (- 0.5 (-> v1-78 probe-uu)))
|
||||
(let ((a0-54 (-> (the-as h-sled-physics-work arg1) force))
|
||||
(a1-26 (-> v1-78 ground-normal))
|
||||
(f0-15 0.5)
|
||||
(f1-7 arg0)
|
||||
)
|
||||
(vector-float*!
|
||||
a0-54
|
||||
a1-26
|
||||
(* f0-15
|
||||
(/ 1.0 f1-7)
|
||||
(-> this info physics-model inv-lift-thruster-count)
|
||||
(-> this info info mass)
|
||||
(- (vector-dot (-> (the-as h-sled-physics-work arg1) velocity) (-> v1-78 ground-normal)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(apply-impact!
|
||||
s3-0
|
||||
(-> (the-as h-sled-physics-work arg1) world-pos)
|
||||
(-> (the-as h-sled-physics-work arg1) force)
|
||||
)
|
||||
(let ((f0-25
|
||||
(* 16.0
|
||||
(-> this info info mass)
|
||||
(-> this info extra gravity)
|
||||
(-> this info physics-model inv-lift-thruster-count)
|
||||
(-> s1-1 x)
|
||||
(-> this info handling spring-lift-factor)
|
||||
)
|
||||
)
|
||||
)
|
||||
(vector-float*!
|
||||
(-> (the-as h-sled-physics-work arg1) force)
|
||||
(-> (the-as h-sled-physics-work arg1) lift-dir)
|
||||
(* -1.0 f0-25)
|
||||
)
|
||||
)
|
||||
(apply-impact!
|
||||
s3-0
|
||||
(-> (the-as h-sled-physics-work arg1) world-pos)
|
||||
(-> (the-as h-sled-physics-work arg1) force)
|
||||
(vector-copy! (-> s0-0 local-pos) (-> v1-18 local-pos))
|
||||
(vector-copy! (-> s0-0 local-normal) (-> v1-18 rot))
|
||||
(vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> (the-as h-sled-physics-work arg1) mat))
|
||||
(vector-copy! (-> s0-0 probe-pos) (-> s0-0 world-pos))
|
||||
(rigid-body-control-method-23 s3-0 (-> s0-0 probe-pos) (-> s0-0 velocity))
|
||||
(vector-reset! (-> s0-0 ground-normal))
|
||||
(vector-reset! (-> s0-0 u-dir))
|
||||
(when (logtest? (-> this v-flags) (vehicle-flag enable-collision))
|
||||
(vector-copy! (-> s2-0 start-pos) (-> s0-0 probe-pos))
|
||||
(set! (-> s0-0 probe-uu) (probe-using-line-sphere *collide-cache* s2-0))
|
||||
(cond
|
||||
((and (>= (-> s0-0 probe-uu) 0.0) (!= (-> s2-0 best-other-tri pat mode) 1))
|
||||
(logclear! (-> this v-flags) (vehicle-flag in-air))
|
||||
(logior! (-> this v-flags) (vehicle-flag on-ground))
|
||||
(vector-copy! (-> s0-0 ground-normal) (-> s2-0 best-other-tri normal))
|
||||
(vector+! (-> this sum-ground-normal) (-> this sum-ground-normal) (-> s0-0 ground-normal))
|
||||
(sled-find-mesh-dir (-> s0-0 u-dir) (-> this path-dir) (-> s2-0 best-other-tri))
|
||||
)
|
||||
(else
|
||||
(set! (-> s0-0 probe-uu) 1.0)
|
||||
)
|
||||
)
|
||||
(vector+float*!
|
||||
(-> s0-0 ground-pos)
|
||||
(-> s0-0 probe-pos)
|
||||
(-> (the-as h-sled-physics-work arg1) lift-dir)
|
||||
(the-as float f30-0)
|
||||
)
|
||||
0
|
||||
)
|
||||
)
|
||||
0
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
(vector-copy! (-> this prev-tunnel-dir) (-> this tunnel-dir))
|
||||
(vector-reset! (-> this tunnel-dir))
|
||||
(dotimes (v1-55 (-> this info physics-model lift-thruster-count))
|
||||
(let ((a2-5 (-> (the-as h-sled-physics-work arg1) probe-work-array v1-55)))
|
||||
(vector+! (-> this tunnel-dir) (-> this tunnel-dir) (-> a2-5 u-dir))
|
||||
)
|
||||
)
|
||||
(if (< 0.0 (vector-length-squared (-> this tunnel-dir)))
|
||||
(vector-normalize! (-> this tunnel-dir) 1.0)
|
||||
(vector-copy! (-> this tunnel-dir) (-> this path-dir))
|
||||
)
|
||||
(when (< 0.0 (vector-length-squared (-> this sum-ground-normal)))
|
||||
(vector-copy! (-> this normal-dir) (-> this sum-ground-normal))
|
||||
(vector-normalize! (-> this normal-dir) 1.0)
|
||||
(vector-float*! (-> this gravity-dir) (-> this normal-dir) -1.0)
|
||||
(vector-cross! (-> this side-dir) (-> this normal-dir) (-> this tunnel-dir))
|
||||
(vector-normalize! (-> this side-dir) 1.0)
|
||||
)
|
||||
(when (logtest? (-> this v-flags) (vehicle-flag on-ground))
|
||||
(let ((s2-1 (new 'stack-no-clear 'inline-array 'vector 1)))
|
||||
(matrix-from-two-vectors! (the-as matrix (-> s2-1 0)) (-> this prev-tunnel-dir) (-> this tunnel-dir))
|
||||
(vector-rotate*! (-> s3-0 lin-momentum) (-> s3-0 lin-momentum) (the-as matrix (-> s2-1 0)))
|
||||
)
|
||||
(init-velocities! (-> this rbody))
|
||||
)
|
||||
(dotimes (s2-2 (-> this info physics-model lift-thruster-count))
|
||||
(let ((v1-78 (-> (the-as h-sled-physics-work arg1) probe-work-array s2-2)))
|
||||
(vector-copy! (-> (the-as h-sled-physics-work arg1) world-pos) (-> v1-78 world-pos))
|
||||
(vector-copy! (-> (the-as h-sled-physics-work arg1) velocity) (-> v1-78 velocity))
|
||||
(let ((s1-1 (new 'stack-no-clear 'vector)))
|
||||
(when (< (-> v1-78 probe-uu) 1.0)
|
||||
(set! (-> s1-1 x) (- 0.5 (-> v1-78 probe-uu)))
|
||||
(let ((a0-54 (-> (the-as h-sled-physics-work arg1) force))
|
||||
(a1-26 (-> v1-78 ground-normal))
|
||||
(f0-15 0.5)
|
||||
(f1-7 arg0)
|
||||
)
|
||||
(vector-float*!
|
||||
a0-54
|
||||
a1-26
|
||||
(* f0-15
|
||||
(/ 1.0 f1-7)
|
||||
(-> this info physics-model inv-lift-thruster-count)
|
||||
(-> this info info mass)
|
||||
(- (vector-dot (-> (the-as h-sled-physics-work arg1) velocity) (-> v1-78 ground-normal)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(apply-impact!
|
||||
s3-0
|
||||
(-> (the-as h-sled-physics-work arg1) world-pos)
|
||||
(-> (the-as h-sled-physics-work arg1) force)
|
||||
)
|
||||
(let ((f0-25
|
||||
(* 16.0
|
||||
(-> this info info mass)
|
||||
(-> this info extra gravity)
|
||||
(-> this info physics-model inv-lift-thruster-count)
|
||||
(-> s1-1 x)
|
||||
(-> this info handling spring-lift-factor)
|
||||
)
|
||||
)
|
||||
)
|
||||
(vector-float*!
|
||||
(-> (the-as h-sled-physics-work arg1) force)
|
||||
(-> (the-as h-sled-physics-work arg1) lift-dir)
|
||||
(* -1.0 f0-25)
|
||||
)
|
||||
)
|
||||
(apply-impact!
|
||||
s3-0
|
||||
(-> (the-as h-sled-physics-work arg1) world-pos)
|
||||
(-> (the-as h-sled-physics-work arg1) force)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod apply-gravity! ((this h-sled) (arg0 float))
|
||||
@@ -1852,72 +1774,55 @@
|
||||
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defmethod vehicle-method-78 ((this h-sled))
|
||||
(local-vars (a0-13 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0 (new 'stack-no-clear 'h-sled-stack-var1)))
|
||||
(matrix-copy! (-> s5-0 mat) (-> this node-list data 0 bone transform))
|
||||
(let ((s4-0 (new 'static 'inline-array vector 8
|
||||
(new 'static 'vector :x 6144.0 :y 4096.0 :z -20480.0 :w 1.0)
|
||||
(new 'static 'vector :x -6144.0 :y 4096.0 :z -20480.0 :w 1.0)
|
||||
(new 'static 'vector :x 1638.4 :y 4096.0 :z -17203.2 :w 1.0)
|
||||
(new 'static 'vector :x -1638.4 :y 4096.0 :z -17203.2 :w 1.0)
|
||||
(new 'static 'vector :x 7782.4 :y 7782.4 :z -12288.0 :w 1.0)
|
||||
(new 'static 'vector :x -7782.4 :y 7782.4 :z -12288.0 :w 1.0)
|
||||
(new 'static 'vector :x 11059.2 :y 5734.4 :z -1638.4 :w 1.0)
|
||||
(new 'static 'vector :x -11059.2 :y 5734.4 :z -1638.4 :w 1.0)
|
||||
)
|
||||
(let ((s5-0 (new 'stack-no-clear 'h-sled-stack-var1)))
|
||||
(matrix-copy! (-> s5-0 mat) (-> this node-list data 0 bone transform))
|
||||
(let ((s4-0 (new 'static 'inline-array vector 8
|
||||
(new 'static 'vector :x 6144.0 :y 4096.0 :z -20480.0 :w 1.0)
|
||||
(new 'static 'vector :x -6144.0 :y 4096.0 :z -20480.0 :w 1.0)
|
||||
(new 'static 'vector :x 1638.4 :y 4096.0 :z -17203.2 :w 1.0)
|
||||
(new 'static 'vector :x -1638.4 :y 4096.0 :z -17203.2 :w 1.0)
|
||||
(new 'static 'vector :x 7782.4 :y 7782.4 :z -12288.0 :w 1.0)
|
||||
(new 'static 'vector :x -7782.4 :y 7782.4 :z -12288.0 :w 1.0)
|
||||
(new 'static 'vector :x 11059.2 :y 5734.4 :z -1638.4 :w 1.0)
|
||||
(new 'static 'vector :x -11059.2 :y 5734.4 :z -1638.4 :w 1.0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (logtest? (vehicle-flag ignition) (-> this v-flags))
|
||||
(dotimes (s3-0 8)
|
||||
(quad-copy!
|
||||
(the-as pointer (-> s5-0 glow))
|
||||
(the-as pointer (-> this info particle-common headlight-glow-template))
|
||||
4
|
||||
)
|
||||
(when (logtest? (vehicle-flag ignition) (-> this v-flags))
|
||||
(dotimes (s3-0 8)
|
||||
(quad-copy!
|
||||
(the-as pointer (-> s5-0 glow))
|
||||
(the-as pointer (-> this info particle-common headlight-glow-template))
|
||||
4
|
||||
)
|
||||
(vector-matrix*! (-> s5-0 vec0) (-> s4-0 s3-0) (-> s5-0 mat))
|
||||
(let* ((v1-7 (-> s5-0 glow))
|
||||
(a1-3 (-> s5-0 vec0))
|
||||
(f0-0 (-> v1-7 position w))
|
||||
)
|
||||
(vector-copy! (-> v1-7 position) a1-3)
|
||||
(set! (-> v1-7 position w) f0-0)
|
||||
)
|
||||
0
|
||||
(set! (-> s5-0 glow rot-angle) (* 182.04445 (rand-vu-float-range -17.0 -13.0)))
|
||||
(set! (-> s5-0 glow color x) 0.0)
|
||||
(set! (-> s5-0 glow color y) 0.0)
|
||||
(set! (-> s5-0 glow color z) 255.0)
|
||||
(set! (-> s5-0 glow color w) (* 2.0 (rand-vu-float-range 16.0 18.0)))
|
||||
(add! *simple-sprite-system* (-> s5-0 glow))
|
||||
(vector-matrix*! (-> s5-0 vec0) (-> s4-0 s3-0) (-> s5-0 mat))
|
||||
(let* ((v1-7 (-> s5-0 glow))
|
||||
(a1-3 (-> s5-0 vec0))
|
||||
(f0-0 (-> v1-7 position w))
|
||||
)
|
||||
(vector-copy! (-> v1-7 position) a1-3)
|
||||
(set! (-> v1-7 position w) f0-0)
|
||||
)
|
||||
0
|
||||
(set! (-> s5-0 glow rot-angle) (* 182.04445 (rand-vu-float-range -17.0 -13.0)))
|
||||
(set! (-> s5-0 glow color x) 0.0)
|
||||
(set! (-> s5-0 glow color y) 0.0)
|
||||
(set! (-> s5-0 glow color z) 255.0)
|
||||
(set! (-> s5-0 glow color w) (* 2.0 (rand-vu-float-range 16.0 18.0)))
|
||||
(add! *simple-sprite-system* (-> s5-0 glow))
|
||||
)
|
||||
)
|
||||
(when (logtest? (vehicle-flag ignition) (-> this v-flags))
|
||||
(dotimes (s4-1 4)
|
||||
(let ((v1-21 (-> this ground-pos-array s4-1))
|
||||
(f0-8 0.0)
|
||||
)
|
||||
(.lvf vf1 (&-> v1-21 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov a0-13 vf1)
|
||||
(when (< f0-8 a0-13)
|
||||
(vector-copy! (-> s5-0 mat trans) v1-21)
|
||||
(spawn-from-mat (-> this parts s4-1) (-> s5-0 mat))
|
||||
)
|
||||
)
|
||||
(when (logtest? (vehicle-flag ignition) (-> this v-flags))
|
||||
(dotimes (s4-1 4)
|
||||
(let ((v1-21 (-> this ground-pos-array s4-1)))
|
||||
(when (< 0.0 (vector-length-squared v1-21))
|
||||
(vector-copy! (-> s5-0 mat trans) v1-21)
|
||||
(spawn-from-mat (-> this parts s4-1) (-> s5-0 mat))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -259,57 +259,35 @@
|
||||
)
|
||||
|
||||
(defmethod projectile-method-25 ((this ashelin-shot))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let* ((v1-1 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 a1-0))
|
||||
(gp-1 (vector+*! (new 'stack-no-clear 'vector) a1-0 s5-1 0.8))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((v1-1 (-> this root trans))
|
||||
(a1-0 (-> this tail-pos))
|
||||
(s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 a1-0))
|
||||
(gp-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let ((v1-2 a1-0))
|
||||
(let ((a0-2 s5-1))
|
||||
(let ((a2-1 0.8))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-2 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-2 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> gp-0 quad) vf6)
|
||||
(let ((f30-0 (-> *part-id-table* 900 init-specs 4 initial-valuef)))
|
||||
(set! (-> *part-id-table* 900 init-specs 4 initial-valuef) (fmin f30-0 (vector-length s5-1)))
|
||||
(draw-beam (-> *part-id-table* 900) a1-0 s5-1 #f)
|
||||
(set! (-> *part-id-table* 900 init-specs 4 initial-valuef) f30-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 901) gp-0)
|
||||
(let ((f0-4 (vector-dot s5-1 (-> (camera-matrix) fvec))))
|
||||
(when (< 0.0 f0-4)
|
||||
(let ((f0-5 (* f0-4 f0-4))
|
||||
(f30-1 (-> *part-id-table* 902 init-specs 8 initial-valuef))
|
||||
(f28-0 (-> *part-id-table* 902 init-specs 8 random-rangef))
|
||||
)
|
||||
(set! (-> *part-id-table* 902 init-specs 8 initial-valuef) (* f30-1 f0-5))
|
||||
(set! (-> *part-id-table* 902 init-specs 8 random-rangef) (* f28-0 f0-5))
|
||||
(launch-particles (-> *part-id-table* 902) gp-0)
|
||||
(set! (-> *part-id-table* 902 init-specs 8 initial-valuef) f30-1)
|
||||
(set! (-> *part-id-table* 902 init-specs 8 random-rangef) f28-0)
|
||||
)
|
||||
(let ((f30-0 (-> *part-id-table* 900 init-specs 4 initial-valuef)))
|
||||
(set! (-> *part-id-table* 900 init-specs 4 initial-valuef) (fmin f30-0 (vector-length s5-1)))
|
||||
(draw-beam (-> *part-id-table* 900) a1-0 s5-1 #f)
|
||||
(set! (-> *part-id-table* 900 init-specs 4 initial-valuef) f30-0)
|
||||
)
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 901) gp-1)
|
||||
(let ((f0-4 (vector-dot s5-1 (-> (camera-matrix) fvec))))
|
||||
(when (< 0.0 f0-4)
|
||||
(let ((f0-5 (* f0-4 f0-4))
|
||||
(f30-1 (-> *part-id-table* 902 init-specs 8 initial-valuef))
|
||||
(f28-0 (-> *part-id-table* 902 init-specs 8 random-rangef))
|
||||
)
|
||||
(set! (-> *part-id-table* 902 init-specs 8 initial-valuef) (* f30-1 f0-5))
|
||||
(set! (-> *part-id-table* 902 init-specs 8 random-rangef) (* f28-0 f0-5))
|
||||
(launch-particles (-> *part-id-table* 902) gp-1)
|
||||
(set! (-> *part-id-table* 902 init-specs 8 initial-valuef) f30-1)
|
||||
(set! (-> *part-id-table* 902 init-specs 8 random-rangef) f28-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod projectile-method-26 ((this ashelin-shot))
|
||||
|
||||
@@ -1230,61 +1230,47 @@
|
||||
)
|
||||
|
||||
(defmethod ashelin-method-248 ((this ashelin) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 float))
|
||||
(local-vars (v1-23 float) (sv-272 vector))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
(local-vars (sv-272 vector))
|
||||
(let* ((v1-0 (-> this nav))
|
||||
(a0-3 (-> v1-0 state mesh sphere-hash sphere-array))
|
||||
(a1-1 (-> v1-0 sphere-id-array))
|
||||
(a2-2 (-> v1-0 state mesh bounds))
|
||||
(a3-1 (-> v1-0 root-nav-sphere))
|
||||
(t0-1 (-> v1-0 sphere-count))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((v1-0 (-> this nav))
|
||||
(a0-3 (-> v1-0 state mesh sphere-hash sphere-array))
|
||||
(a1-1 (-> v1-0 sphere-id-array))
|
||||
(a2-2 (-> v1-0 state mesh bounds))
|
||||
(a3-1 (-> v1-0 root-nav-sphere))
|
||||
(t0-1 (-> v1-0 sphere-count))
|
||||
)
|
||||
(dotimes (t1-1 t0-1)
|
||||
(let ((t3-0 (-> a0-3 (-> a1-1 t1-1)))
|
||||
(t2-4 (-> v1-0 sphere-array t1-1))
|
||||
)
|
||||
(vector-! (the-as vector t2-4) (the-as vector t3-0) (the-as vector a2-2))
|
||||
(set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-1 w)))
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(let ((s0-0 (new 'stack-no-clear 'nav-avoid-spheres-params)))
|
||||
(vector-! (-> s0-0 current-pos) (-> this root trans) (the-as vector (-> this nav state mesh bounds)))
|
||||
(set! sv-272 (-> s0-0 travel))
|
||||
(set! (-> sv-272 x) (sin arg1))
|
||||
(set! (-> sv-272 y) 0.0)
|
||||
(set! (-> sv-272 z) (cos arg1))
|
||||
(set! (-> sv-272 w) 1.0)
|
||||
(vector-float*! (-> s0-0 travel) (-> s0-0 travel) arg3)
|
||||
(vector-copy! (-> s0-0 pref-dir) (-> s0-0 travel))
|
||||
(avoid-spheres-1! (-> this nav) s0-0)
|
||||
(vector-copy! arg0 (-> s0-0 out-travel 0))
|
||||
)
|
||||
0
|
||||
(when (>= arg2 (fabs (deg- arg1 (atan (-> arg0 x) (-> arg0 z)))))
|
||||
(let ((t0-2 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info)))
|
||||
(clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) (-> this nav state current-poly) arg0 t0-2)
|
||||
)
|
||||
(.lvf vf1 (&-> arg0 quad))
|
||||
(.add.w.vf.x vf2 vf0 vf0)
|
||||
(.mul.vf vf1 vf1 vf1)
|
||||
(.mul.x.vf.x acc vf2 vf1)
|
||||
(.add.mul.y.vf.x acc vf2 vf1 acc)
|
||||
(.add.mul.z.vf.x vf1 vf2 vf1 acc)
|
||||
(.mov v1-23 vf1)
|
||||
(let ((f0-11 v1-23)
|
||||
(f1-1 arg4)
|
||||
(dotimes (t1-1 t0-1)
|
||||
(let ((t3-0 (-> a0-3 (-> a1-1 t1-1)))
|
||||
(t2-4 (-> v1-0 sphere-array t1-1))
|
||||
)
|
||||
(>= f0-11 (* f1-1 f1-1))
|
||||
(vector-! (the-as vector t2-4) (the-as vector t3-0) (the-as vector a2-2))
|
||||
(set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-1 w)))
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(let ((s0-0 (new 'stack-no-clear 'nav-avoid-spheres-params)))
|
||||
(vector-! (-> s0-0 current-pos) (-> this root trans) (the-as vector (-> this nav state mesh bounds)))
|
||||
(set! sv-272 (-> s0-0 travel))
|
||||
(set! (-> sv-272 x) (sin arg1))
|
||||
(set! (-> sv-272 y) 0.0)
|
||||
(set! (-> sv-272 z) (cos arg1))
|
||||
(set! (-> sv-272 w) 1.0)
|
||||
(vector-float*! (-> s0-0 travel) (-> s0-0 travel) arg3)
|
||||
(vector-copy! (-> s0-0 pref-dir) (-> s0-0 travel))
|
||||
(avoid-spheres-1! (-> this nav) s0-0)
|
||||
(vector-copy! arg0 (-> s0-0 out-travel 0))
|
||||
)
|
||||
0
|
||||
(when (>= arg2 (fabs (deg- arg1 (atan (-> arg0 x) (-> arg0 z)))))
|
||||
(let ((t0-2 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info)))
|
||||
(clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) (-> this nav state current-poly) arg0 t0-2)
|
||||
)
|
||||
(let ((f0-11 (vector-length-squared arg0))
|
||||
(f1-1 arg4)
|
||||
)
|
||||
(>= f0-11 (* f1-1 f1-1))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod normalize-heading! ((this ashelin) (arg0 nav-control))
|
||||
|
||||
@@ -1506,46 +1506,25 @@
|
||||
)
|
||||
|
||||
(defmethod bot-method-194 ((this bot) (arg0 bot-turn-info) (arg1 process-focusable) (arg2 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s5-0 (-> this root)))
|
||||
(quaternion-copy! (-> arg0 src-quat) (-> s5-0 quat))
|
||||
(vector-z-quaternion! (-> arg0 facing-dir) (-> s5-0 quat))
|
||||
(set! (-> arg0 facing-ry) (atan (-> arg0 facing-dir x) (-> arg0 facing-dir z)))
|
||||
(vector-copy! (-> arg0 targ-pos) (get-trans arg1 3))
|
||||
(set! (-> arg0 targ-ry)
|
||||
(atan (- (-> arg0 targ-pos x) (-> s5-0 trans x)) (- (-> arg0 targ-pos z) (-> s5-0 trans z)))
|
||||
)
|
||||
(let ((a0-7 (get-transv arg1))
|
||||
(a1-6 (-> arg0 predicted-targ-pos))
|
||||
)
|
||||
(let ((v1-4 (-> arg0 targ-pos)))
|
||||
(let ((a2-1 arg2))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-7 quad))
|
||||
(.lvf vf4 (&-> v1-4 quad))
|
||||
(let ((s5-0 (-> this root)))
|
||||
(quaternion-copy! (-> arg0 src-quat) (-> s5-0 quat))
|
||||
(vector-z-quaternion! (-> arg0 facing-dir) (-> s5-0 quat))
|
||||
(set! (-> arg0 facing-ry) (atan (-> arg0 facing-dir x) (-> arg0 facing-dir z)))
|
||||
(vector-copy! (-> arg0 targ-pos) (get-trans arg1 3))
|
||||
(set! (-> arg0 targ-ry)
|
||||
(atan (- (-> arg0 targ-pos x) (-> s5-0 trans x)) (- (-> arg0 targ-pos z) (-> s5-0 trans z)))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a1-6 quad) vf6)
|
||||
)
|
||||
(set! (-> arg0 predicted-targ-ry) (atan
|
||||
(- (-> arg0 predicted-targ-pos x) (-> s5-0 trans x))
|
||||
(- (-> arg0 predicted-targ-pos z) (-> s5-0 trans z))
|
||||
)
|
||||
)
|
||||
(let ((a0-7 (get-transv arg1)))
|
||||
(vector+*! (-> arg0 predicted-targ-pos) (-> arg0 targ-pos) a0-7 arg2)
|
||||
)
|
||||
(set! (-> arg0 ry-diff) (deg- (-> arg0 targ-ry) (-> arg0 facing-ry)))
|
||||
(set! (-> arg0 predicted-ry-diff) (deg- (-> arg0 predicted-targ-ry) (-> arg0 facing-ry)))
|
||||
(set! (-> arg0 predicted-targ-ry) (atan
|
||||
(- (-> arg0 predicted-targ-pos x) (-> s5-0 trans x))
|
||||
(- (-> arg0 predicted-targ-pos z) (-> s5-0 trans z))
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> arg0 ry-diff) (deg- (-> arg0 targ-ry) (-> arg0 facing-ry)))
|
||||
(set! (-> arg0 predicted-ry-diff) (deg- (-> arg0 predicted-targ-ry) (-> arg0 facing-ry)))
|
||||
)
|
||||
|
||||
(defmethod bot-method-220 ((this bot))
|
||||
@@ -1820,70 +1799,19 @@
|
||||
)
|
||||
|
||||
(defmethod bot-method-193 ((this bot) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float))
|
||||
(rlet ((acc :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(vf7 :class vf)
|
||||
(let* ((f1-1 (* arg5 arg5))
|
||||
(f0-2 (* arg5 f1-1))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((f1-1 (* arg5 arg5))
|
||||
(f0-2 (* arg5 f1-1))
|
||||
)
|
||||
(let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2))
|
||||
(f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5)))
|
||||
(f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1)))
|
||||
)
|
||||
(vector-float*! arg0 arg1 f2-3)
|
||||
(let ((t2-1 arg0))
|
||||
(let ((v1-10 arg0))
|
||||
(let ((a0-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2)))
|
||||
(let ((a2-1 f3-7))
|
||||
(.mov vf7 a2-1)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-3 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-10 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> t2-1 quad) vf6)
|
||||
(let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2))
|
||||
(f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5)))
|
||||
(f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1)))
|
||||
)
|
||||
(let ((a2-2 arg0))
|
||||
(let ((v1-11 arg0))
|
||||
(let ((a0-5 (vector+! (new 'stack-no-clear 'vector) arg3 arg4)))
|
||||
(let ((a3-2 f1-3))
|
||||
(.mov vf7 a3-2)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-5 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-11 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> a2-2 quad) vf6)
|
||||
)
|
||||
)
|
||||
(let ((v1-12 arg0))
|
||||
(let ((a0-6 arg0))
|
||||
(let ((a1-1 arg3))
|
||||
(let ((a2-3 f0-2))
|
||||
(.mov vf7 a2-3)
|
||||
)
|
||||
(.lvf vf5 (&-> a1-1 quad))
|
||||
)
|
||||
(.lvf vf4 (&-> a0-6 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.x.vf.xyz acc vf5 vf7)
|
||||
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
|
||||
(.svf (&-> v1-12 quad) vf6)
|
||||
)
|
||||
(vector-float*! arg0 arg1 f2-3)
|
||||
(vector+*! arg0 arg0 (vector+! (new 'stack-no-clear 'vector) arg1 arg2) f3-7)
|
||||
(vector+*! arg0 arg0 (vector+! (new 'stack-no-clear 'vector) arg3 arg4) f1-3)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
(vector+*! arg0 arg0 arg3 f0-2)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user