zoukankan      html  css  js  c++  java
  • FEMFX 仿真流程之 FmTaskFuncStepVelocityRebuildBvh

    FmTaskFuncStepVelocityRebuildBvhFEMFX/amd_femfx/src/Simulation/FEMFXSimulate.cpp 中定义,主要完成了仿真中(位置)速度的计算、bvh的更新等工作。

    感觉该部分的主要内容为 FmTaskFuncTetMeshStepVelocityRebuildBvhFmTaskFuncRbStepVelocityRebuildBvh 两部分。


    其中,FmTaskFuncTetMeshStepVelocityRebuildBvh 中的内容为软体的计算。

    注:软体也区分软体对象是否为 KINEMATIC 对象。(KINEMATIC 对象意味着该对象的运动是由外界驱动的,也就是说,根据外界输入,直接设定该对象的运动状态、轨迹)

    主要内容为:

    FmStepVelocityImplicitEuler(scene, tetMesh, solverData, gravityVector, kRayleighMassDamping, kRayleighStiffnessDamping, tetMesh->extForceSpeedLimit, timestep, scene->params.epsilonCg);
    
    FmBuildHierarchy(tetMesh, timestep, aabbPadding);
    
    FmAddDeformationConstraints(tetMesh, constraintsBuffer, timestep);
    

    具体为:
    FmStepVelocityImplicitEuler 为求解步骤:

    // Take a simulation step using current dynamic state, external forces, constraints set in tetMeshState.
    // Also resets vertex flag FM_VERT_FLAG_FRACTURED and tetQuatSum
    

    FmBuildHierarchy 为建立等级:

    // For CCD, must build after integration computes new velocities.
    

    FmAddDeformationConstraints 为添加形变约束:

    // Add constraints to prevent excessive deformation.
    // Expects that unconstrained end-of-step velocities have been updated.
    // There are up to three constraints per tetrahedron, and using the same 3D constraints and 3x3 Jacobian submatrices as for contacts and glue.
    // This allows some benefit from SIMD but wastes space when fewer dimensions are needed.
    // Reference: Perez et al., "Strain Limiting for Soft Finger Contact Simulation"
    

    具体的内容,还要进一步分析。


    另外,FmTaskFuncRbStepVelocityRebuildBvh 中基本就是计算刚体在无约束(重力作用)下的运动,计算速度、位置之类的,顺便把碰撞对象 aabb 等更新一下。

  • 相关阅读:
    java线性表之顺序表实现
    Page Rank 算法
    逻辑回归梯度下降推导
    逻辑回归再理解
    最大似然估计的再理解
    DeepLearning中CRF计算原理
    评价指标-精确率、召回率、ROC曲线
    基于贝叶斯平均的新词发现算法
    统计学习方法概论
    多模字符串匹配算法-Aho–Corasick
  • 原文地址:https://www.cnblogs.com/wghou09/p/12699520.html
Copyright © 2011-2022 走看看