首页 > 数据库技术 > 详细

FEMFX 仿真流程之 FmTaskFuncStepVelocityRebuildBvh

时间:2020-04-14 20:15:50      阅读:58      评论:0      收藏:0      [点我收藏+]

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 等更新一下。

FEMFX 仿真流程之 FmTaskFuncStepVelocityRebuildBvh

原文:https://www.cnblogs.com/wghou09/p/12699520.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!