chore: add more comments
This commit is contained in:
committed by
Sébastien Crozet
parent
cfddaa3c46
commit
edaa36ac7e
@@ -13,7 +13,6 @@ pub struct TOIEntry {
|
||||
// We call this "pseudo" intersection because this also
|
||||
// includes colliders pairs with mismatching solver_groups.
|
||||
pub is_pseudo_intersection_test: bool,
|
||||
pub timestamp: usize,
|
||||
}
|
||||
|
||||
impl TOIEntry {
|
||||
@@ -24,7 +23,6 @@ impl TOIEntry {
|
||||
c2: ColliderHandle,
|
||||
b2: Option<RigidBodyHandle>,
|
||||
is_pseudo_intersection_test: bool,
|
||||
timestamp: usize,
|
||||
) -> Self {
|
||||
Self {
|
||||
toi,
|
||||
@@ -33,7 +31,6 @@ impl TOIEntry {
|
||||
c2,
|
||||
b2,
|
||||
is_pseudo_intersection_test,
|
||||
timestamp,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +146,6 @@ impl TOIEntry {
|
||||
ch2,
|
||||
co2.parent.map(|p| p.handle),
|
||||
is_pseudo_intersection_test,
|
||||
0,
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
@@ -569,8 +569,6 @@ impl Multibody {
|
||||
return; // Nothing to do.
|
||||
}
|
||||
|
||||
let mut kinematic_ndofs = 0;
|
||||
|
||||
if self.augmented_mass.ncols() != self.ndofs {
|
||||
// TODO: do a resize instead of a full reallocation.
|
||||
self.augmented_mass = DMatrix::zeros(self.ndofs, self.ndofs);
|
||||
@@ -1058,7 +1056,7 @@ impl Multibody {
|
||||
bodies: &RigidBodySet,
|
||||
link_id: usize,
|
||||
displacement: Option<&[Real]>,
|
||||
mut out_jacobian: Option<&mut Jacobian<Real>>,
|
||||
out_jacobian: Option<&mut Jacobian<Real>>,
|
||||
) -> Isometry<Real> {
|
||||
let branch = self.kinematic_branch(link_id);
|
||||
self.forward_kinematics_single_branch(bodies, &branch, displacement, out_jacobian)
|
||||
|
||||
@@ -17,6 +17,10 @@ use na::{UnitQuaternion, Vector3};
|
||||
pub struct MultibodyJoint {
|
||||
/// The joint’s description.
|
||||
pub data: GenericJoint,
|
||||
/// Is the joint a kinematic joint?
|
||||
///
|
||||
/// Kinematic joint velocities are never changed by the physics engine. This gives the user
|
||||
/// total control over the values of their degrees of freedoms.
|
||||
pub kinematic: bool,
|
||||
pub(crate) coords: SpacialVector<Real>,
|
||||
pub(crate) joint_rot: Rotation<Real>,
|
||||
|
||||
@@ -158,7 +158,6 @@ impl MultibodyJointSet {
|
||||
kinematic: bool,
|
||||
wake_up: bool,
|
||||
) -> Option<MultibodyJointHandle> {
|
||||
println!("Inserting kinematic: {}", kinematic);
|
||||
let link1 = self.rb2mb.get(body1.0).copied().unwrap_or_else(|| {
|
||||
let mb_handle = self.multibodies.insert(Multibody::with_root(body1, true));
|
||||
MultibodyLinkId {
|
||||
|
||||
@@ -28,6 +28,7 @@ use {
|
||||
#[derive(Debug)]
|
||||
pub struct ConstraintsCounts {
|
||||
pub num_constraints: usize,
|
||||
#[allow(dead_code)] // Keep this around for now. Might be useful once we rework parallelism.
|
||||
pub num_jacobian_lines: usize,
|
||||
}
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ use crate::dynamics::{GenericJoint, ImpulseJoint, IntegrationParameters, JointIn
|
||||
use crate::math::{AngVector, Isometry, Matrix, Point, Real, Rotation, Vector, ANG_DIM, DIM};
|
||||
use crate::prelude::RigidBodySet;
|
||||
use crate::utils;
|
||||
use crate::utils::{IndexMut2, SimdCrossMatrix, SimdDot, SimdQuat, SimdRealCopy};
|
||||
use crate::utils::{IndexMut2, SimdCrossMatrix, SimdDot, SimdRealCopy};
|
||||
use na::SMatrix;
|
||||
|
||||
#[cfg(feature = "dim3")]
|
||||
use crate::utils::SimdBasis;
|
||||
use crate::utils::{SimdBasis, SimdQuat};
|
||||
|
||||
#[cfg(feature = "simd-is-enabled")]
|
||||
use crate::math::{SimdReal, SIMD_WIDTH};
|
||||
@@ -345,9 +345,11 @@ impl JointOneBodyConstraintBuilderSimd {
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct JointTwoBodyConstraintHelper<N: SimdRealCopy> {
|
||||
pub basis: Matrix<N>,
|
||||
#[cfg(feature = "dim3")]
|
||||
pub basis2: Matrix<N>, // TODO: used for angular coupling. Can we avoid storing this?
|
||||
pub cmat1_basis: SMatrix<N, ANG_DIM, DIM>,
|
||||
pub cmat2_basis: SMatrix<N, ANG_DIM, DIM>,
|
||||
#[cfg(feature = "dim3")]
|
||||
pub ang_basis: SMatrix<N, ANG_DIM, ANG_DIM>,
|
||||
pub lin_err: Vector<N>,
|
||||
pub ang_err: Rotation<N>,
|
||||
@@ -387,7 +389,7 @@ impl<N: SimdRealCopy> JointTwoBodyConstraintHelper<N> {
|
||||
let cmat1 = r1.gcross_matrix();
|
||||
let cmat2 = r2.gcross_matrix();
|
||||
|
||||
#[allow(unused_mut)] // The mut is needed for 3D
|
||||
#[cfg(feature = "dim3")]
|
||||
let mut ang_basis = frame1.rotation.diff_conj1_2(&frame2.rotation).transpose();
|
||||
#[allow(unused_mut)] // The mut is needed for 3D
|
||||
let mut ang_err = frame1.rotation.inverse() * frame2.rotation;
|
||||
@@ -401,9 +403,11 @@ impl<N: SimdRealCopy> JointTwoBodyConstraintHelper<N> {
|
||||
|
||||
Self {
|
||||
basis,
|
||||
#[cfg(feature = "dim3")]
|
||||
basis2: frame2.rotation.to_rotation_matrix().into_inner(),
|
||||
cmat1_basis: cmat1 * basis,
|
||||
cmat2_basis: cmat2 * basis,
|
||||
#[cfg(feature = "dim3")]
|
||||
ang_basis,
|
||||
lin_err,
|
||||
ang_err,
|
||||
|
||||
Reference in New Issue
Block a user