提问人:Berkay Onur 提问时间:11/3/2023 最后编辑:Berkay Onur 更新时间:11/3/2023 访问量:30
Youngs 模量弹簧应变
Youngs Modulus Spring Strain
问:
我需要模拟钢应变。但是我不能增加足够的压力。如果我愿意,它的爆炸和阻尼值无法修复。
这是我的代码:
Vector3 delta = distance_joint.FirstNode.transform.position - distance_joint.SecondNode.transform.position;
float deltalength = delta.magnitude;
// Calculate strain
float strain = (deltalength - distance_joint.Distance) / distance_joint.Distance;
// Calculate the spring force based on Young's Modulus
Vector3 force = delta.normalized * SpringK * strain;
// Calculate relative velocity
Vector3 relativeVelocity = distance_joint.SecondNode.GetVelocity() - distance_joint.FirstNode.GetVelocity();
// Damping coefficient (you can adjust this value)
float dampingCoefficient = SpringDamping;
// Calculate the damping force based on relative velocity
Vector3 dampingForce = -dampingCoefficient * relativeVelocity;
// Combine spring force and damping force
force += dampingForce;
// Apply forces to the connected nodes
distance_joint.SecondNode.AddForce(force);
distance_joint.FirstNode.AddForce(-force);
我想做一个汽车骨架。我需要模拟像钢一样的材料应变。
答: 暂无答案
下一个:加农炮火力相位器3
评论