forgot to normalize an axis
This commit is contained in:
parent
d38a17e812
commit
87c0a0dffe
11
src/lib.rs
11
src/lib.rs
@ -127,7 +127,7 @@ impl IkConstraint {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let forward = (target - from_position).normalize();
|
let forward = (target - from_position).normalize();
|
||||||
let up = forward.cross(pt.normal);
|
let up = forward.cross(pt.normal).normalize();
|
||||||
let right = up.cross(forward);
|
let right = up.cross(forward);
|
||||||
let orientation = Mat3::from_cols(right, up, forward) * Mat3::from_rotation_z(pt.angle);
|
let orientation = Mat3::from_cols(right, up, forward) * Mat3::from_rotation_z(pt.angle);
|
||||||
|
|
||||||
@ -172,9 +172,10 @@ impl Plugin for InverseKinematicsPlugin {
|
|||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
app.add_plugin(DebugLinesPlugin::default());
|
app.add_plugin(DebugLinesPlugin::default());
|
||||||
|
|
||||||
app.add_system_to_stage(
|
// app.add_system_to_stage(
|
||||||
CoreStage::PostUpdate,
|
// CoreStage::PostUpdate,
|
||||||
inverse_kinematics_solver_system.after(TransformSystem::TransformPropagate),
|
// inverse_kinematics_solver_system.after(TransformSystem::TransformPropagate),
|
||||||
);
|
// );
|
||||||
|
app.add_system(inverse_kinematics_solver_system);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user